Skip to content

Commit 43f4008

Browse files
committed
Init DistributedLog vars
1 parent 824be0d commit 43f4008

File tree

1 file changed

+9
-0
lines changed
  • src/backend/access/transam

1 file changed

+9
-0
lines changed

src/backend/access/transam/xlog.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7205,6 +7205,15 @@ StartupXLOG(void)
72057205
/* Tell procarray about the range of xids it has to deal with */
72067206
ProcArrayInitRecovery(ShmemVariableCache->nextXid);
72077207

7208+
/* also initialize latestCompletedXid, to nextXid - 1 */
7209+
LWLockAcquire(ProcArrayLock, LW_EXCLUSIVE);
7210+
ShmemVariableCache->latestCompletedXid = ShmemVariableCache->nextXid;
7211+
TransactionIdRetreat(ShmemVariableCache->latestCompletedXid);
7212+
elog(LOG, "latest completed transaction id is %u and next transaction id is %u",
7213+
ShmemVariableCache->latestCompletedXid,
7214+
ShmemVariableCache->nextXid);
7215+
LWLockRelease(ProcArrayLock);
7216+
72087217
/*
72097218
* Startup commit log and subtrans only. MultiXact has already
72107219
* been started up and other SLRUs are not maintained during

0 commit comments

Comments
 (0)