Skip site navigation (1) Skip section navigation (2)

pgsql: More synchronous replication tweaks.

From: Robert Haas <rhaas(at)postgresql(dot)org>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: More synchronous replication tweaks.
Date: 2011-03-10 20:43:59
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-committers
More synchronous replication tweaks.

SyncRepRequested() must check not only the value of the
synchronous_replication GUC but also whether max_wal_senders > 0.
Otherwise, we might end up waiting for sync rep even when there's no
possibility of a standby ever managing to connect.  There are some
existing cross-checks to prevent this, but they're not quite sufficient:
the user can start the server with max_wal_senders=0,
synchronous_standby_names='', and synchronous_replication=off and then
subsequent make synchronous_standby_names not empty using pg_ctl reload,
and then SET synchronous_standby=on, leading to an indefinite hang.

Along the way, rename the global variable for the synchronous_replication
GUC to match the name of the GUC itself, for clarity.

Report by Fujii Masao, though I didn't use his patch.



Modified Files
src/backend/replication/syncrep.c |    2 +-
src/backend/utils/misc/guc.c      |    2 +-
src/include/replication/syncrep.h |    5 +++--
3 files changed, 5 insertions(+), 4 deletions(-)

pgsql-committers by date

Next:From: Robert HaasDate: 2011-03-10 20:44:33
Subject: Re: pgsql: Efficient transaction-controlled synchronous replication.
Previous:From: Robert HaasDate: 2011-03-10 20:04:57
Subject: Re: [COMMITTERS] pgsql: Efficient transaction-controlled synchronous replication.

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group