From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Allow some recovery parameters to be changed with reload
Date: Mon, 4 Feb 2019 11:58:28 +0100
Message-ID: <ca28011a-cfaa-565c-d622-c1907c33ecf7@2ndquadrant.com> (raw)
I think the recovery parameters
archive_cleanup_command
promote_trigger_file
recovery_end_command
recovery_min_apply_delay
can be changed from PGC_POSTMASTER to PGC_SIGHUP without any further
complications (unlike for example primary_conninfo, which is being
discussed elsewhere).
See attached patch.
--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Attachments:0001-Allow-some-recovery-parameters-to-be-changed-with-re.patch (text/plain, 5.8K) download
From 6e0777f4799bce027aa339629539cc101ed0f862 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <peter@eisentraut.org>
Date: Mon, 4 Feb 2019 09:28:17 +0100
Subject: [PATCH] Allow some recovery parameters to be changed with reload
Change
archive_cleanup_command
promote_trigger_file
recovery_end_command
recovery_min_apply_delay
from PGC_POSTMASTER to PGC_SIGHUP. This did not require any further
changes.
---
doc/src/sgml/config.sgml | 21 +++++++++++++++----
src/backend/utils/misc/guc.c | 8 +++----
src/backend/utils/misc/postgresql.conf.sample | 4 ----
3 files changed, 21 insertions(+), 12 deletions(-)
diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgmlindex 9b7a7388d5..7e208a4b81 100644--- a/doc/src/sgml/config.sgml+++ b/doc/src/sgml/config.sgml@@ -3081,8 +3081,7 @@ <title>Archive Recovery</title>
<para>
This section describes the settings that apply only for the duration of
the recovery. They must be reset for any subsequent recovery you wish to
- perform. They can only be set at server start and cannot be changed once- recovery has begun.+ perform.
</para>
<para>
@@ -3161,6 +3160,10 @@ <title>Archive Recovery</title>
database server shutdown) or an error by the shell (such as command
not found), then recovery will abort and the server will not start up.
</para>
++ <para>+ This parameter can only be set at server start.+ </para>
</listitem>
</varlistentry>
@@ -3202,6 +3205,10 @@ <title>Archive Recovery</title>
terminated by a signal or an error by the shell (such as command not
found), a fatal error will be raised.
</para>
+ <para>+ This parameter can only be set in the <filename>postgresql.conf</filename>+ file or on the server command line.+ </para>
</listitem>
</varlistentry>
@@ -3227,6 +3234,10 @@ <title>Archive Recovery</title>
signal or an error by the shell (such as command not found), the
database will not proceed with startup.
</para>
+ <para>+ This parameter can only be set in the <filename>postgresql.conf</filename>+ file or on the server command line.+ </para>
</listitem>
</varlistentry>
@@ -3863,7 +3874,8 @@ <title>Standby Servers</title>
standby. Even if this value is not set, you can still promote
the standby using <command>pg_ctl promote</command> or calling
<function>pg_promote</function>.
- This parameter can only be set at server start.+ This parameter can only be set in the <filename>postgresql.conf</filename>+ file or on the server command line.
</para>
</listitem>
</varlistentry>
@@ -4117,7 +4129,8 @@ <title>Standby Servers</title>
</warning>
</para>
<para>
- This parameter can only be set at server start.+ This parameter can only be set in the <filename>postgresql.conf</filename>+ file or on the server command line.
</para>
</listitem>
</varlistentry>
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.cindex 8681ada33a..ea5444c6f1 100644--- a/src/backend/utils/misc/guc.c+++ b/src/backend/utils/misc/guc.c@@ -2047,7 +2047,7 @@ static struct config_int ConfigureNamesInt[] =
},
{
- {"recovery_min_apply_delay", PGC_POSTMASTER, REPLICATION_STANDBY,+ {"recovery_min_apply_delay", PGC_SIGHUP, REPLICATION_STANDBY,
gettext_noop("Sets the minimum delay for applying changes during recovery."),
NULL,
GUC_UNIT_MS
@@ -3398,7 +3398,7 @@ static struct config_string ConfigureNamesString[] =
},
{
- {"archive_cleanup_command", PGC_POSTMASTER, WAL_ARCHIVE_RECOVERY,+ {"archive_cleanup_command", PGC_SIGHUP, WAL_ARCHIVE_RECOVERY,
gettext_noop("Sets the shell command that will be executed at every restart point."),
NULL
},
@@ -3408,7 +3408,7 @@ static struct config_string ConfigureNamesString[] =
},
{
- {"recovery_end_command", PGC_POSTMASTER, WAL_ARCHIVE_RECOVERY,+ {"recovery_end_command", PGC_SIGHUP, WAL_ARCHIVE_RECOVERY,
gettext_noop("Sets the shell command that will be executed once at the end of recovery."),
NULL
},
@@ -3474,7 +3474,7 @@ static struct config_string ConfigureNamesString[] =
},
{
- {"promote_trigger_file", PGC_POSTMASTER, REPLICATION_STANDBY,+ {"promote_trigger_file", PGC_SIGHUP, REPLICATION_STANDBY,
gettext_noop("Specifies a file name whose presence ends recovery in the standby."),
NULL
},
diff --git a/src/backend/utils/misc/postgresql.conf.sample b/src/backend/utils/misc/postgresql.conf.sampleindex c7f53470df..ad6c436f93 100644--- a/src/backend/utils/misc/postgresql.conf.sample+++ b/src/backend/utils/misc/postgresql.conf.sample@@ -244,9 +244,7 @@
# e.g. 'cp /mnt/server/archivedir/%f %p'
# (change requires restart)
#archive_cleanup_command = '' # command to execute at every restartpoint
- # (change requires restart)
#recovery_end_command = '' # command to execute at completion of recovery
- # (change requires restart)
# - Recovery Target -
@@ -310,7 +308,6 @@
#primary_slot_name = '' # replication slot on sending server
# (change requires restart)
#promote_trigger_file = '' # file name whose presence ends recovery
- # (change requires restart)
#hot_standby = on # "off" disallows queries during recovery
# (change requires restart)
#max_standby_archive_delay = 30s # max delay before canceling queries
@@ -329,7 +326,6 @@
#wal_retrieve_retry_interval = 5s # time to wait before retrying to
# retrieve WAL after a failed attempt
#recovery_min_apply_delay = 0 # minimum delay for applying changes during recovery
- # (change requires restart)
# - Subscribers -
--
2.20.1
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: peter.eisentraut@2ndquadrant.com
Subject: Re: Allow some recovery parameters to be changed with reload
In-Reply-To: <ca28011a-cfaa-565c-d622-c1907c33ecf7@2ndquadrant.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox