pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: jhedden@apple.com
To: pgsql-bugs@postgresql.org
Subject: BUG #9118: WAL Sender does not disconnect replication clients during shutdown
Date: Thu, 06 Feb 2014 03:08:53 +0000
Message-ID: <20140206030853.13610.71518@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

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



view thread (11+ messages)  latest in thread

Message-ID: <20140206030853.13610.71518@wrigleys.postgresql.org>
Permalink:  ../20140206030853.13610.71518@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/20140206030853.13610.71518@wrigleys.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: jhedden@apple.com
  Subject: Re: BUG #9118: WAL Sender does not disconnect replication clients during shutdown
  In-Reply-To: <20140206030853.13610.71518@wrigleys.postgresql.org>
  References: <20140206030853.13610.71518@wrigleys.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox