Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WBFL5-0004yA-6S for pgsql-bugs@arkaria.postgresql.org; Thu, 06 Feb 2014 03:09:19 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WBFL4-0000i5-Mz for pgsql-bugs@arkaria.postgresql.org; Thu, 06 Feb 2014 03:09:18 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WBFL3-0000hy-Qu for pgsql-bugs@postgresql.org; Thu, 06 Feb 2014 03:09:17 +0000 Received: from wrigleys.postgresql.org ([204.145.124.246]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WBFKt-0007PD-Cf for pgsql-bugs@postgresql.org; Thu, 06 Feb 2014 03:09:17 +0000 MIME-Version: 1.0 Subject: BUG #9118: WAL Sender does not disconnect replication clients during shutdown To: pgsql-bugs@postgresql.org From: jhedden@apple.com Date: Thu, 06 Feb 2014 03:08:53 +0000 Message-ID: <20140206030853.13610.71518@wrigleys.postgresql.org> X-Pg-Spam-Score: -1.2 (-) Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org The following bug has been logged on the website: Bug reference: 9118 Logged by: Joel Hedden Email address: jhedden@apple.com PostgreSQL version: 9.3.2 Operating system: Mac OS X 10.9.1 Description: I connect a pg_receivexlog instance and have "hot_standby" archiving enabled, with "archive_command" defined correctly. When the WAL Sender process receives a SIGUSR2 from the postmaster (or me), it fails to shut down and pg_receivexlog remains connected. Upon inspection, it looks like the test for "sentPtr == MyWalSnd->flush" is always false at walsender.c:1058 (sentPtr is still non-zero) where the wal sender should be shutting down. Replication and archiving seem to be working otherwise. Killing pg_receivexlog allows for the WAL Sender to terminate. This didn't affect 9.2.4 for me. I've tested the EnterpriseDB 9.3.2 release as well as the HEAD branch for 9.3. To reproduce: 1. Download the EnterpriseDB 9.3.2 distribution for Mac OS X and install onto 10.9.1. 2. Use initdb to create a fresh cluster. 3. Update postgresql.conf: - max_wal_senders = 2 - wal_level = hot_standby - archive_mode = on - archive_command = '/usr/bin/true' 4. Update pg_hba.conf to allow local replication connections. 5. Start postgres. 6. Connect pg_receivexlog via local socket file. 7. kill -TERM the postmaster. The WAL sender, logger, and postmaster continue to run indefinitely and pg_receivexlog is not disconnected. WAL sender receives the SIGUSR2 from postmaster but does not disconnect pg_receivexlog and shut down as expected. -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs