Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gZiSQ-0007Fs-Af for pgsql-admin@arkaria.postgresql.org; Wed, 19 Dec 2018 20:28:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gZiSO-0006oP-R2 for pgsql-admin@arkaria.postgresql.org; Wed, 19 Dec 2018 20:28:40 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gZiSO-0006oE-2j for pgsql-admin@lists.postgresql.org; Wed, 19 Dec 2018 20:28:40 +0000 Received: from resqmta-ch2-05v.sys.comcast.net ([2001:558:fe21:29:69:252:207:37]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gZiSL-0005AX-7G for pgsql-admin@postgresql.org; Wed, 19 Dec 2018 20:28:38 +0000 Received: from resomta-ch2-19v.sys.comcast.net ([69.252.207.115]) by resqmta-ch2-05v.sys.comcast.net with ESMTP id ZhJEg8DZYkOg5ZiSHgDsK3; Wed, 19 Dec 2018 20:28:33 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20161114; t=1545251313; bh=vaA3c/zxEI1iLMayw+U46AkT7dNRx/TzTjyB0TeVp8A=; h=Received:Received:Received:From:To:Subject:Date:Message-ID: MIME-Version:Content-Type; b=iRfPszCe8TpCEd4KslSRHVB9/5hks4+X636IRfngrmf1KtzxqOhHQj7rsPT4DD7tE tzp5JjG2lb+K1yEK3Powy3og2EJD1r5M0Qf+YsuauvpTqrNIPWfKvWQ3iJONaluw+f kD5GBwIi+BQ18ATR0fNGSfmFaNkibNFf8s4/IdgIN1vBXePkXJej2DBFJFI2qKCpYd Mjeal+6uyekS8bIbwjecMqfnYtNXidVLRZ/SuGtJjsHZ0c89L22KDbeLDiuPXoM9bv K4mClh6shL2w5EiUyZPEjS0AWP/aSatBxk9DRVfEGSx7YZ3Xgxueg9nWmkRlNHHGHQ sl4Z69JSbfflA== Received: from jsievers.comcast.net ([12.30.159.20]) by resomta-ch2-19v.sys.comcast.net with ESMTPA id ZiSBg5aU6WPjTZiSBg04yZ; Wed, 19 Dec 2018 20:28:31 +0000 X-Xfinity-VAAS: gggruggvucftvghtrhhoucdtuddrgedtkedrudejtddgudefjecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucevohhmtggrshhtqdftvghsihdpqfgfvfenuceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkfgggtgesthdtredttdertdenucfhrhhomheplfgvrhhrhicuufhivghvvghrshcuoehgshhivghvvghrshduleestghomhgtrghsthdrnhgvtheqnecukfhppeduvddrfedtrdduheelrddvtdenucfrrghrrghmpehhvghlohepjhhsihgvvhgvrhhsrdgtohhmtggrshhtrdhnvghtpdhinhgvthepuddvrdeftddrudehledrvddtpdhmrghilhhfrhhomhepghhsihgvvhgvrhhsudelsegtohhmtggrshhtrdhnvghtpdhrtghpthhtohepphhgshhqlhdqrggumhhinhesphhoshhtghhrvghsqhhlrdhorhhgnecuvehluhhsthgvrhfuihiivgeptd X-Xfinity-VMeta: sc=0;st=legit Received: from jsievers.enova.com (localhost [127.0.0.1]) by jsievers.comcast.net (Postfix) with ESMTP id 1C50F260056 for ; Wed, 19 Dec 2018 14:28:27 -0600 (CST) From: Jerry Sievers To: pgsql-admin@postgresql.org Subject: using pg_receivewal --drop-slot as recovery.conf:recovery_end_command Date: Wed, 19 Dec 2018 14:28:27 -0600 Message-ID: <87h8f945xw.fsf@jsievers.enova.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Admins, I tested $subject and it works like a charm for dropping a no longer needed slot on physical replication provider during promote of the standby. Wondering though about possible race condition... I see in server logs on standby side that we sigterm the walreceiver but speculate about cases where the provider side (for any reason) is delayed in noticing the receiver death... In turn leading to a refusal to allow slot dropping. Much ado a about nothing? pg_receivewal --slot $foo --drop-slot --dbname 'same stuff as primary conninfo' This was compelling to use since we are preparing to promote some standbys at the stroke of midnight inclusive=false for year end reporting and will *not* be using our external standby0-promote tool which already knows how to drop the provider slot. Please advise. Thx -- Jerry Sievers Postgres DBA/Development Consulting e: postgres.consulting@comcast.net