Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit acf4740

Browse files
committed
Check that we've reached end-of-backup also when we're not performing
archive recovery. It's possible to restore an online backup without recovery.conf, by simply copying all the necessary WAL files to pg_xlog. "pg_basebackup -x" does that too. That's the use case where this cross-check is useful. Backpatch to 9.0. We used to do this in earlier versins, but in 9.0 the code was inadvertently changed so that the check is only performed after archive recovery. Fujii Masao.
1 parent 754baa2 commit acf4740

File tree

1 file changed

+3
-5
lines changed
  • src/backend/access/transam

1 file changed

+3
-5
lines changed

src/backend/access/transam/xlog.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6256,8 +6256,7 @@ StartupXLOG(void)
62566256
}
62576257

62586258
/*
6259-
* set backupStartupPoint if we're starting archive recovery from a
6260-
* base backup
6259+
* set backupStartPoint if we're starting recovery from a base backup
62616260
*/
62626261
if (haveBackupLabel)
62636262
ControlFile->backupStartPoint = checkPoint.redo;
@@ -6610,7 +6609,7 @@ StartupXLOG(void)
66106609
* be further ahead --- ControlFile->minRecoveryPoint cannot have been
66116610
* advanced beyond the WAL we processed.
66126611
*/
6613-
if (InArchiveRecovery &&
6612+
if (InRecovery &&
66146613
(XLByteLT(EndOfLog, minRecoveryPoint) ||
66156614
!XLogRecPtrIsInvalid(ControlFile->backupStartPoint)))
66166615
{
@@ -8311,8 +8310,7 @@ xlog_redo(XLogRecPtr lsn, XLogRecord *record)
83118310
* record, the backup was cancelled and the end-of-backup record will
83128311
* never arrive.
83138312
*/
8314-
if (InArchiveRecovery &&
8315-
!XLogRecPtrIsInvalid(ControlFile->backupStartPoint))
8313+
if (!XLogRecPtrIsInvalid(ControlFile->backupStartPoint))
83168314
ereport(ERROR,
83178315
(errmsg("online backup was cancelled, recovery cannot continue")));
83188316

0 commit comments

Comments
 (0)