From 49dfaea471af79df80ca543da10c06db4741e127 Mon Sep 17 00:00:00 2001 From: Ian Barwick Date: Fri, 2 Sep 2022 17:20:13 +0900 Subject: [PATCH] repmgrd: ensure notification script is called for "repmgrd_upstream_disconnect" GitHUb #760. --- HISTORY | 6 +++++- repmgrd-physical.c | 36 ++++++++++++++++++------------------ 2 files changed, 23 insertions(+), 19 deletions(-) diff --git a/HISTORY b/HISTORY index c8ef1e92..6bb558e1 100644 --- a/HISTORY +++ b/HISTORY @@ -1,4 +1,8 @@ -5.3.2 2022-??-?? +5.3.3 2022-??-?? + repmgrd: ensure event notification script is called for event + "repmgrd_upstream_disconnect"; GitHub #760 (Ian) + +5.3.2 2022-05-25 standby clone: don't error out if unable to determine cluster size (Ian) node check: fix --downstream --nagios output; GitHub #749 (Ian) repmgrd: ensure witness node marked active (hslightdb) diff --git a/repmgrd-physical.c b/repmgrd-physical.c index f20f9b43..03247437 100644 --- a/repmgrd-physical.c +++ b/repmgrd-physical.c @@ -1587,22 +1587,22 @@ monitor_streaming_standby(void) /* TODO: possibly add pre-action event here */ if (upstream_node_info.type == STANDBY) { - create_event_record(primary_conn, - &config_file_options, - config_file_options.node_id, - "repmgrd_upstream_disconnect", - true, - event_details.data); + create_event_notification(primary_conn, + &config_file_options, + config_file_options.node_id, + "repmgrd_upstream_disconnect", + true, + event_details.data); } else { /* primary connection lost - script notification only */ - create_event_record(NULL, - &config_file_options, - config_file_options.node_id, - "repmgrd_upstream_disconnect", - true, - event_details.data); + create_event_notification(NULL, + &config_file_options, + config_file_options.node_id, + "repmgrd_upstream_disconnect", + true, + event_details.data); } log_warning("%s", event_details.data); @@ -2482,12 +2482,12 @@ monitor_streaming_witness(void) _("unable to connect to primary node \"%s\" (ID: %i)"), upstream_node_info.node_name, upstream_node_info.node_id); - create_event_record(NULL, - &config_file_options, - config_file_options.node_id, - "repmgrd_upstream_disconnect", - true, - event_details.data); + create_event_notification(NULL, + &config_file_options, + config_file_options.node_id, + "repmgrd_upstream_disconnect", + true, + event_details.data); termPQExpBuffer(&event_details); }