From b61f853a6988997cd050d02b3f1decaf4ed162ab Mon Sep 17 00:00:00 2001 From: Ian Barwick Date: Wed, 15 Aug 2018 16:55:03 +0900 Subject: [PATCH] repmgrd: ensure primary connection handle is refreshed after reconnect In some circumstances, if monitoring history was in use, repmgrd was attempting to fetch the primary's current LSN on a stale connection handle. --- repmgrd-physical.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/repmgrd-physical.c b/repmgrd-physical.c index ec0eb4fc..4e9ad189 100644 --- a/repmgrd-physical.c +++ b/repmgrd-physical.c @@ -760,6 +760,11 @@ monitor_streaming_standby(void) { int upstream_node_unreachable_elapsed = calculate_elapsed(upstream_node_unreachable_start); + if (upstream_node_info.type == PRIMARY) + { + primary_conn = upstream_conn; + } + initPQExpBuffer(&event_details); appendPQExpBuffer(&event_details,