postgres.git / summary / log / commit / refs
commit ca60f0c422bd2c8538ee945d5f5e81eb498ddfde
Author: Heikki Linnakangas <heikki.linnakangas@iki.fi>
Date: Fri Feb 22 11:07:02 2013 +0000
First released in: 9.3.0, 9.2.4
Fix thinko in previous commit.
We must still initialize minRecoveryPoint if we start straight with archive
recovery, e.g when recovering from a normal base backup taken with
pg_start/stop_backup. Otherwise we never consider the system consistent.
src/backend/access/transam/xlog.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index d47d0d916bf..92adc4e9fed 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -6580,6 +6580,12 @@ StartupXLOG(void)
ControlFile->prevCheckPoint = ControlFile->checkPoint;
ControlFile->checkPoint = checkPointLoc;
ControlFile->checkPointCopy = checkPoint;
+ if (InArchiveRecovery)
+ {
+ /* initialize minRecoveryPoint if not set yet */
+ if (XLByteLT(ControlFile->minRecoveryPoint, checkPoint.redo))
+ ControlFile->minRecoveryPoint = checkPoint.redo;
+ }
/*
* Set backupStartPoint if we're starting recovery from a base backup.
[parent: ee8b95e8c807]