On 02/12/14 18:59, Robert Haas wrote:
On Fri, Nov 28, 2014 at 11:59 AM, Petr Jelinek <p...@2ndquadrant.com> wrote:
I'm a bit late to the party, but wouldn't
recovery_target_action = ...
have been a better name for this? It'd be in line with the other
recovery_target_* parameters, and also a bit shorter than the imho
somewhat ugly "action_at_recovery_target".
FWIW, I too think that "recovery_target_action" is a better name.
I agree.
+1.
Here is patch which renames action_at_recovery_target to
recovery_target_action everywhere.
--
Petr Jelinek http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services
diff --git a/doc/src/sgml/recovery-config.sgml b/doc/src/sgml/recovery-config.sgml
index b4959ac..06d66d2 100644
--- a/doc/src/sgml/recovery-config.sgml
+++ b/doc/src/sgml/recovery-config.sgml
@@ -289,9 +289,9 @@ restore_command = 'copy "C:\\server\\archivedir\\%f" "%p"' # Windows
</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</>.
+ Alias for recovery_target_action, <literal>true</> is same as
+ recovery_target_action = <literal>pause</> and <literal>false</>
+ is same as recovery_target_action = <literal>promote</>.
</para>
<para>
This setting has no effect if <xref linkend="guc-hot-standby"> is not
@@ -300,11 +300,11 @@ restore_command = 'copy "C:\\server\\archivedir\\%f" "%p"' # Windows
</listitem>
</varlistentry>
- <varlistentry id="action-at-recovery-target"
- xreflabel="action_at_recovery_target">
- <term><varname>action_at_recovery_target</varname> (<type>enum</type>)
+ <varlistentry id="recovery-target-action"
+ xreflabel="recovery_target_action">
+ <term><varname>recovery_target_action</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 +336,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 da28de9..e8e5325 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -229,7 +229,7 @@ static char *recoveryEndCommand = NULL;
static char *archiveCleanupCommand = NULL;
static RecoveryTargetType recoveryTarget = RECOVERY_TARGET_UNSET;
static bool recoveryTargetInclusive = true;
-static RecoveryTargetAction actionAtRecoveryTarget = RECOVERY_TARGET_ACTION_PAUSE;
+static RecoveryTargetAction recoveryTargetAction = RECOVERY_TARGET_ACTION_PAUSE;
static TransactionId recoveryTargetXid;
static TimestampTz recoveryTargetTime;
static char *recoveryTargetName;
@@ -4654,7 +4654,7 @@ readRecoveryCommandFile(void)
*head = NULL,
*tail = NULL;
bool recoveryPauseAtTargetSet = false;
- bool actionAtRecoveryTargetSet = false;
+ bool recoveryTargetActionSet = false;
fd = AllocateFile(RECOVERY_COMMAND_FILE, "r");
@@ -4712,32 +4712,32 @@ readRecoveryCommandFile(void)
(errmsg_internal("pause_at_recovery_target = '%s'",
item->value)));
- actionAtRecoveryTarget = recoveryPauseAtTarget ?
- RECOVERY_TARGET_ACTION_PAUSE :
- RECOVERY_TARGET_ACTION_PROMOTE;
+ recoveryTargetAction = recoveryPauseAtTarget ?
+ RECOVERY_TARGET_ACTION_PAUSE :
+ RECOVERY_TARGET_ACTION_PROMOTE;
recoveryPauseAtTargetSet = true;
}
- else if (strcmp(item->name, "action_at_recovery_target") == 0)
+ else if (strcmp(item->name, "recovery_target_action") == 0)
{
if (strcmp(item->value, "pause") == 0)
- actionAtRecoveryTarget = RECOVERY_TARGET_ACTION_PAUSE;
+ recoveryTargetAction = RECOVERY_TARGET_ACTION_PAUSE;
else if (strcmp(item->value, "promote") == 0)
- actionAtRecoveryTarget = RECOVERY_TARGET_ACTION_PROMOTE;
+ recoveryTargetAction = RECOVERY_TARGET_ACTION_PROMOTE;
else if (strcmp(item->value, "shutdown") == 0)
- actionAtRecoveryTarget = RECOVERY_TARGET_ACTION_SHUTDOWN;
+ recoveryTargetAction = RECOVERY_TARGET_ACTION_SHUTDOWN;
else
ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("invalid value for recovery parameter \"%s\"",
- "action_at_recovery_target"),
+ "recovery_target_action"),
errhint("The allowed values are \"pause\", \"promote\" and \"shutdown\".")));
ereport(DEBUG2,
- (errmsg_internal("action_at_recovery_target = '%s'",
+ (errmsg_internal("recovery_target_action = '%s'",
item->value)));
- actionAtRecoveryTargetSet = true;
+ recoveryTargetActionSet = true;
}
else if (strcmp(item->name, "recovery_target_timeline") == 0)
{
@@ -4905,12 +4905,12 @@ readRecoveryCommandFile(void)
/*
* Check for mutually exclusive parameters
*/
- if (recoveryPauseAtTargetSet && actionAtRecoveryTargetSet)
+ if (recoveryPauseAtTargetSet && recoveryTargetActionSet)
ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("cannot set both \"%s\" and \"%s\" recovery parameters",
"pause_at_recovery_target",
- "action_at_recovery_target"),
+ "recovery_target_action"),
errhint("The \"pause_at_recovery_target\" is deprecated.")));
@@ -4919,10 +4919,10 @@ readRecoveryCommandFile(void)
* of behaviour in 9.5; prior to this we simply ignored a request
* to pause if hot_standby = off, which was surprising behaviour.
*/
- if (actionAtRecoveryTarget == RECOVERY_TARGET_ACTION_PAUSE &&
- actionAtRecoveryTargetSet &&
+ if (recoveryTargetAction == RECOVERY_TARGET_ACTION_PAUSE &&
+ recoveryTargetActionSet &&
standbyState == STANDBY_DISABLED)
- actionAtRecoveryTarget = RECOVERY_TARGET_ACTION_SHUTDOWN;
+ recoveryTargetAction = RECOVERY_TARGET_ACTION_SHUTDOWN;
/* Enable fetching from archive recovery area */
ArchiveRecoveryRequested = true;
@@ -6495,7 +6495,7 @@ StartupXLOG(void)
* this, Resource Managers may choose to do permanent corrective
* actions at end of recovery.
*/
- switch (actionAtRecoveryTarget)
+ switch (recoveryTargetAction)
{
case RECOVERY_TARGET_ACTION_SHUTDOWN:
/*
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers