Skip to content

Commit 214fa27

Browse files
committed
Initialize shared memory copy of ckptXidEpoch correctly when not in recovery.
This bug was introduced by commit 20d98ab, so backpatch this to 9.0-9.2 like that one. This fixes bug #6710, reported by Tarvi Pillessaar
1 parent 90c85e4 commit 214fa27

File tree

1 file changed

+3
-4
lines changed
  • src/backend/access/transam

1 file changed

+3
-4
lines changed

src/backend/access/transam/xlog.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6249,11 +6249,14 @@ StartupXLOG(void)
62496249
ereport(PANIC,
62506250
(errmsg("invalid next transaction ID")));
62516251

6252+
/* initialize shared memory variables from the checkpoint record */
62526253
ShmemVariableCache->nextXid = checkPoint.nextXid;
62536254
ShmemVariableCache->nextOid = checkPoint.nextOid;
62546255
ShmemVariableCache->oidCount = 0;
62556256
MultiXactSetNextMXact(checkPoint.nextMulti, checkPoint.nextMultiOffset);
62566257
SetTransactionIdLimit(checkPoint.oldestXid, checkPoint.oldestXidDB);
6258+
XLogCtl->ckptXidEpoch = checkPoint.nextXidEpoch;
6259+
XLogCtl->ckptXid = checkPoint.nextXid;
62576260

62586261
/*
62596262
* We must replay WAL entries using the same TimeLineID they were created
@@ -6352,10 +6355,6 @@ StartupXLOG(void)
63526355
/* No need to hold ControlFileLock yet, we aren't up far enough */
63536356
UpdateControlFile();
63546357

6355-
/* initialize shared-memory copy of latest checkpoint XID/epoch */
6356-
XLogCtl->ckptXidEpoch = ControlFile->checkPointCopy.nextXidEpoch;
6357-
XLogCtl->ckptXid = ControlFile->checkPointCopy.nextXid;
6358-
63596358
/* initialize our local copy of minRecoveryPoint */
63606359
minRecoveryPoint = ControlFile->minRecoveryPoint;
63616360

0 commit comments

Comments
 (0)