mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-25 08:06:29 +00:00
repmgrd: better handling of missing upstream_node_id
Ensure we default to master node.
This commit is contained in:
@@ -742,7 +742,8 @@ standby_monitor(void)
|
||||
upstream_conn = get_upstream_connection(my_local_conn,
|
||||
local_options.cluster_name,
|
||||
local_options.node,
|
||||
&upstream_node_id, upstream_conninfo);
|
||||
&upstream_node_id,
|
||||
upstream_conninfo);
|
||||
|
||||
upstream_node_type = (upstream_node_id == master_options.node)
|
||||
? "master"
|
||||
@@ -826,7 +827,7 @@ standby_monitor(void)
|
||||
* Failover handling is handled differently depending on whether
|
||||
* the failed node is the master or a cascading standby
|
||||
*/
|
||||
upstream_node = get_node_info(my_local_conn, local_options.cluster_name, node_info.upstream_node_id);
|
||||
upstream_node = get_node_info(my_local_conn, local_options.cluster_name, upstream_node_id);
|
||||
|
||||
if (upstream_node.type == MASTER)
|
||||
{
|
||||
@@ -929,7 +930,7 @@ standby_monitor(void)
|
||||
* from the upstream node to write monitoring information
|
||||
*/
|
||||
|
||||
upstream_node = get_node_info(my_local_conn, local_options.cluster_name, node_info.upstream_node_id);
|
||||
upstream_node = get_node_info(my_local_conn, local_options.cluster_name, upstream_node_id);
|
||||
|
||||
sprintf(sqlquery,
|
||||
"SELECT id "
|
||||
@@ -2386,7 +2387,7 @@ get_node_info(PGconn *conn, char *cluster, int node_id)
|
||||
|
||||
if (res == 0)
|
||||
{
|
||||
log_warning(_("No record found record for node %i\n"), node_id);
|
||||
log_warning(_("No record found for node %i\n"), node_id);
|
||||
}
|
||||
|
||||
return node_info;
|
||||
|
||||
Reference in New Issue
Block a user