aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/transam/xlog.c
diff options
context:
space:
mode:
authorSimon Riggs <simon@2ndQuadrant.com>2014-12-07 21:55:29 +0900
committerSimon Riggs <simon@2ndQuadrant.com>2014-12-07 21:55:29 +0900
commitb8e33a85d4e86a8391118c3d5cdb249b560dec4f (patch)
tree798ec42ce4a2beb735660afe08d0b3aacf37e452 /src/backend/access/transam/xlog.c
parent198cbe0a0c4b539c9f9f3f2e9169d774d1d39a8e (diff)
downloadpostgresql-b8e33a85d4e86a8391118c3d5cdb249b560dec4f.tar.gz
postgresql-b8e33a85d4e86a8391118c3d5cdb249b560dec4f.zip
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.
Diffstat (limited to 'src/backend/access/transam/xlog.c')
-rw-r--r--src/backend/access/transam/xlog.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index da28de90db6..0f09add784e 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 ?
+ 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:
/*