repmgr: prevent a standby being cloned from a witness server

Previously repmgr would happily clone from whatever server
it found at the provided source server address. We should
ensure that a standby can only be cloned from a node which
is part of the main replication cluster.

This check fetches a list of nodes from the source server,
connects to the first non-witness server it finds, and
compares the system identifiers of the source node and the
node it has connected to. If there is a mismatch, then the
source server is clearly not part of the main replication
cluster, and is most likely the witness server.
This commit is contained in:
Ian Barwick
2019-05-22 16:29:41 +09:00
parent fa66e72c2f
commit c9e85996f5
5 changed files with 124 additions and 2 deletions

View File

@@ -8,6 +8,7 @@
as reported by each individual node (Ian)
repmgr: in "cluster show" and "daemon status", check if a node is attached
to its advertised upstream node
repmgr: prevent a standby being cloned from a witness server (Ian)
repmgrd: monitor standbys attached to primary (Ian)
general: documentation converted to DocBook XML format (Ian)