postgres.git / summary / log / commit / refs

commit    6c4f6664b201bea77eb6e3f813559e3911a5ef35
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 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index 29d1f960c14..d960bbcc208 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -5265,6 +5265,15 @@ StartupXLOG(void) ControlFile->prevCheckPoint = ControlFile->checkPoint; ControlFile->checkPoint = checkPointLoc; ControlFile->checkPointCopy = checkPoint; + if (InArchiveRecovery) + { + /* initialize minRecoveryPoint if not set yet */ + if (ControlFile->minRecoveryPoint < checkPoint.redo) + { + ControlFile->minRecoveryPoint = checkPoint.redo; + ControlFile->minRecoveryPointTLI = checkPoint.ThisTimeLineID; + } + } /* * Set backupStartPoint if we're starting recovery from a base backup. [parent: 6d0604949386]