From 9c04de11fc6f8258896500a5d3779bc220f4d170 Mon Sep 17 00:00:00 2001 From: Ian Barwick Date: Tue, 17 Nov 2020 09:58:51 +0900 Subject: [PATCH] standby clone: various clarifications for --replication-conf-only option In particular, the emitted HINT was not really appropriate for Pg13 and later. --- doc/repmgr-standby-clone.xml | 27 ++++++++++++++++++++------- repmgr-action-standby.c | 13 ++++++++++++- 2 files changed, 32 insertions(+), 8 deletions(-) diff --git a/doc/repmgr-standby-clone.xml b/doc/repmgr-standby-clone.xml index eec3ad4c..ad7470c7 100644 --- a/doc/repmgr-standby-clone.xml +++ b/doc/repmgr-standby-clone.xml @@ -260,16 +260,29 @@ pg_basebackup_options='--waldir=/path/to/wal-directory' upstream node if required. - Note that the upstream node must be running. In PostgreSQL 11 and earlier, an existing - recovery.conf will not be overwritten unless the - option is provided. + The upstream node must be running so the correct replication configuration can be obtained. - Execute repmgr standby clone --replication-conf-only --dry-run - to check the prerequisites for creating the recovery configuration, - and display the contents of the configuration which would be added without actually - making any changes. + If the standby is running, the replication configuration will not be written unless the + option is provided. + + + Execute repmgr standby clone --replication-conf-only --dry-run + to check the prerequisites for creating the recovery configuration, + and display the configuration changes which would be made without actually + making any changes. + + + + In PostgreSQL 13 and later, the PostgreSQL configuration must be reloaded for replication + configuration changes to take effect. + + + In PostgreSQL 12 and earlier, the PostgreSQL instance must be restarted for replication + configuration changes to take effect. + + diff --git a/repmgr-action-standby.c b/repmgr-action-standby.c index 651264fd..b03e53d6 100644 --- a/repmgr-action-standby.c +++ b/repmgr-action-standby.c @@ -1453,7 +1453,18 @@ _do_create_replication_conf(void) if (node_is_running == true) { - log_hint(_("node must be restarted for the new file to take effect")); + if (PQserverVersion(upstream_conn) >= 130000) + { + log_hint(_("configuration must be reloaded for the configuration changes to take effect")); + } + else if (PQserverVersion(upstream_conn) >= 120000) + { + log_hint(_("node must be restarted for the configuration changes to take effect")); + } + else + { + log_hint(_("node must be restarted for the new file to take effect")); + } } } }