mirror of
https://github.com/postgres/postgres.git
synced 2025-04-25 21:42:33 +03:00
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
This commit is contained in:
parent
4741e9afb9
commit
7a5c9ca93a
@ -6227,11 +6227,14 @@ StartupXLOG(void)
|
|||||||
ereport(PANIC,
|
ereport(PANIC,
|
||||||
(errmsg("invalid next transaction ID")));
|
(errmsg("invalid next transaction ID")));
|
||||||
|
|
||||||
|
/* initialize shared memory variables from the checkpoint record */
|
||||||
ShmemVariableCache->nextXid = checkPoint.nextXid;
|
ShmemVariableCache->nextXid = checkPoint.nextXid;
|
||||||
ShmemVariableCache->nextOid = checkPoint.nextOid;
|
ShmemVariableCache->nextOid = checkPoint.nextOid;
|
||||||
ShmemVariableCache->oidCount = 0;
|
ShmemVariableCache->oidCount = 0;
|
||||||
MultiXactSetNextMXact(checkPoint.nextMulti, checkPoint.nextMultiOffset);
|
MultiXactSetNextMXact(checkPoint.nextMulti, checkPoint.nextMultiOffset);
|
||||||
SetTransactionIdLimit(checkPoint.oldestXid, checkPoint.oldestXidDB);
|
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
|
* We must replay WAL entries using the same TimeLineID they were created
|
||||||
@ -6330,10 +6333,6 @@ StartupXLOG(void)
|
|||||||
/* No need to hold ControlFileLock yet, we aren't up far enough */
|
/* No need to hold ControlFileLock yet, we aren't up far enough */
|
||||||
UpdateControlFile();
|
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 */
|
/* initialize our local copy of minRecoveryPoint */
|
||||||
minRecoveryPoint = ControlFile->minRecoveryPoint;
|
minRecoveryPoint = ControlFile->minRecoveryPoint;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user