repmgrd: improve detection of status change from primary to standby

If repmgrd is running in degraded mode on a primary which has been stopped,
then manually been brought back online as a standby (e.g. by creating
recovery.conf and starting the server), ensure it not only detects the
change but automatically updates the node record so it can resume
monitoring the node as a standby.

Previously, repmgrd was looping waiting for the record to be updated
(as is done transparently when executing "repmgr node rejoin") but
if the record was not updated within the timeout period (e.g. by
"repmgr standby register) it would fail to resume monitoring as a
standby.

It seems reasonable to have repmgrd automatically update the node record,
as this will restore failover capability as quickly as possible. If this
is not desired, then the onus is on the user to shut down repmgrd while
making the desired changes.
This commit is contained in:
Ian Barwick
2018-02-22 11:19:37 +09:00
parent 98af51da03
commit 22b3a74fa0
5 changed files with 111 additions and 40 deletions

View File

@@ -1,5 +1,6 @@
4.0.4 2018-??-??
4.0.4 2018-03-??
repmgr: ensure "node rejoin" honours "--dry-run" option; GitHub #383 (Ian)
repmgrd: improve detection of status change from primary to standby (Ian)
4.0.3 2018-02-15
repmgr: improve switchover handling when "pg_ctl" used to control the