On Thu, 2010-12-30 at 15:07 -0500, Robert Treat wrote:
> > When allow_standalone_primary is set, a user will stop waiting once
> > replication_timeout has been reached for their specific session.
> > are not waiting for a specific standby to reply, they are waiting
> for a
> > reply from any standby, so the unavailability of any one standby is
> > significant to a user. It is possible for user sessions to hit
> > even though standbys are communicating normally. In that case, the
> > setting of replication_timeout is probably too low.
> will a notice or warning be thrown in these cases? I'm thinking
> like the checkpoint timeout warning, but could be something else; it
> seems to me you need some way to know you're timing out.
We can do that, yes.
> > The standby sends regular status messages to the primary. If no
> > messages have been received for replication_timeout the primary
> > will assume the connection is dead and terminate it. This happens
> > whatever the setting of allow_standalone_primary.
> Does the standby attempt to reconnect in these scenarios?
Yes it would, but the reason why we terminated the connection was it
wasn't talking any more, so it is probably dead.
> > If primary crashes while commits are waiting for acknowledgement,
> > transactions will be marked fully committed if the primary database
> > recovers, no matter how allow_standalone_primary is set.
> This seems backwards; if you are waiting for acknowledgement, wouldn't
> normal assumption be that the transactions *didnt* make it to any
> and should be rolled back ?
Well, we can't roll it back. We have already written the commit record
> > There is no way
> > to be certain that all standbys have received all outstanding WAL
> > at time of the crash of the primary. Some transactions may not show
> > committed on the standby, even though they show as committed on the
> > primary. The guarantee we offer is that the application will not
> > explicit acknowledgement of the successful commit of a transaction
> > the WAL data is known to be safely received by the standby. Hence
> > mechanism is technically "semi synchronous" rather than "fully
> > synchronous" replication. Note that replication still not be fully
> > synchronous even if we wait for all standby servers, though this
> > reduce availability, as described previously.
> I think we ought to have an example of the best configuration for
> afford to lose any data" scenarios, where we would prefer an overall
> interruption over the chance of having the primary / secondary out of
I say "use two or more standbys" more than once...
> somewhat concerned that we seem to need to use double negatives to
> whats going on here. it makes me think we ought to rename this to
> require_synchronous_standby or similar.
Don't see why we can't use double negatives. ;-)
The parameter is named directly from Fujii Masao's suggestion.
> > 18.5.6. Standby Servers
> > These settings control the behavior of a standby server that is to
> > receive replication data.
> i was expecting this section to mention the synchronous_replication
> somewhere, to control if the standby will participate synchronously or
> asynch; granted it's the same config as listed in 18.5.5 right? Just
> the heading of that section specifically targets the primary.
OK, good idea.
> HTH, looks pretty good at first glance.
Simon Riggs http://www.2ndQuadrant.com/books/
PostgreSQL Development, 24x7 Support, Training and Services
In response to
pgsql-hackers by date
|Next:||From: Stefan Kaltenbrunner||Date: 2010-12-30 20:57:58|
|Subject: Re: pg_streamrecv for 9.1?|
|Previous:||From: Jeff Davis||Date: 2010-12-30 20:55:22|
|Subject: Re: Old git repo|