From 3447257ae4e4bcdfa732552607d32f8b19d25264 Mon Sep 17 00:00:00 2001 From: Ian Barwick Date: Fri, 8 Sep 2017 20:59:21 +0900 Subject: [PATCH] repmgrd: minor fixes and comment updates --- repmgr-action-standby.c | 4 ++++ repmgrd-physical.c | 9 ++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/repmgr-action-standby.c b/repmgr-action-standby.c index dd3ed098..0f2be0b1 100644 --- a/repmgr-action-standby.c +++ b/repmgr-action-standby.c @@ -1506,6 +1506,10 @@ _do_standby_promote_internal(PGconn *conn, const char *data_dir) * * Node must be running. To start an inactive node and point it at a * new primary, use "repmgr node rejoin". + * + * TODO: enable provision of new primary's conninfo parameters, which + * will be necessary if the primary's information has changed, but + * was not replicated to the current standby. */ void diff --git a/repmgrd-physical.c b/repmgrd-physical.c index 33cd1e8a..23a7d5ba 100644 --- a/repmgrd-physical.c +++ b/repmgrd-physical.c @@ -222,7 +222,7 @@ monitor_streaming_primary(void) if (is_server_available(local_node_info.conninfo) == false) { - /* node is down, we were expecting it to be up */ + /* local node is down, we were expecting it to be up */ if (local_node_info.node_status == NODE_STATUS_UP) { PQExpBufferData event_details; @@ -617,11 +617,10 @@ monitor_streaming_standby(void) failover_done = do_upstream_standby_failover(); } - // it's possible it will make sense to return in - // all cases to restart monitoring + /* XXX it's possible it will make sense to return in all cases to restart monitoring */ if (failover_done == true) { - primary_node_id = get_primary_node_id(primary_conn); + primary_node_id = get_primary_node_id(local_conn); return; } } @@ -1486,7 +1485,7 @@ promote_self(void) int primary_node_id; upstream_conn = get_primary_connection(local_conn, - &primary_node_id, NULL); + &primary_node_id, NULL); if (PQstatus(upstream_conn) == CONNECTION_OK && primary_node_id == failed_primary.node_id) {