standby switchover: list nodes which will remain attatched to the old primary

If --siblings-follow is not supplied, list all nodes which repmgr considers
to be siblings (this will include the witness server, if in use), and
which will remain attached to the old primary.
This commit is contained in:
Ian Barwick
2019-04-02 10:45:45 +09:00
parent bb0fd944ae
commit 2249b79811
3 changed files with 27 additions and 5 deletions

View File

@@ -3561,9 +3561,26 @@ do_standby_switchover(void)
{
if (sibling_nodes.node_count > 0)
{
PQExpBufferData nodes;
NodeInfoListCell *cell;
initPQExpBuffer(&nodes);
for (cell = sibling_nodes.head; cell; cell = cell->next)
{
appendPQExpBuffer(&nodes,
" %s (node ID: %i)",
cell->node_info->node_name,
cell->node_info->node_id);
if (cell->next)
appendPQExpBufferStr(&nodes, "\n");
}
log_warning(_("%i sibling nodes found, but option \"--siblings-follow\" not specified"),
sibling_nodes.node_count);
log_detail(_("these nodes will remain attached to the current primary"));
log_detail(_("these nodes will remain attached to the current primary:\n%s"), nodes.data);
termPQExpBuffer(&nodes);
}
}
else