Re: Sync Rep and shutdown Re: Sync Rep v19 - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Sync Rep and shutdown Re: Sync Rep v19
Date
Msg-id AANLkTimXEQ0UcR3stAGaOYidf8VGeL-xn+1WN13xAm-q@mail.gmail.com
Whole thread Raw
In response to Re: Sync Rep and shutdown Re: Sync Rep v19  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
List pgsql-hackers
On Thu, Mar 17, 2011 at 8:24 AM, Heikki Linnakangas
<heikki.linnakangas@enterprisedb.com> wrote:
> Hmm, so setting synchronous_standby_names to '' takes effect immediately,
> but other changes to it don't apply to already-blocked commits. That seems a
> bit inconsistent. Perhaps walwriter should store the parsed list of
> standby-names in shared memory, not just a boolean.

I don't think this is necessary.  In general, the current or potential
WAL sender processes are responsible for working out among themselves
whose job it is to release waiters, and doing it.  As long as
synchronous_standby_names is non-empty, then either (1) there are one
or more standbys connected that can take on the role of synchronous
standby, and whoever does will release waiters or (2) there are no
standbys connected that can take on the role of synchronous standbys,
in which case no waiters should be released until one connects.  But
when synchronous_standby_names becomes completely empty, that doesn't
mean "wait until a standby connects whose application name is in the
empty set and make him the synchronous standby" but rather
"synchronous replication is administratively disabled, don't wait in
the first place".  So we just need a Boolean flag.

> +1 otherwise.

Thanks.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Sync Rep and shutdown Re: Sync Rep v19
Next
From: Alvaro Herrera
Date:
Subject: Re: Rectifying wrong Date outputs