Create checkpoint after pg_ctl promote (#378)

Creates a Postgres checkpoint after `pg_ctl promote` runs on the former standby and before `pg_rewind` runs on the former master. This fixes the race condition that was reported in https://github.com/2ndQuadrant/repmgr/issues/372
This commit is contained in:
Chris Fraser
2018-02-08 19:14:26 -08:00
committed by Ian Barwick
parent 5411225b6f
commit dd9df04334
3 changed files with 26 additions and 1 deletions

View File

@@ -4515,6 +4515,12 @@ do_standby_promote(void)
log_notice(_("STANDBY PROMOTE successful\n"));
/*
* Force a checkpoint so that pg_rewind on former master can tell that the
* servers have diverged.
*/
create_checkpoint(conn);
/* Log the event */
create_event_record(conn,
&options,