Skip site navigation (1) Skip section navigation (2)

Re: Standalone synchronous master

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Alexander Björnhagen <alex(dot)bjornhagen(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Standalone synchronous master
Date: 2011-12-26 10:14:41
Message-ID: CAHGQGwE4BKOO=QWFmpEcQUpPUZ887OyjwNwbGMkiL5rHFOUCgg@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackers
On Mon, Dec 26, 2011 at 5:08 AM, Alexander Björnhagen
<alex(dot)bjornhagen(at)gmail(dot)com> wrote:
> I’m new here so maybe someone else already has this in the works ?

No, as far as I know.

> And so on ... any comments are welcome :)

Basically I like this whole idea, but I'd like to know why do you
think this functionality is required?

When is the replication mode switched from "standalone" to "sync"?
That happens as soon as
sync standby appears? or it has caught up with the master? The former
might block the
transactions for a long time until the standby has caught up with the
master even though
synchronous_standalone_master is enabled and a user wants to avoid
such a downtime.

When standalone master is enabled, you might lose some committed
transactions at failover
as follows:

1. While synchronous replication is running normally, replication
connection is closed because of
    network outage.
2. The master works standalone because of
synchronous_standalone_master=on and some
    new transactions are committed though their WAL records are not
replicated to the standby.
3. The master crashes for some reasons, the clusterware detects it and
triggers a failover.
4. The standby which doesn't have recent committed transactions
becomes the master at a failover...

Is this scenario acceptable?

To avoid such a loss of transactions, I'm thinking to introduce new
GUC parameter specifying
the shell command which is executed when replication mode is switched
from "sync" to "standalone".
If we set it to something like STONITH command, we can shut down
forcibly the standby before
the master resumes the transactions, and avoid the failover to the
obsolete standby when the
master crashes.

Regards,

-- 
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center

In response to

Responses

pgsql-hackers by date

Next:From: Alexander BjörnhagenDate: 2011-12-26 12:51:07
Subject: Re: Standalone synchronous master
Previous:From: Greg StarkDate: 2011-12-25 22:18:51
Subject: Re: Page Checksums

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group