From: Heikki Linnakangas Date: Fri, 22 Feb 2013 11:07:02 +0000 (+0200) Subject: Fix thinko in previous commit. X-Git-Tag: REL9_2_4~38 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ca60f0c422bd2c8538ee945d5f5e81eb498ddfde;p=postgresql 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. --- diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index d47d0d916b..92adc4e9fe 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.