From 0f86bdcd055937b81bb85db65391d3d2151b203b Mon Sep 17 00:00:00 2001 From: Ian Barwick Date: Tue, 31 Mar 2015 14:15:29 +0900 Subject: [PATCH] Fixes for event logging We can't always assume a valid connection to the master --- repmgrd.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/repmgrd.c b/repmgrd.c index 383a5b2d..057d7c64 100644 --- a/repmgrd.c +++ b/repmgrd.c @@ -284,7 +284,7 @@ main(int argc, char **argv) terminate(ERR_BAD_CONFIG); } - /* Retrieve record for this node from the database */ + /* Retrieve record for this node from the local database */ node_info = get_node_info(my_local_conn, local_options.cluster_name, local_options.node); log_debug("node id is %i, upstream is %i\n", node_info.node_id, node_info.upstream_node_id); @@ -335,9 +335,9 @@ main(int argc, char **argv) log_info(_("starting continuous master connection check\n")); /* - * Check that master is still alive. - * XXX We should also check that the - * standby servers are sending info + * Check that master is still alive. + * XXX We should also check that the + * standby servers are sending info */ /* @@ -2089,7 +2089,7 @@ update_registration(void) log_err("%s\n", errmsg.data); - create_event_record(my_local_conn, + create_event_record(master_conn, &local_options, local_options.node, "repmgrd_shutdown", @@ -2260,7 +2260,7 @@ get_node_info(PGconn *conn, char *cluster, int node_id) log_err("%s\n", errmsg.data); - create_event_record(my_local_conn, + create_event_record(NULL, &local_options, local_options.node, "repmgrd_shutdown",