mirror of
https://github.com/postgres/postgres.git
synced 2025-06-29 10:41:53 +03:00
Track latest completed xid as a FullTransactionId.
The reason for doing so is that a subsequent commit will need that to avoid wraparound issues. As the subsequent change is large this was split out for easier review. The reason this is not a perfect straight-forward change is that we do not want track 64bit xids in the procarray or the WAL. Therefore we need to advance lastestCompletedXid in relation to 32 bit xids. The code for that is now centralized in MaintainLatestCompletedXid*. Author: Andres Freund Reviewed-By: Thomas Munro, Robert Haas, David Rowley Discussion: https://postgr.es/m/20200301083601.ews6hz5dduc3w2se@alap3.anarazel.de
This commit is contained in:
@ -7865,8 +7865,8 @@ StartupXLOG(void)
|
||||
|
||||
/* also initialize latestCompletedXid, to nextXid - 1 */
|
||||
LWLockAcquire(ProcArrayLock, LW_EXCLUSIVE);
|
||||
ShmemVariableCache->latestCompletedXid = XidFromFullTransactionId(ShmemVariableCache->nextXid);
|
||||
TransactionIdRetreat(ShmemVariableCache->latestCompletedXid);
|
||||
ShmemVariableCache->latestCompletedXid = ShmemVariableCache->nextXid;
|
||||
FullTransactionIdRetreat(&ShmemVariableCache->latestCompletedXid);
|
||||
LWLockRelease(ProcArrayLock);
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user