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

@@ -88,6 +88,14 @@
warning if the node is not attached.
</para>
</listitem>
<listitem>
<para>
<link linkend="repmgr-standby-clone"><command>repmgr standby clone</command></link>:
prevent a standby from being cloned from a witness server.
</para>
</listitem>
</itemizedlist>
</para>
</sect2>