]> granicus.if.org Git - postgresql/commitdiff
Do wal_level and hot standby checks when doing crash-then-archive recovery.
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Wed, 5 Mar 2014 12:41:55 +0000 (14:41 +0200)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Wed, 5 Mar 2014 12:45:55 +0000 (14:45 +0200)
CheckRequiredParameterValues() should perform the checks if archive recovery
was requested, even if we are going to perform crash recovery first.

Reported by Kyotaro HORIGUCHI. Backpatch to 9.2, like the crash-then-archive
recovery mode.

src/backend/access/transam/xlog.c

index 9f34f1ec7cf40d7b38e7d60a95aa63b03883eec8..15e0c01b59d3668408f7e141270885fff57a27e7 100644 (file)
@@ -6195,7 +6195,7 @@ CheckRequiredParameterValues(void)
         * For archive recovery, the WAL must be generated with at least 'archive'
         * wal_level.
         */
-       if (InArchiveRecovery && ControlFile->wal_level == WAL_LEVEL_MINIMAL)
+       if (ArchiveRecoveryRequested && ControlFile->wal_level == WAL_LEVEL_MINIMAL)
        {
                ereport(WARNING,
                                (errmsg("WAL was generated with wal_level=minimal, data may be missing"),
@@ -6206,7 +6206,7 @@ CheckRequiredParameterValues(void)
         * For Hot Standby, the WAL must be generated with 'hot_standby' mode, and
         * we must have at least as many backend slots as the primary.
         */
-       if (InArchiveRecovery && EnableHotStandby)
+       if (ArchiveRecoveryRequested && EnableHotStandby)
        {
                if (ControlFile->wal_level < WAL_LEVEL_HOT_STANDBY)
                        ereport(ERROR,