aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2012-06-29 19:19:29 +0300
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2012-06-29 19:23:04 +0300
commit214fa27e9296fa74955a0682a8bea4d6d42c4b13 (patch)
tree8a0b9ce9250ccb9cc0d63077d83d8dc63791d5b9 /src
parent90c85e473bd807171b5b5da4032bbf9c0abe1103 (diff)
downloadpostgresql-214fa27e9296fa74955a0682a8bea4d6d42c4b13.tar.gz
postgresql-214fa27e9296fa74955a0682a8bea4d6d42c4b13.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
Diffstat (limited to 'src')
-rw-r--r--src/backend/access/transam/xlog.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index 0d68760e812..ca17319c8c8 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -6249,11 +6249,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
@@ -6352,10 +6355,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;