Reset minRecoveryPoint at checkpoints, so that we don't uselessly update
authorHeikki Linnakangas <[email protected]>
Wed, 30 Dec 2009 08:37:21 +0000 (08:37 +0000)
committerHeikki Linnakangas <[email protected]>
Wed, 30 Dec 2009 08:37:21 +0000 (08:37 +0000)
it in the control file at crash recovery following an archive recovery.

Per Fujii Masao and subsequent discussion.

src/backend/access/transam/xlog.c

index 783725cc253955221cc519afa4e53138ca098dbd..dacae2bdc475e20f68a025c34288c25f0a42cc08 100644 (file)
@@ -6882,6 +6882,8 @@ CreateCheckPoint(int flags)
    ControlFile->checkPoint = ProcLastRecPtr;
    ControlFile->checkPointCopy = checkPoint;
    ControlFile->time = (pg_time_t) time(NULL);
+   /* crash recovery should always recover to the end of WAL */
+   MemSet(&ControlFile->minRecoveryPoint, 0, sizeof(XLogRecPtr));
    UpdateControlFile();
    LWLockRelease(ControlFileLock);