aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/transam/xlog.c
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2016-02-29 20:01:54 -0500
committerPeter Eisentraut <peter_e@gmx.net>2016-03-18 23:56:03 +0100
commitb555ed8102672cfedb06559952b8341756386d69 (patch)
tree6e3174c6e0bcd2faee09307092ecdca5dd0169b9 /src/backend/access/transam/xlog.c
parent4e1d2a170836028370675922ea9a690648d3c18d (diff)
downloadpostgresql-b555ed8102672cfedb06559952b8341756386d69.tar.gz
postgresql-b555ed8102672cfedb06559952b8341756386d69.zip
Merge wal_level "archive" and "hot_standby" into new name "replica"
The distinction between "archive" and "hot_standby" existed only because at the time "hot_standby" was added, there was some uncertainty about stability. This is now a long time ago. We would like to move forward with simplifying the replication configuration, but this distinction is in the way, because a primary server cannot tell (without asking a standby or predicting the future) which one of these would be the appropriate level. Pick a new name for the combined setting to make it clearer that it covers all (non-logical) backup and replication uses. The old values are still accepted but are converted internally. Reviewed-by: Michael Paquier <michael.paquier@gmail.com> Reviewed-by: David Steele <david@pgmasters.net>
Diffstat (limited to 'src/backend/access/transam/xlog.c')
-rw-r--r--src/backend/access/transam/xlog.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index f70bb49012e..b119a47e4e0 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -5866,7 +5866,7 @@ static void
CheckRequiredParameterValues(void)
{
/*
- * For archive recovery, the WAL must be generated with at least 'archive'
+ * For archive recovery, the WAL must be generated with at least 'replica'
* wal_level.
*/
if (ArchiveRecoveryRequested && ControlFile->wal_level == WAL_LEVEL_MINIMAL)
@@ -5877,15 +5877,15 @@ CheckRequiredParameterValues(void)
}
/*
- * For Hot Standby, the WAL must be generated with 'hot_standby' mode, and
+ * For Hot Standby, the WAL must be generated with 'replica' mode, and
* we must have at least as many backend slots as the primary.
*/
if (ArchiveRecoveryRequested && EnableHotStandby)
{
- if (ControlFile->wal_level < WAL_LEVEL_HOT_STANDBY)
+ if (ControlFile->wal_level < WAL_LEVEL_REPLICA)
ereport(ERROR,
- (errmsg("hot standby is not possible because wal_level was not set to \"hot_standby\" or higher on the master server"),
- errhint("Either set wal_level to \"hot_standby\" on the master, or turn off hot_standby here.")));
+ (errmsg("hot standby is not possible because wal_level was not set to \"replica\" or higher on the master server"),
+ errhint("Either set wal_level to \"replica\" on the master, or turn off hot_standby here.")));
/* We ignore autovacuum_max_workers when we make this test. */
RecoveryRequiresIntParameter("max_connections",
@@ -9459,10 +9459,8 @@ xlog_redo(XLogReaderState *record)
/*
* Update minRecoveryPoint to ensure that if recovery is aborted, we
* recover back up to this point before allowing hot standby again.
- * This is particularly important if wal_level was set to 'archive'
- * before, and is now 'hot_standby', to ensure you don't run queries
- * against the WAL preceding the wal_level change. Same applies to
- * decreasing max_* settings.
+ * This is important if the max_* settings are decreased, to ensure
+ * you don't run queries against the WAL preceding the change.
*/
minRecoveryPoint = ControlFile->minRecoveryPoint;
minRecoveryPointTLI = ControlFile->minRecoveryPointTLI;
@@ -9793,7 +9791,7 @@ do_pg_start_backup(const char *backupidstr, bool fast, TimeLineID *starttli_p,
ereport(ERROR,
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
errmsg("WAL level not sufficient for making an online backup"),
- errhint("wal_level must be set to \"archive\", \"hot_standby\", or \"logical\" at server start.")));
+ errhint("wal_level must be set to \"replica\" or \"logical\" at server start.")));
if (strlen(backupidstr) > MAXPGPATH)
ereport(ERROR,
@@ -10264,7 +10262,7 @@ do_pg_stop_backup(char *labelfile, bool waitforarchive, TimeLineID *stoptli_p)
ereport(ERROR,
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
errmsg("WAL level not sufficient for making an online backup"),
- errhint("wal_level must be set to \"archive\", \"hot_standby\", or \"logical\" at server start.")));
+ errhint("wal_level must be set to \"replica\" or \"logical\" at server start.")));
/*
* OK to update backup counters and forcePageWrites