Make it clearer that a witness node counts as a "sibling node"

It's not attached to the primary per-se, but needs to know what
the current primary is in order to correctly synchronise its
copy of the metadata.

Per GitHub #560.
This commit is contained in:
Ian Barwick
2019-05-02 14:22:53 +09:00
parent 8da355eb3f
commit 4b37562444
3 changed files with 19 additions and 3 deletions

View File

@@ -37,7 +37,8 @@
<para> <para>
Beginning with <link linkend="release-4.4">repmgr 4.4</link>, Beginning with <link linkend="release-4.4">repmgr 4.4</link>,
the option <option>--siblings-follow</option> can be used to have the option <option>--siblings-follow</option> can be used to have
all other standbys follow the new primary. all other standbys (and a witness server, if in use)
follow the new primary.
</para> </para>
<note> <note>
@@ -119,6 +120,11 @@
Have all sibling nodes (nodes formerly attached to the same upstream Have all sibling nodes (nodes formerly attached to the same upstream
node as the promotion candidate) follow this node after it has been promoted. node as the promotion candidate) follow this node after it has been promoted.
</para> </para>
<para>
Note that a witness server, if in use, is also
counted as a &quot;sibling node&quot; as it needs to be instructed to
synchronise its metadata with the new primary.
</para>
<important> <important>
<para> <para>
Do <emphasis>not</emphasis> provide this option when configuring Do <emphasis>not</emphasis> provide this option when configuring

View File

@@ -26,7 +26,9 @@
these to follow the new primary if the option <literal>--siblings-follow</literal> these to follow the new primary if the option <literal>--siblings-follow</literal>
is specified. This requires a passwordless SSH connection between the promotion is specified. This requires a passwordless SSH connection between the promotion
candidate (new primary) and the nodes attached to the demotion candidate candidate (new primary) and the nodes attached to the demotion candidate
(existing primary). (existing primary). Note that a witness server, if in use, is also
counted as a &quot;sibling node&quot; as it needs to be instructed to
synchronise its metadata with the new primary.
</para> </para>
<note> <note>
<para> <para>

View File

@@ -7057,9 +7057,17 @@ check_sibling_nodes(NodeInfoList *sibling_nodes, SiblingNodeStats *sibling_nodes
for (cell = sibling_nodes->head; cell; cell = cell->next) for (cell = sibling_nodes->head; cell; cell = cell->next)
{ {
appendPQExpBuffer(&nodes, appendPQExpBuffer(&nodes,
" %s (node ID: %i)", " %s (node ID: %i",
cell->node_info->node_name, cell->node_info->node_name,
cell->node_info->node_id); cell->node_info->node_id);
if (cell->node_info->type == WITNESS)
{
appendPQExpBufferStr(&nodes,
", witness server");
}
appendPQExpBufferChar(&nodes,
')');
if (cell->next) if (cell->next)
appendPQExpBufferStr(&nodes, "\n"); appendPQExpBufferStr(&nodes, "\n");
} }