Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 7a5c9ca

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 4741e9a commit 7a5c9ca

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
@@ -6227,11 +6227,14 @@ StartupXLOG(void)
62276227
ereport(PANIC,
62286228
(errmsg("invalid next transaction ID")));
62296229

6230+
/* initialize shared memory variables from the checkpoint record */
62306231
ShmemVariableCache->nextXid = checkPoint.nextXid;
62316232
ShmemVariableCache->nextOid = checkPoint.nextOid;
62326233
ShmemVariableCache->oidCount = 0;
62336234
MultiXactSetNextMXact(checkPoint.nextMulti, checkPoint.nextMultiOffset);
62346235
SetTransactionIdLimit(checkPoint.oldestXid, checkPoint.oldestXidDB);
6236+
XLogCtl->ckptXidEpoch = checkPoint.nextXidEpoch;
6237+
XLogCtl->ckptXid = checkPoint.nextXid;
62356238

62366239
/*
62376240
* We must replay WAL entries using the same TimeLineID they were created
@@ -6330,10 +6333,6 @@ StartupXLOG(void)
63306333
/* No need to hold ControlFileLock yet, we aren't up far enough */
63316334
UpdateControlFile();
63326335

6333-
/* initialize shared-memory copy of latest checkpoint XID/epoch */
6334-
XLogCtl->ckptXidEpoch = ControlFile->checkPointCopy.nextXidEpoch;
6335-
XLogCtl->ckptXid = ControlFile->checkPointCopy.nextXid;
6336-
63376336
/* initialize our local copy of minRecoveryPoint */
63386337
minRecoveryPoint = ControlFile->minRecoveryPoint;
63396338

0 commit comments

Comments
 (0)