Skip to content

Commit e7ec055

Browse files
committed
Do wal_level and hot standby checks when doing crash-then-archive recovery.
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.
1 parent 931dc26 commit e7ec055

File tree

1 file changed

+2
-2
lines changed
  • src/backend/access/transam

1 file changed

+2
-2
lines changed

src/backend/access/transam/xlog.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6195,7 +6195,7 @@ CheckRequiredParameterValues(void)
61956195
* For archive recovery, the WAL must be generated with at least 'archive'
61966196
* wal_level.
61976197
*/
6198-
if (InArchiveRecovery && ControlFile->wal_level == WAL_LEVEL_MINIMAL)
6198+
if (ArchiveRecoveryRequested && ControlFile->wal_level == WAL_LEVEL_MINIMAL)
61996199
{
62006200
ereport(WARNING,
62016201
(errmsg("WAL was generated with wal_level=minimal, data may be missing"),
@@ -6206,7 +6206,7 @@ CheckRequiredParameterValues(void)
62066206
* For Hot Standby, the WAL must be generated with 'hot_standby' mode, and
62076207
* we must have at least as many backend slots as the primary.
62086208
*/
6209-
if (InArchiveRecovery && EnableHotStandby)
6209+
if (ArchiveRecoveryRequested && EnableHotStandby)
62106210
{
62116211
if (ControlFile->wal_level < WAL_LEVEL_HOT_STANDBY)
62126212
ereport(ERROR,

0 commit comments

Comments
 (0)