From cfbeed50d69fbb59a6edfff7d4a7cf209c0213f2 Mon Sep 17 00:00:00 2001 From: Ian Barwick Date: Wed, 6 Jan 2021 14:10:23 +0900 Subject: [PATCH] node rejoin: emit rejoin target note information as NOTICE As it's possible to specify the connection information for any available node, but currently not possible to rejoin to a node other than the primary, explicitly mention what the rejoin target will be. --- doc/repmgr-node-rejoin.xml | 2 ++ repmgr-action-node.c | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/doc/repmgr-node-rejoin.xml b/doc/repmgr-node-rejoin.xml index 8a0b4dfe..b4d4a128 100644 --- a/doc/repmgr-node-rejoin.xml +++ b/doc/repmgr-node-rejoin.xml @@ -285,6 +285,7 @@ $ repmgr node rejoin -f /etc/repmgr.conf -d 'host=node3 dbname=repmgr user=repmgr' \ --force-rewind --config-files=postgresql.local.conf,postgresql.conf --verbose --dry-run + NOTICE: rejoin target is node "node3" (node ID: 3) INFO: replication connection to the rejoin target node was successful INFO: local and rejoin target system identifiers match DETAIL: system identifier is 6652184002263212600 @@ -343,6 +344,7 @@ $ repmgr node rejoin -f /etc/repmgr.conf -d 'host=node3 dbname=repmgr user=repmgr' \ --config-files=postgresql.local.conf,postgresql.conf --verbose --force-rewind --dry-run + NOTICE: rejoin target is node "node3" (node ID: 3) INFO: replication connection to the rejoin target node was successful INFO: local and rejoin target system identifiers match DETAIL: system identifier is 6652460429293670710 diff --git a/repmgr-action-node.c b/repmgr-action-node.c index 6003e111..bb3cbe51 100644 --- a/repmgr-action-node.c +++ b/repmgr-action-node.c @@ -2612,6 +2612,13 @@ do_node_rejoin(void) exit(ERR_BAD_CONFIG); } + /* + * Emit a notice about the identity of the rejoin target + */ + log_notice(_("rejoin target is node \"%s\" (ID: %i)"), + primary_node_record.node_name, + primary_node_record.node_id); + /* connect to registered primary and check it's not in recovery */ primary_conn = establish_db_connection(primary_node_record.conninfo, false);