Re: Configuring synchronous replication

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, Dimitri Fontaine <dfontaine(at)hi-media(dot)com>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, David Fetter <david(at)fetter(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Configuring synchronous replication
Date: 2010-09-20 06:27:15
Message-ID: 4C96FEC3.90302@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On 18/09/10 22:59, Robert Haas wrote:
> On Sat, Sep 18, 2010 at 4:50 AM, Simon Riggs<simon(at)2ndquadrant(dot)com> wrote:
>> Waiting might sound attractive. In practice, waiting will make all of
>> your connections lock up and it will look to users as if their master
>> has stopped working as well. (It has!). I can't imagine why anyone would
>> ever want an option to select that; its the opposite of high
>> availability. Just sounds like a serious footgun.
>
> Nevertheless, it seems that some people do want exactly that behavior,
> no matter how crazy it may seem to you.

Yeah, I agree with both of you. I have a hard time imaging a situation
where you would actually want that. It's not high availability, it's
high durability. When a transaction is acknowledged as committed, you
know it's never ever going to disappear even if a meteor strikes the
current master server within the next 10 milliseconds. In practice,
people want high availability instead.

That said, the timeout option also feels a bit wishy-washy to me. With a
timeout, acknowledgment of a commit means "your transaction is safely
committed in the master and slave. Or not, if there was some glitch with
the slave". That doesn't seem like a very useful guarantee; if you're
happy with that why not just use async replication?

However, the "wait forever" behavior becomes useful if you have a
monitoring application outside the DB that decides when enough is enough
and tells the DB that the slave can be considered dead. So "wait
forever" actually means "wait until I tell you that you can give up".
The monitoring application can STONITH to ensure that the slave stays
down, before letting the master proceed with the commit.

With that in mind, we have to make sure that a transaction that's
waiting for acknowledgment of the commit from a slave is woken up if the
configuration changes.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Heikki Linnakangas 2010-09-20 06:29:55 Re: Configuring synchronous replication
Previous Message Josh Berkus 2010-09-20 02:31:52 Re: Configuring synchronous replication

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2010-09-20 06:29:55 Re: Configuring synchronous replication
Previous Message Pavel Stehule 2010-09-20 06:22:29 Re: [HACKERS] wip: functions median and percentile