]> granicus.if.org Git - postgresql/commitdiff
Reset minRecoveryPoint at checkpoints, so that we don't uselessly update
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Wed, 30 Dec 2009 08:37:21 +0000 (08:37 +0000)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
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 b861a76ee4f077499b77ea0a2081f391c93dae01..e1bfad56402a9575e26d45c3061fe15da5092aca 100644 (file)
@@ -7,7 +7,7 @@
  * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- * $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.354 2009/12/19 01:32:33 sriggs Exp $
+ * $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.355 2009/12/30 08:37:21 heikki Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -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);