On Sat, Apr 12, 2014 at 3:12 PM, Anupama Ramaswamy <anumr_0123@yahoo.com> wrote:
> Lets suppose at this point there is 0 delivery lag but XXXX bytes of replay
> lag.
>
All your answers are here:
http://www.postgresql.org/docs/devel/static/warm-standby.html
"Standby mode is exited and the server switches to normal operation
when pg_ctl promote is run or a trigger file is found (trigger_file).
Before failover, any WAL immediately available in the archive or in
pg_xlog will be restored, but no attempt is made to connect to the
master."
> a) Will the replay complete before the standby stops replicating (because it
> sees the trigger file) ?
Any WAL available in the archives or pg_xlog will be replayed before
the failover.
> 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 ?
You need to wait until all the WAL has been replayed, which is the
point where failover occurs.
> c) How do I know if the replay is over and it is ready for a standalone
> operation ?
"SELECT pg_is_in_recovery();" returns true if server is still
performing recovery operations.
--
Michael