Re: Synchronous Log Shipping Replication - Mailing list pgsql-hackers

From Fujii Masao
Subject Re: Synchronous Log Shipping Replication
Date
Msg-id 3f0b79eb0809092128m2c27c228kdfdac58b1af1a4ae@mail.gmail.com
Whole thread Raw
In response to Re: Synchronous Log Shipping Replication  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Responses Re: Synchronous Log Shipping Replication  (Simon Riggs <simon@2ndQuadrant.com>)
List pgsql-hackers
On Tue, Sep 9, 2008 at 8:38 PM, Heikki Linnakangas
<heikki.linnakangas@enterprisedb.com> wrote:
> There's one thing I haven't figured out in this discussion. Does the write
> to the disk happen before or after the write to the slave? Can you guarantee
> that if a transaction is committed in the master, it's also committed in the
> slave, or vice versa?

We can guarantee that a transaction is committed in both the master and
the slave if we can wait for that one fsyncs WAL to disk and the other holds
it to memory or disk. Even if one fails, the other can continue service.
Even if both fail, the node which wrote WAL can continue service. A transaction
is lost in neither of the cases.

> Agreed. But what happens if you hit that timeout?

The stand-alone master continues service when it it that timeout. On the other
hand, the slave waits for the order by the sysadmin or the clustering software,
then it exits or becomes master.

> Should we enforce that
> timeout within the server, or should we leave that to the external heartbeat
> system?

Within the server. All users do not use such an external system. It's not simple
for the external system to leave the master stand-alone.

regards

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


pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: Keeping creation time of objects
Next
From: "Fujii Masao"
Date:
Subject: Re: Synchronous Log Shipping Replication