On Sat, May 27, 2017 at 10:18 PM, Vladimir Borodin <r...@simply.name> wrote: > > 26 мая 2017 г., в 21:39, Amit Kapila <amit.kapil...@gmail.com> написал(а): > > I think you somehow need > to ensure before switchover that all the WAL is replicated to ensure > this is not a setup problem. > > > Well, actually clean shutdown of master with exit code 0 from `pg_ctl stop > -m fast` guarantees that all WAL has been replicated to standby. >
I don't see any such guarantee in code or docs. Can you explain what makes you think that for 'fast' mode exit code 0 is a guarantee that all the WAL be replicated? > But just in > case we also check that "Latest checkpoint's REDO location" from control > file on old master after shutdown is less than > pg_last_xlog_replay_location() on standby to be promoted. > > And if something would go wrong in above logic, postgres will not let you > attach old master as a standby of new master. > I think it will be possible to attach old master as a standby of new master as some new operations on the new master can increase its LSN position to a value greater than what old master has. Your statement will make sense if you ensure that you don't allow any new operation on the new master till old master has attached to it as standby. > So it is highly probable not a > setup problem. > Yeah, it is quite possible that your setup is perfectly fine and there is actually some code bug due to which you are facing the problem, however, it is better to rule out all the possibilities related to the wrong setup. -- With Regards, Amit Kapila. EnterpriseDB: http://www.enterprisedb.com -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers