mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-22 22:56:29 +00:00
standby switchover: ignore nodes which are unreachable and marked as inactive
Previously "repmgr standby switchover" would abort if any node was unreachable, as that means it was unable to check if repmgrd is running. However if the node has been marked as inactive in the repmgr metadata, it's reasonable to assume the node is no longer part of the replication cluster and does not need to be checked.
This commit is contained in:
@@ -55,9 +55,17 @@
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
&repmgr;: when executing <link linkend="repmgr-standby-switchover"><command>repmgr standby switchover</command></link>, don't abort if one or more nodes are not reachable <emphasis>and</emphasis>
|
||||
they are marked as inactive.
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
</itemizedlist>
|
||||
</para>
|
||||
</para>
|
||||
</sect2>
|
||||
|
||||
</sect1>
|
||||
|
||||
<sect1 id="release-4.3">
|
||||
|
||||
@@ -4084,16 +4084,24 @@ do_standby_switchover(void)
|
||||
|
||||
repmgrd_info[i]->pg_running = false;
|
||||
|
||||
item_list_append_format(&repmgrd_connection_errors,
|
||||
_("unable to connect to node \"%s\" (ID %i):\n%s"),
|
||||
cell->node_info->node_name,
|
||||
cell->node_info->node_id,
|
||||
PQerrorMessage(cell->node_info->conn));
|
||||
/*
|
||||
* Only worry about unreachable nodes if they're marked as active
|
||||
* in the repmgr metadata.
|
||||
*/
|
||||
if (cell->node_info->active == true)
|
||||
{
|
||||
unreachable_node_count++;
|
||||
|
||||
item_list_append_format(&repmgrd_connection_errors,
|
||||
_("unable to connect to node \"%s\" (ID %i):\n%s"),
|
||||
cell->node_info->node_name,
|
||||
cell->node_info->node_id,
|
||||
PQerrorMessage(cell->node_info->conn));
|
||||
}
|
||||
|
||||
PQfinish(cell->node_info->conn);
|
||||
cell->node_info->conn = NULL;
|
||||
|
||||
unreachable_node_count++;
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user