diff options
author | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2012-06-29 19:19:29 +0300 |
---|---|---|
committer | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2012-06-29 19:23:16 +0300 |
commit | b6fe2dfda004e28f806c2424fff13063f8532d68 (patch) | |
tree | 41303426a6a0aef9405212eac12f462ac58878b3 | |
parent | 3ac860f6b33ffa0733d4d013718c5f408282fcb6 (diff) | |
download | postgresql-b6fe2dfda004e28f806c2424fff13063f8532d68.tar.gz postgresql-b6fe2dfda004e28f806c2424fff13063f8532d68.zip |
Initialize shared memory copy of ckptXidEpoch correctly when not in recovery.
This bug was introduced by commit 20d98ab6e4110087d1816cd105a40fcc8ce0a307,
so backpatch this to 9.0-9.2 like that one.
This fixes bug #6710, reported by Tarvi Pillessaar
-rw-r--r-- | src/backend/access/transam/xlog.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index 89889937465..1612f44e4ec 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -6252,11 +6252,14 @@ StartupXLOG(void) ereport(PANIC, (errmsg("invalid next transaction ID"))); + /* initialize shared memory variables from the checkpoint record */ ShmemVariableCache->nextXid = checkPoint.nextXid; ShmemVariableCache->nextOid = checkPoint.nextOid; ShmemVariableCache->oidCount = 0; MultiXactSetNextMXact(checkPoint.nextMulti, checkPoint.nextMultiOffset); SetTransactionIdLimit(checkPoint.oldestXid, checkPoint.oldestXidDB); + XLogCtl->ckptXidEpoch = checkPoint.nextXidEpoch; + XLogCtl->ckptXid = checkPoint.nextXid; /* * We must replay WAL entries using the same TimeLineID they were created @@ -6340,10 +6343,6 @@ StartupXLOG(void) /* No need to hold ControlFileLock yet, we aren't up far enough */ UpdateControlFile(); - /* initialize shared-memory copy of latest checkpoint XID/epoch */ - XLogCtl->ckptXidEpoch = ControlFile->checkPointCopy.nextXidEpoch; - XLogCtl->ckptXid = ControlFile->checkPointCopy.nextXid; - /* initialize our local copy of minRecoveryPoint */ minRecoveryPoint = ControlFile->minRecoveryPoint; |