repmgrd: additional check for the upstream connection

It's possible the upstream server was intermittently unavailable in
the interval between checks, invalidating the upstream connection.
With check types "ping" and "connection", the connection would not be
restored, so if the availability check was successful, additionally
verify the upstream connection and restore if necessary.

Addresses GitHub #633.
This commit is contained in:
Ian Barwick
2020-05-13 17:32:19 +09:00
parent c76fee98ef
commit 68ad58f5fc
2 changed files with 48 additions and 15 deletions

View File

@@ -1443,6 +1443,7 @@ monitor_streaming_standby(void)
while (true)
{
log_verbose(LOG_DEBUG, "checking %s", upstream_node_info.conninfo);
if (check_upstream_connection(&upstream_conn, upstream_node_info.conninfo) == true)
{
set_upstream_last_seen(local_conn, upstream_node_info.node_id);
@@ -3088,8 +3089,6 @@ do_primary_failover(void)
}
static void
update_monitoring_history(void)
{