Re: streaming replication and recovery - Mailing list pgsql-general

From Anupama Ramaswamy
Subject Re: streaming replication and recovery
Date
Msg-id 1397283160.80366.YahooMailNeo@web160303.mail.bf1.yahoo.com
Whole thread Raw
In response to Re: streaming replication and recovery  (Sergey Konoplev <gray.ru@gmail.com>)
Responses Re: streaming replication and recovery  (Michael Paquier <michael.paquier@gmail.com>)
List pgsql-general
Thanks for your response.

>>There are two lag types to consider about in case of a normal
>>streaming replication - delivery lag and replay lag. The secondary
>>will completely catch up to what have been delivered, but what have
>>not been is going to be lost. See [1][2].

Ok, I understand. I want to understand exact sequence of events that will happen. 
Lets say I have specified the following in my recovery.conf

trigger_file =/tmp/pgsql.failover

I detect that the master has failed and immediately I do the following on the standby
touch /tmp/pgsql.failover

Lets suppose at this point there is 0 delivery lag but XXXX bytes of replay lag. 

a) Will the replay complete before the standby stops replicating (because it sees the trigger file) ?
b) If I want to run this as new master and attach other secondaries to point to this master, can I do it soon after "touch /tmp/pgsql.failover" OR should I wait till the secondary has finished replaying all the delivered stream ?
c) How do I know if the replay is over and it is ready for a standalone operation ?

Thanks for your help
Anupama.

pgsql-general by date:

Previous
From: Dave Cramer
Date:
Subject: Re: Is it possible to load two different versions of the JDBC driver in the same application?
Next
From: Tony Theodore
Date:
Subject: Re: Database Design: Maintain Audit Trail of Changes