8000 Initialize shared memory copy of ckptXidEpoch correctly when not in r… · lhcezar/postgres@b6fe2df · GitHub
[go: up one dir, main page]

Skip to content

Commit b6fe2df

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 3ac860f commit b6fe2df

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
@@ -6252,11 +6252,14 @@ StartupXLOG(void)
62526252
ereport(PANIC,
62536253
(errmsg("invalid next transaction ID")));
62546254

6255+
/* initialize shared memory variables from the checkpoint record */
62556256
ShmemVariableCache->nextXid = checkPoint.nextXid;
62566257
ShmemVariableCache->nextOid = checkPoint.nextOid;
62576258
ShmemVariableCache->oidCount = 0;
62586259
MultiXactSetNextMXact(checkPoint.nextMulti, checkPoint.nextMultiOffset);
62596260
SetTransactionIdLimit(checkPoint.oldestXid, checkPoint.oldestXidDB);
6261+
XLogCtl->ckptXidEpoch = checkPoint.nextXidEpoch;
6262+
XLogCtl->ckptXid = checkPoint.nextXid;
62606263

62616264
/*
62626265
* We must replay WAL entries using the same TimeLineID they were created
@@ -6340,10 +6343,6 @@ StartupXLOG(void)
63406343
/* No need to hold ControlFileLock yet, we aren't up far enough */
63416344
UpdateControlFile();
63426345

6343-
/* initialize shared-memory copy of latest checkpoint XID/epoch */
6344-
XLogCtl->ckptXidEpoch = ControlFile->checkPointCopy.nextXidEpoch;
6345-
XLogCtl->ckptXid = ControlFile->checkPointCopy.nextXid;
6346-
63476346
/* initialize our local copy of minRecoveryPoint */
63486347
minRecoveryPoint = ControlFile->minRecoveryPoint;
63496348

0 commit comments

Comments
 (0)
0