summaryrefslogtreecommitdiff
path: root/src/backend/access/transam
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2002-09-30 19:55:08 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2002-09-30 19:55:08 +0000
commitc80d09f1237a4564e4314842c8bb02e325239648 (patch)
tree903bdbb7b8b65e816439732fb4101f579be7e59c /src/backend/access/transam
parenta829ad15707b06d1e79657b2e8b3e63fd7fe4e11 (diff)
downloadpostgresql-c80d09f1237a4564e4314842c8bb02e325239648.tar.gz
Back-patch fix to ensure a checkpoint occurs before truncating CLOG,
even if no recent WAL activity has occurred.
Diffstat (limited to 'src/backend/access/transam')
-rw-r--r--src/backend/access/transam/clog.c6
-rw-r--r--src/backend/access/transam/xlog.c10
2 files changed, 8 insertions, 8 deletions
diff --git a/src/backend/access/transam/clog.c b/src/backend/access/transam/clog.c
index 7f38b47d76..fb7552d229 100644
--- a/src/backend/access/transam/clog.c
+++ b/src/backend/access/transam/clog.c
@@ -13,7 +13,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Header: /cvsroot/pgsql/src/backend/access/transam/clog.c,v 1.7 2001/10/28 06:25:42 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/transam/clog.c,v 1.7.2.1 2002/09/30 19:55:08 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -810,8 +810,8 @@ TruncateCLOG(TransactionId oldestXact)
if (!ScanCLOGDirectory(cutoffPage, false))
return; /* nothing to remove */
- /* Perform a CHECKPOINT */
- CreateCheckPoint(false);
+ /* Perform a forced CHECKPOINT */
+ CreateCheckPoint(false, true);
/*
* Scan CLOG shared memory and remove any pages preceding the cutoff
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index a964a339f1..77e1f0a936 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Header: /cvsroot/pgsql/src/backend/access/transam/xlog.c,v 1.86.2.1 2002/03/15 19:20:43 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/transam/xlog.c,v 1.86.2.2 2002/09/30 19:55:08 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -2737,7 +2737,7 @@ StartupXLOG(void)
* checkpoint to become prevCheckPoint...
*/
ControlFile->checkPoint = checkPointLoc;
- CreateCheckPoint(true);
+ CreateCheckPoint(true, true);
XLogCloseRelationCache();
}
@@ -2894,7 +2894,7 @@ ShutdownXLOG(void)
CritSectionCount++;
CreateDummyCaches();
- CreateCheckPoint(true);
+ CreateCheckPoint(true, true);
ShutdownCLOG();
CritSectionCount--;
@@ -2905,7 +2905,7 @@ ShutdownXLOG(void)
* Perform a checkpoint --- either during shutdown, or on-the-fly
*/
void
-CreateCheckPoint(bool shutdown)
+CreateCheckPoint(bool shutdown, bool force)
{
CheckPoint checkPoint;
XLogRecPtr recptr;
@@ -2962,7 +2962,7 @@ CreateCheckPoint(bool shutdown)
* match the end of the last checkpoint record, and its redo pointer
* must point to itself.
*/
- if (!shutdown)
+ if (!shutdown && !force)
{
XLogRecPtr curInsert;