From 875cdf51022e4b45b39a7bfbf2db78ab609d5671 Mon Sep 17 00:00:00 2001 From: Ian Barwick Date: Fri, 14 Jul 2017 09:59:56 +0900 Subject: [PATCH] repmgrd: don't run in BDR mode on a node marked as inactive --- repmgrd-bdr.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/repmgrd-bdr.c b/repmgrd-bdr.c index 0869a265..c74b63e6 100644 --- a/repmgrd-bdr.c +++ b/repmgrd-bdr.c @@ -82,15 +82,20 @@ monitor_bdr(void) if (record_status != RECORD_FOUND) { log_error(_("unable to retrieve record for local node (ID: %i), terminating"), - local_node_info.node_id); - log_hint(_("check that 'repmgr bdr register' was executed for this node\n")); + local_node_info.node_id); + log_hint(_("check that 'repmgr bdr register' was executed for this node")); PQfinish(local_conn); exit(ERR_BAD_CONFIG); } - - // check if inactive node - // -> what to do? + if (local_node_info.active == false) + { + log_error(_("local node (ID: %i) is marked as inactive in repmgr"), + local_node_info.node_id); + log_hint(_("if the node has been reactivated, run \"repmgr bdr register --force\" and restart repmgrd")); + PQfinish(local_conn); + exit(ERR_BAD_CONFIG); + } /* Log startup event */