Re: The way to know whether the standby has caught up with the master - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: The way to know whether the standby has caught up with the master
Date
Msg-id 4DDC90C0.60800@enterprisedb.com
Whole thread Raw
In response to The way to know whether the standby has caught up with the master  (Fujii Masao <masao.fujii@gmail.com>)
Responses Re: The way to know whether the standby has caught up with the master  (Fujii Masao <masao.fujii@gmail.com>)
Re: The way to know whether the standby has caught up with the master  (Simon Riggs <simon@2ndQuadrant.com>)
Re: The way to know whether the standby has caught up with the master  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On 25.05.2011 07:42, Fujii Masao wrote:
> For reliable high-availability, when the master crashes, the clusterware must
> know whether it can promote the standby safely without any data loss,
> before actually promoting it. IOW, it must know whether the standby has
> already caught up with the primary. Otherwise, failover might cause data loss.
> We can know that from pg_stat_replication on the master. But the problem
> is that pg_stat_replication is not available since the master is not running at
> that moment. So that info should be available also on the standby.
>
> To achieve that, I'm thinking to change walsender so that, when the standby
> has caught up with the master, it sends back the message indicating that to
> the standby. And I'm thinking to add new function (or view like
> pg_stat_replication)
> available on the standby, which shows that info.

By the time the standby has received that message, it might not be 
caught-up anymore because new WAL might've been generated in the master 
already.

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


pgsql-hackers by date:

Previous
From: Fujii Masao
Date:
Subject: The way to know whether the standby has caught up with the master
Next
From: Fujii Masao
Date:
Subject: Re: The way to know whether the standby has caught up with the master