BUG #9118: WAL Sender does not disconnect replication clients during shutdown

From: jhedden(at)apple(dot)com
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #9118: WAL Sender does not disconnect replication clients during shutdown
Date: 2014-02-06 03:08:53
Message-ID: 20140206030853.13610.71518@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 9118
Logged by: Joel Hedden
Email address: jhedden(at)apple(dot)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.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Heikki Linnakangas 2014-02-06 08:05:51 Re: BUG #9118: WAL Sender does not disconnect replication clients during shutdown
Previous Message michal.wos 2014-02-06 00:09:29 BUG #9117: PGXAConnection - equals method returning false