On Sun, Dec 7, 2014 at 9:59 PM, Simon Riggs <[email protected]> wrote:
>
> Tweaks for recovery_target_action
>
> Rename parameter action_at_recovery_target to
> recovery_target_action suggested by Christoph Berg.
>
> Place into recovery.conf suggested by Fujii Masao,
> replacing (deprecating) earlier parameters, per
> Michael Paquier.
Robert has mentioned here
(ca+tgmoz5aenvfrj2+dr9hy4z3xay_orqzctz7v0qccxqohu...@mail.gmail.com)
as well about simply removing any reference to
pause_at_recovery_action in the code and in the docs, or at least it
is what I understood. Agreeing on this idea, I think that you would
need as well the patch attached. In any case, this commit has
forgotten to update doc/src/sgml/recovery-config.sgml, where
action_at_recovery_target is still mentioned.
Thanks,
--
Michael
diff --git a/doc/src/sgml/recovery-config.sgml b/doc/src/sgml/recovery-config.sgml
index b4959ac..519a0ce 100644
--- a/doc/src/sgml/recovery-config.sgml
+++ b/doc/src/sgml/recovery-config.sgml
@@ -280,31 +280,11 @@ restore_command = 'copy "C:\\server\\archivedir\\%f" "%p"' # Windows
</listitem>
</varlistentry>
- <varlistentry id="pause-at-recovery-target"
- xreflabel="pause_at_recovery_target">
- <term><varname>pause_at_recovery_target</varname> (<type>boolean</type>)
+ <varlistentry id="recovery-target-action"
+ xreflabel="recovery_target_action">
+ <term><varname>recovery_target_action</varname> (<type>enum</type>)
<indexterm>
- <primary><varname>pause_at_recovery_target</> recovery parameter</primary>
- </indexterm>
- </term>
- <listitem>
- <para>
- Alias for action_at_recovery_target, <literal>true</> is same as
- action_at_recovery_target = <literal>pause</> and <literal>false</>
- is same as action_at_recovery_target = <literal>promote</>.
- </para>
- <para>
- This setting has no effect if <xref linkend="guc-hot-standby"> is not
- enabled, or if no recovery target is set.
- </para>
- </listitem>
- </varlistentry>
-
- <varlistentry id="action-at-recovery-target"
- xreflabel="action_at_recovery_target">
- <term><varname>action_at_recovery_target</varname> (<type>enum</type>)
- <indexterm>
- <primary><varname>action_at_recovery_target</> recovery parameter</primary>
+ <primary><varname>recovery_target_action</> recovery parameter</primary>
</indexterm>
</term>
<listitem>
@@ -336,7 +316,7 @@ restore_command = 'copy "C:\\server\\archivedir\\%f" "%p"' # Windows
</para>
<para>
Note that because <filename>recovery.conf</> will not be renamed when
- <varname>action_at_recovery_target</> is set to <literal>shutdown</>,
+ <varname>recovery_target_action</> is set to <literal>shutdown</>,
any subsequent start will end with immediate shutdown unless the
configuration is changed or the <filename>recovery.conf</> is removed
manually.
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index 0f09add..e4193f4 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -4653,10 +4653,8 @@ readRecoveryCommandFile(void)
ConfigVariable *item,
*head = NULL,
*tail = NULL;
- bool recoveryPauseAtTargetSet = false;
bool recoveryTargetActionSet = false;
-
fd = AllocateFile(RECOVERY_COMMAND_FILE, "r");
if (fd == NULL)
{
@@ -4699,25 +4697,6 @@ readRecoveryCommandFile(void)
(errmsg_internal("archive_cleanup_command = '%s'",
archiveCleanupCommand)));
}
- else if (strcmp(item->name, "pause_at_recovery_target") == 0)
- {
- bool recoveryPauseAtTarget;
-
- if (!parse_bool(item->value, &recoveryPauseAtTarget))
- ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("parameter \"%s\" requires a Boolean value", "pause_at_recovery_target")));
-
- ereport(DEBUG2,
- (errmsg_internal("pause_at_recovery_target = '%s'",
- item->value)));
-
- recoveryTargetAction = recoveryPauseAtTarget ?
- RECOVERY_TARGET_ACTION_PAUSE :
- RECOVERY_TARGET_ACTION_PROMOTE;
-
- recoveryPauseAtTargetSet = true;
- }
else if (strcmp(item->name, "recovery_target_action") == 0)
{
if (strcmp(item->value, "pause") == 0)
@@ -4903,18 +4882,6 @@ readRecoveryCommandFile(void)
}
/*
- * Check for mutually exclusive parameters
- */
- if (recoveryPauseAtTargetSet && recoveryTargetActionSet)
- ereport(ERROR,
- (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
- errmsg("cannot set both \"%s\" and \"%s\" recovery parameters",
- "pause_at_recovery_target",
- "recovery_target_action"),
- errhint("The \"pause_at_recovery_target\" is deprecated.")));
-
-
- /*
* Override any inconsistent requests. Not that this is a change
* of behaviour in 9.5; prior to this we simply ignored a request
* to pause if hot_standby = off, which was surprising behaviour.
--
Sent via pgsql-committers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers