Re: Sync Rep v17 - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: Sync Rep v17
Date
Msg-id 1298104097.2226.7067.camel@ebony
Whole thread Raw
In response to Re: Sync Rep v17  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Sync Rep v17
List pgsql-hackers
On Fri, 2011-02-18 at 20:45 -0500, Robert Haas wrote:
> On Fri, Feb 18, 2011 at 7:06 PM, Simon Riggs <simon@2ndquadrant.com> wrote:
> > The patch is very lite touch on a few areas of code, plus a chunk of
> > specific code, all on master-side. Pretty straight really. I'm sure
> > problems will be found, its not long since I completed this; thanks to
> > Daniel Farina for your help with patch assembly.
> 
> This looks like it's in far better shape than the previous version.
> Thanks to you and Dan for working on it.
> 
> As you have this coded, enabling synchronous_replication forces all
> transactions to commit synchronously.  This means that, when
> synchronous_replication=on, you get synchronous_commit=on behavior
> even if you have synchronous_commit=off.  I'd prefer to see us go the
> other way, and say that you can only get synchronous replication when
> you're also getting synchronous commit.

First, we should be clear to explain that you are referring to the fact
that the request synchronous_commit = off synchronous_replication = on
makes no sense in the way the replication system is currently designed,
even though it is a wish-list item to make it work in 9.2+

Since that combination makes no sense we need to decide how will we
react when it is requested. I think fail-safe is the best way. We should
make the default the safe way and allow performance options in
non-default paths.

Hence the above combination of options is taken in the patch to be the
same as synchronous_commit = on synchronous_replication = on

If you want performance, you can still get it with  synchronous_commit = off synchronous_replication = off
which does have meaning

So the way the patch is coded makes most sense for a safety feature. I
think it does need to be documented also.

Must fly now...

-- Simon Riggs           http://www.2ndQuadrant.com/books/PostgreSQL Development, 24x7 Support, Training and Services



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: REVIEW: Determining client_encoding from client locale
Next
From: Simon Riggs
Date:
Subject: Re: Sync Rep v17