diff options
author | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2011-03-30 10:36:58 +0300 |
---|---|---|
committer | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2011-03-30 10:53:28 +0300 |
commit | acf47401321ce55f06026a2f5d5512b404da3e55 (patch) | |
tree | ad77343da8e3478b35beafda0fef7475c64f3b32 /src/backend/access/transam/xlog.c | |
parent | 754baa21f723255272c24dc5f9ab456858e361e3 (diff) | |
download | postgresql-acf47401321ce55f06026a2f5d5512b404da3e55.tar.gz postgresql-acf47401321ce55f06026a2f5d5512b404da3e55.zip |
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.
Diffstat (limited to 'src/backend/access/transam/xlog.c')
-rw-r--r-- | src/backend/access/transam/xlog.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index 418054066d1..c255691918d 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -6256,8 +6256,7 @@ StartupXLOG(void) } /* - * set backupStartupPoint if we're starting archive recovery from a - * base backup + * set backupStartPoint if we're starting recovery from a base backup */ if (haveBackupLabel) ControlFile->backupStartPoint = checkPoint.redo; @@ -6610,7 +6609,7 @@ StartupXLOG(void) * be further ahead --- ControlFile->minRecoveryPoint cannot have been * advanced beyond the WAL we processed. */ - if (InArchiveRecovery && + if (InRecovery && (XLByteLT(EndOfLog, minRecoveryPoint) || !XLogRecPtrIsInvalid(ControlFile->backupStartPoint))) { @@ -8311,8 +8310,7 @@ xlog_redo(XLogRecPtr lsn, XLogRecord *record) * record, the backup was cancelled and the end-of-backup record will * never arrive. */ - if (InArchiveRecovery && - !XLogRecPtrIsInvalid(ControlFile->backupStartPoint)) + if (!XLogRecPtrIsInvalid(ControlFile->backupStartPoint)) ereport(ERROR, (errmsg("online backup was cancelled, recovery cannot continue"))); |