Re: Synchronous Standalone Master Redoux - Mailing list pgsql-hackers

From Jose Ildefonso Camargo Tolosa
Subject Re: Synchronous Standalone Master Redoux
Date
Msg-id CAETJ_S_M=D3z05D4Sv1sPsP3ORN+ci3+a9OJ07BjDMyD6WVucg@mail.gmail.com
Whole thread Raw
In response to Re: Synchronous Standalone Master Redoux  (Josh Berkus <josh@agliodbs.com>)
Responses Re: Synchronous Standalone Master Redoux
List pgsql-hackers
On Wed, Jul 11, 2012 at 11:48 PM, Josh Berkus <josh@agliodbs.com> wrote:
>
>> Please, stop arguing on all of this: I don't think that adding an
>> option will hurt anybody (specially because the work was already done
>> by someone), we are not asking to change how the things work, we just
>> want an option to decided whether we want it to freeze on standby
>> disconnection, or if we want it to continue automatically... is that
>> asking so much?
>
> The objection is that, *given the way synchronous replication currently
> works*, having that kind of an option would make the "synchronous"
> setting fairly meaningless.  The only benefit that synchronous
> replication gives you is the guarantee that a write on the master is
> also on the standby.  If you remove that guarantee, you are using
> asynchronous replication, even if the setting says synchronous.

I know how synchronous replication works, I have read it several
times, I have seen it in the real life, I have seen it in virtual test
environments.  And no, it doesn't makes synchronous replication
meaningless, because it will work synchronous if it have someone to
sync to, and work async (or standalone) if it doesn't: that's perfect
for HA environment.

>
> I think what you really want is a separate "auto-degrade" setting.  That
> is, a setting which says "if no synchronous standby is present,
> auto-degrade to async/standalone, and start writing a bunch of warning
> messages to the logs and whenever anyone runs a synchronous
> transaction".  That's an approach which makes some sense, but AFAICT
> somewhat different from the proposed patch.

Certainly, different to current patch, the one I saw I believe it had
all of that you say there: except the additional warning.

As synchronous standby currently is, it just doesn't fit the HA usage,
and if you really want to keep it that way, it doesn't belong to the
HA chapter on the pgsql documentation, and should be moved.  And NO
async replication will *not* work for HA, because the master can have
more transactions than standby, and if the master crashes, the standby
will have no way to recover these transactions, with synchronous
replication we have *exactly* what we need: the data in the standby,
after all, it will apply it once we promote it.

Ildefonso.


pgsql-hackers by date:

Previous
From: Kohei KaiGai
Date:
Subject: Re: pgsql_fdw in contrib
Next
From: Peter Eisentraut
Date:
Subject: Re: pgsql_fdw in contrib