mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-22 22:56:29 +00:00
repmgrd: fix upstream role check
Only take action if it's confirmed as a standby.
This commit is contained in:
@@ -868,7 +868,7 @@ monitor_streaming_standby(void)
|
||||
{
|
||||
primary_conn = upstream_conn;
|
||||
|
||||
if (get_recovery_type(primary_conn) != RECTYPE_PRIMARY)
|
||||
if (get_recovery_type(primary_conn) == RECTYPE_STANDBY)
|
||||
{
|
||||
ExecStatusType ping_result;
|
||||
|
||||
@@ -1322,7 +1322,7 @@ loop:
|
||||
|
||||
if (PQstatus(primary_conn) == CONNECTION_OK)
|
||||
{
|
||||
if (get_recovery_type(primary_conn) != RECTYPE_PRIMARY)
|
||||
if (get_recovery_type(primary_conn) == RECTYPE_STANDBY)
|
||||
{
|
||||
log_notice(_("current upstream node \"%s\" (node ID: %i) is not primary, restarting monitoring"),
|
||||
upstream_node_info.node_name, upstream_node_info.node_id);
|
||||
@@ -1335,8 +1335,6 @@ loop:
|
||||
}
|
||||
}
|
||||
|
||||
log_debug("YYY here3 active ? %c", local_node_info.active ? 't' : 'f');
|
||||
|
||||
/* we've reconnected to the local node after an outage */
|
||||
if (local_node_info.active == false)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user