Rename VariableCacheData.nextFullXid to nextXid.

Including Full in variable names duplicates the type information and
leads to overly long names. As FullTransactionId cannot accidentally
be casted to TransactionId that does not seem necessary.

Author: Andres Freund
Discussion: https://postgr.es/m/20200724011143.jccsyvsvymuiqfxu@alap3.anarazel.de
This commit is contained in:
Andres Freund 2020-08-11 11:25:23 -07:00
parent 1f75b45413
commit fea10a6434
21 changed files with 96 additions and 96 deletions

View File

@ -396,7 +396,7 @@ gistRedoPageReuse(XLogReaderState *record)
if (InHotStandby)
{
FullTransactionId latestRemovedFullXid = xlrec->latestRemovedFullXid;
FullTransactionId nextFullXid = ReadNextFullTransactionId();
FullTransactionId nextXid = ReadNextFullTransactionId();
uint64 diff;
/*
@ -405,8 +405,8 @@ gistRedoPageReuse(XLogReaderState *record)
* logged value is very old, so that XID wrap-around already happened
* on it, there can't be any snapshots that still see it.
*/
nextFullXid = ReadNextFullTransactionId();
diff = U64FromFullTransactionId(nextFullXid) -
nextXid = ReadNextFullTransactionId();
diff = U64FromFullTransactionId(nextXid) -
U64FromFullTransactionId(latestRemovedFullXid);
if (diff < MaxTransactionId / 2)
{

View File

@ -53,8 +53,8 @@ xlog_desc(StringInfo buf, XLogReaderState *record)
checkpoint->ThisTimeLineID,
checkpoint->PrevTimeLineID,
checkpoint->fullPageWrites ? "true" : "false",
EpochFromFullTransactionId(checkpoint->nextFullXid),
XidFromFullTransactionId(checkpoint->nextFullXid),
EpochFromFullTransactionId(checkpoint->nextXid),
XidFromFullTransactionId(checkpoint->nextXid),
checkpoint->nextOid,
checkpoint->nextMulti,
checkpoint->nextMultiOffset,

View File

@ -742,12 +742,12 @@ ZeroCLOGPage(int pageno, bool writeXlog)
/*
* This must be called ONCE during postmaster or standalone-backend startup,
* after StartupXLOG has initialized ShmemVariableCache->nextFullXid.
* after StartupXLOG has initialized ShmemVariableCache->nextXid.
*/
void
StartupCLOG(void)
{
TransactionId xid = XidFromFullTransactionId(ShmemVariableCache->nextFullXid);
TransactionId xid = XidFromFullTransactionId(ShmemVariableCache->nextXid);
int pageno = TransactionIdToPage(xid);
LWLockAcquire(XactSLRULock, LW_EXCLUSIVE);
@ -766,7 +766,7 @@ StartupCLOG(void)
void
TrimCLOG(void)
{
TransactionId xid = XidFromFullTransactionId(ShmemVariableCache->nextFullXid);
TransactionId xid = XidFromFullTransactionId(ShmemVariableCache->nextXid);
int pageno = TransactionIdToPage(xid);
LWLockAcquire(XactSLRULock, LW_EXCLUSIVE);
@ -785,7 +785,7 @@ TrimCLOG(void)
* but makes no WAL entry). Let's just be safe. (We need not worry about
* pages beyond the current one, since those will be zeroed when first
* used. For the same reason, there is no need to do anything when
* nextFullXid is exactly at a page boundary; and it's likely that the
* nextXid is exactly at a page boundary; and it's likely that the
* "current" page doesn't exist yet in that case.)
*/
if (TransactionIdToPgIndex(xid) != 0)

View File

@ -614,7 +614,7 @@ ZeroCommitTsPage(int pageno, bool writeXlog)
/*
* This must be called ONCE during postmaster or standalone-backend startup,
* after StartupXLOG has initialized ShmemVariableCache->nextFullXid.
* after StartupXLOG has initialized ShmemVariableCache->nextXid.
*/
void
StartupCommitTs(void)
@ -704,7 +704,7 @@ ActivateCommitTs(void)
}
LWLockRelease(CommitTsLock);
xid = XidFromFullTransactionId(ShmemVariableCache->nextFullXid);
xid = XidFromFullTransactionId(ShmemVariableCache->nextXid);
pageno = TransactionIdToCTsPage(xid);
/*

View File

@ -3265,7 +3265,7 @@ multixact_redo(XLogReaderState *record)
xlrec->moff + xlrec->nmembers);
/*
* Make sure nextFullXid is beyond any XID mentioned in the record.
* Make sure nextXid is beyond any XID mentioned in the record.
* This should be unnecessary, since any XID found here ought to have
* other evidence in the XLOG, but let's be safe.
*/

View File

@ -241,15 +241,15 @@ ZeroSUBTRANSPage(int pageno)
/*
* This must be called ONCE during postmaster or standalone-backend startup,
* after StartupXLOG has initialized ShmemVariableCache->nextFullXid.
* after StartupXLOG has initialized ShmemVariableCache->nextXid.
*
* oldestActiveXID is the oldest XID of any prepared transaction, or nextFullXid
* oldestActiveXID is the oldest XID of any prepared transaction, or nextXid
* if there are none.
*/
void
StartupSUBTRANS(TransactionId oldestActiveXID)
{
FullTransactionId nextFullXid;
FullTransactionId nextXid;
int startPage;
int endPage;
@ -262,8 +262,8 @@ StartupSUBTRANS(TransactionId oldestActiveXID)
LWLockAcquire(SubtransSLRULock, LW_EXCLUSIVE);
startPage = TransactionIdToPage(oldestActiveXID);
nextFullXid = ShmemVariableCache->nextFullXid;
endPage = TransactionIdToPage(XidFromFullTransactionId(nextFullXid));
nextXid = ShmemVariableCache->nextXid;
endPage = TransactionIdToPage(XidFromFullTransactionId(nextXid));
while (startPage != endPage)
{

View File

@ -1813,16 +1813,16 @@ restoreTwoPhaseData(void)
*
* Scan the shared memory entries of TwoPhaseState and determine the range
* of valid XIDs present. This is run during database startup, after we
* have completed reading WAL. ShmemVariableCache->nextFullXid has been set to
* have completed reading WAL. ShmemVariableCache->nextXid has been set to
* one more than the highest XID for which evidence exists in WAL.
*
* We throw away any prepared xacts with main XID beyond nextFullXid --- if any
* We throw away any prepared xacts with main XID beyond nextXid --- if any
* are present, it suggests that the DBA has done a PITR recovery to an
* earlier point in time without cleaning out pg_twophase. We dare not
* try to recover such prepared xacts since they likely depend on database
* state that doesn't exist now.
*
* However, we will advance nextFullXid beyond any subxact XIDs belonging to
* However, we will advance nextXid beyond any subxact XIDs belonging to
* valid prepared xacts. We need to do this since subxact commit doesn't
* write a WAL entry, and so there might be no evidence in WAL of those
* subxact XIDs.
@ -1832,7 +1832,7 @@ restoreTwoPhaseData(void)
* backup should be rolled in.
*
* Our other responsibility is to determine and return the oldest valid XID
* among the prepared xacts (if none, return ShmemVariableCache->nextFullXid).
* among the prepared xacts (if none, return ShmemVariableCache->nextXid).
* This is needed to synchronize pg_subtrans startup properly.
*
* If xids_p and nxids_p are not NULL, pointer to a palloc'd array of all
@ -1842,8 +1842,8 @@ restoreTwoPhaseData(void)
TransactionId
PrescanPreparedTransactions(TransactionId **xids_p, int *nxids_p)
{
FullTransactionId nextFullXid = ShmemVariableCache->nextFullXid;
TransactionId origNextXid = XidFromFullTransactionId(nextFullXid);
FullTransactionId nextXid = ShmemVariableCache->nextXid;
TransactionId origNextXid = XidFromFullTransactionId(nextXid);
TransactionId result = origNextXid;
TransactionId *xids = NULL;
int nxids = 0;
@ -2059,7 +2059,7 @@ RecoverPreparedTransactions(void)
*
* If setParent is true, set up subtransaction parent linkages.
*
* If setNextXid is true, set ShmemVariableCache->nextFullXid to the newest
* If setNextXid is true, set ShmemVariableCache->nextXid to the newest
* value scanned.
*/
static char *
@ -2068,8 +2068,8 @@ ProcessTwoPhaseBuffer(TransactionId xid,
bool fromdisk,
bool setParent, bool setNextXid)
{
FullTransactionId nextFullXid = ShmemVariableCache->nextFullXid;
TransactionId origNextXid = XidFromFullTransactionId(nextFullXid);
FullTransactionId nextXid = ShmemVariableCache->nextXid;
TransactionId origNextXid = XidFromFullTransactionId(nextXid);
TransactionId *subxids;
char *buf;
TwoPhaseFileHeader *hdr;
@ -2149,7 +2149,7 @@ ProcessTwoPhaseBuffer(TransactionId xid,
/*
* Examine subtransaction XIDs ... they should all follow main XID, and
* they may force us to advance nextFullXid.
* they may force us to advance nextXid.
*/
subxids = (TransactionId *) (buf +
MAXALIGN(sizeof(TwoPhaseFileHeader)) +
@ -2160,7 +2160,7 @@ ProcessTwoPhaseBuffer(TransactionId xid,
Assert(TransactionIdFollows(subxid, xid));
/* update nextFullXid if needed */
/* update nextXid if needed */
if (setNextXid)
AdvanceNextFullTransactionIdPastXid(subxid);

View File

@ -75,7 +75,7 @@ GetNewTransactionId(bool isSubXact)
LWLockAcquire(XidGenLock, LW_EXCLUSIVE);
full_xid = ShmemVariableCache->nextFullXid;
full_xid = ShmemVariableCache->nextXid;
xid = XidFromFullTransactionId(full_xid);
/*----------
@ -159,7 +159,7 @@ GetNewTransactionId(bool isSubXact)
/* Re-acquire lock and start over */
LWLockAcquire(XidGenLock, LW_EXCLUSIVE);
full_xid = ShmemVariableCache->nextFullXid;
full_xid = ShmemVariableCache->nextXid;
xid = XidFromFullTransactionId(full_xid);
}
@ -177,12 +177,12 @@ GetNewTransactionId(bool isSubXact)
ExtendSUBTRANS(xid);
/*
* Now advance the nextFullXid counter. This must not happen until after
* Now advance the nextXid counter. This must not happen until after
* we have successfully completed ExtendCLOG() --- if that routine fails,
* we want the next incoming transaction to try it again. We cannot
* assign more XIDs until there is CLOG space for them.
*/
FullTransactionIdAdvance(&ShmemVariableCache->nextFullXid);
FullTransactionIdAdvance(&ShmemVariableCache->nextXid);
/*
* We must store the new XID into the shared ProcArray before releasing
@ -240,7 +240,7 @@ GetNewTransactionId(bool isSubXact)
}
/*
* Read nextFullXid but don't allocate it.
* Read nextXid but don't allocate it.
*/
FullTransactionId
ReadNextFullTransactionId(void)
@ -248,14 +248,14 @@ ReadNextFullTransactionId(void)
FullTransactionId fullXid;
LWLockAcquire(XidGenLock, LW_SHARED);
fullXid = ShmemVariableCache->nextFullXid;
fullXid = ShmemVariableCache->nextXid;
LWLockRelease(XidGenLock);
return fullXid;
}
/*
* Advance nextFullXid to the value after a given xid. The epoch is inferred.
* Advance nextXid to the value after a given xid. The epoch is inferred.
* This must only be called during recovery or from two-phase start-up code.
*/
void
@ -266,14 +266,14 @@ AdvanceNextFullTransactionIdPastXid(TransactionId xid)
uint32 epoch;
/*
* It is safe to read nextFullXid without a lock, because this is only
* It is safe to read nextXid without a lock, because this is only
* called from the startup process or single-process mode, meaning that no
* other process can modify it.
*/
Assert(AmStartupProcess() || !IsUnderPostmaster);
/* Fast return if this isn't an xid high enough to move the needle. */
next_xid = XidFromFullTransactionId(ShmemVariableCache->nextFullXid);
next_xid = XidFromFullTransactionId(ShmemVariableCache->nextXid);
if (!TransactionIdFollowsOrEquals(xid, next_xid))
return;
@ -286,7 +286,7 @@ AdvanceNextFullTransactionIdPastXid(TransactionId xid)
* point in the WAL stream.
*/
TransactionIdAdvance(xid);
epoch = EpochFromFullTransactionId(ShmemVariableCache->nextFullXid);
epoch = EpochFromFullTransactionId(ShmemVariableCache->nextXid);
if (unlikely(xid < next_xid))
++epoch;
newNextFullXid = FullTransactionIdFromEpochAndXid(epoch, xid);
@ -296,7 +296,7 @@ AdvanceNextFullTransactionIdPastXid(TransactionId xid)
* concurrent readers.
*/
LWLockAcquire(XidGenLock, LW_EXCLUSIVE);
ShmemVariableCache->nextFullXid = newNextFullXid;
ShmemVariableCache->nextXid = newNextFullXid;
LWLockRelease(XidGenLock);
}
@ -404,7 +404,7 @@ SetTransactionIdLimit(TransactionId oldest_datfrozenxid, Oid oldest_datoid)
ShmemVariableCache->xidStopLimit = xidStopLimit;
ShmemVariableCache->xidWrapLimit = xidWrapLimit;
ShmemVariableCache->oldestXidDB = oldest_datoid;
curXid = XidFromFullTransactionId(ShmemVariableCache->nextFullXid);
curXid = XidFromFullTransactionId(ShmemVariableCache->nextXid);
LWLockRelease(XidGenLock);
/* Log the info */
@ -480,7 +480,7 @@ ForceTransactionIdLimitUpdate(void)
/* Locking is probably not really necessary, but let's be careful */
LWLockAcquire(XidGenLock, LW_SHARED);
nextXid = XidFromFullTransactionId(ShmemVariableCache->nextFullXid);
nextXid = XidFromFullTransactionId(ShmemVariableCache->nextXid);
xidVacLimit = ShmemVariableCache->xidVacLimit;
oldestXid = ShmemVariableCache->oldestXid;
oldestXidDB = ShmemVariableCache->oldestXidDB;

View File

@ -5791,7 +5791,7 @@ xact_redo_commit(xl_xact_parsed_commit *parsed,
max_xid = TransactionIdLatest(xid, parsed->nsubxacts, parsed->subxacts);
/* Make sure nextFullXid is beyond any XID mentioned in the record. */
/* Make sure nextXid is beyond any XID mentioned in the record. */
AdvanceNextFullTransactionIdPastXid(max_xid);
Assert(((parsed->xinfo & XACT_XINFO_HAS_ORIGIN) == 0) ==
@ -5931,7 +5931,7 @@ xact_redo_abort(xl_xact_parsed_abort *parsed, TransactionId xid)
Assert(TransactionIdIsValid(xid));
/* Make sure nextFullXid is beyond any XID mentioned in the record. */
/* Make sure nextXid is beyond any XID mentioned in the record. */
max_xid = TransactionIdLatest(xid,
parsed->nsubxacts,
parsed->subxacts);

View File

@ -601,7 +601,7 @@ typedef struct XLogCtlData
/* Protected by info_lck: */
XLogwrtRqst LogwrtRqst;
XLogRecPtr RedoRecPtr; /* a recent copy of Insert->RedoRecPtr */
FullTransactionId ckptFullXid; /* nextFullXid of latest checkpoint */
FullTransactionId ckptFullXid; /* nextXid of latest checkpoint */
XLogRecPtr asyncXactLSN; /* LSN of newest async commit/abort */
XLogRecPtr replicationSlotMinLSN; /* oldest LSN needed by any slot */
@ -5239,7 +5239,7 @@ BootStrapXLOG(void)
checkPoint.ThisTimeLineID = ThisTimeLineID;
checkPoint.PrevTimeLineID = ThisTimeLineID;
checkPoint.fullPageWrites = fullPageWrites;
checkPoint.nextFullXid =
checkPoint.nextXid =
FullTransactionIdFromEpochAndXid(0, FirstNormalTransactionId);
checkPoint.nextOid = FirstBootstrapObjectId;
checkPoint.nextMulti = FirstMultiXactId;
@ -5253,7 +5253,7 @@ BootStrapXLOG(void)
checkPoint.time = (pg_time_t) time(NULL);
checkPoint.oldestActiveXid = InvalidTransactionId;
ShmemVariableCache->nextFullXid = checkPoint.nextFullXid;
ShmemVariableCache->nextXid = checkPoint.nextXid;
ShmemVariableCache->nextOid = checkPoint.nextOid;
ShmemVariableCache->oidCount = 0;
MultiXactSetNextMXact(checkPoint.nextMulti, checkPoint.nextMultiOffset);
@ -6741,7 +6741,7 @@ StartupXLOG(void)
wasShutdown ? "true" : "false")));
ereport(DEBUG1,
(errmsg_internal("next transaction ID: " UINT64_FORMAT "; next OID: %u",
U64FromFullTransactionId(checkPoint.nextFullXid),
U64FromFullTransactionId(checkPoint.nextXid),
checkPoint.nextOid)));
ereport(DEBUG1,
(errmsg_internal("next MultiXactId: %u; next MultiXactOffset: %u",
@ -6756,12 +6756,12 @@ StartupXLOG(void)
(errmsg_internal("commit timestamp Xid oldest/newest: %u/%u",
checkPoint.oldestCommitTsXid,
checkPoint.newestCommitTsXid)));
if (!TransactionIdIsNormal(XidFromFullTransactionId(checkPoint.nextFullXid)))
if (!TransactionIdIsNormal(XidFromFullTransactionId(checkPoint.nextXid)))
ereport(PANIC,
(errmsg("invalid next transaction ID")));
/* initialize shared memory variables from the checkpoint record */
ShmemVariableCache->nextFullXid = checkPoint.nextFullXid;
ShmemVariableCache->nextXid = checkPoint.nextXid;
ShmemVariableCache->nextOid = checkPoint.nextOid;
ShmemVariableCache->oidCount = 0;
MultiXactSetNextMXact(checkPoint.nextMulti, checkPoint.nextMultiOffset);
@ -6770,7 +6770,7 @@ StartupXLOG(void)
SetMultiXactIdLimit(checkPoint.oldestMulti, checkPoint.oldestMultiDB, true);
SetCommitTsLimit(checkPoint.oldestCommitTsXid,
checkPoint.newestCommitTsXid);
XLogCtl->ckptFullXid = checkPoint.nextFullXid;
XLogCtl->ckptFullXid = checkPoint.nextXid;
/*
* Initialize replication slots, before there's a chance to remove
@ -7051,7 +7051,7 @@ StartupXLOG(void)
Assert(TransactionIdIsValid(oldestActiveXID));
/* Tell procarray about the range of xids it has to deal with */
ProcArrayInitRecovery(XidFromFullTransactionId(ShmemVariableCache->nextFullXid));
ProcArrayInitRecovery(XidFromFullTransactionId(ShmemVariableCache->nextXid));
/*
* Startup commit log and subtrans only. MultiXact and commit
@ -7081,9 +7081,9 @@ StartupXLOG(void)
running.xcnt = nxids;
running.subxcnt = 0;
running.subxid_overflow = false;
running.nextXid = XidFromFullTransactionId(checkPoint.nextFullXid);
running.nextXid = XidFromFullTransactionId(checkPoint.nextXid);
running.oldestRunningXid = oldestActiveXID;
latestCompletedXid = XidFromFullTransactionId(checkPoint.nextFullXid);
latestCompletedXid = XidFromFullTransactionId(checkPoint.nextXid);
TransactionIdRetreat(latestCompletedXid);
Assert(TransactionIdIsNormal(latestCompletedXid));
running.latestCompletedXid = latestCompletedXid;
@ -7254,7 +7254,7 @@ StartupXLOG(void)
error_context_stack = &errcallback;
/*
* ShmemVariableCache->nextFullXid must be beyond record's
* ShmemVariableCache->nextXid must be beyond record's
* xid.
*/
AdvanceNextFullTransactionIdPastXid(record->xl_xid);
@ -7865,7 +7865,7 @@ StartupXLOG(void)
/* also initialize latestCompletedXid, to nextXid - 1 */
LWLockAcquire(ProcArrayLock, LW_EXCLUSIVE);
ShmemVariableCache->latestCompletedXid = XidFromFullTransactionId(ShmemVariableCache->nextFullXid);
ShmemVariableCache->latestCompletedXid = XidFromFullTransactionId(ShmemVariableCache->nextXid);
TransactionIdRetreat(ShmemVariableCache->latestCompletedXid);
LWLockRelease(ProcArrayLock);
@ -8897,7 +8897,7 @@ CreateCheckPoint(int flags)
* there.
*/
LWLockAcquire(XidGenLock, LW_SHARED);
checkPoint.nextFullXid = ShmemVariableCache->nextFullXid;
checkPoint.nextXid = ShmemVariableCache->nextXid;
checkPoint.oldestXid = ShmemVariableCache->oldestXid;
checkPoint.oldestXidDB = ShmemVariableCache->oldestXidDB;
LWLockRelease(XidGenLock);
@ -9050,7 +9050,7 @@ CreateCheckPoint(int flags)
/* Update shared-memory copy of checkpoint XID/epoch */
SpinLockAcquire(&XLogCtl->info_lck);
XLogCtl->ckptFullXid = checkPoint.nextFullXid;
XLogCtl->ckptFullXid = checkPoint.nextXid;
SpinLockRelease(&XLogCtl->info_lck);
/*
@ -9926,7 +9926,7 @@ xlog_redo(XLogReaderState *record)
memcpy(&checkPoint, XLogRecGetData(record), sizeof(CheckPoint));
/* In a SHUTDOWN checkpoint, believe the counters exactly */
LWLockAcquire(XidGenLock, LW_EXCLUSIVE);
ShmemVariableCache->nextFullXid = checkPoint.nextFullXid;
ShmemVariableCache->nextXid = checkPoint.nextXid;
LWLockRelease(XidGenLock);
LWLockAcquire(OidGenLock, LW_EXCLUSIVE);
ShmemVariableCache->nextOid = checkPoint.nextOid;
@ -9980,9 +9980,9 @@ xlog_redo(XLogReaderState *record)
running.xcnt = nxids;
running.subxcnt = 0;
running.subxid_overflow = false;
running.nextXid = XidFromFullTransactionId(checkPoint.nextFullXid);
running.nextXid = XidFromFullTransactionId(checkPoint.nextXid);
running.oldestRunningXid = oldestActiveXID;
latestCompletedXid = XidFromFullTransactionId(checkPoint.nextFullXid);
latestCompletedXid = XidFromFullTransactionId(checkPoint.nextXid);
TransactionIdRetreat(latestCompletedXid);
Assert(TransactionIdIsNormal(latestCompletedXid));
running.latestCompletedXid = latestCompletedXid;
@ -9995,12 +9995,12 @@ xlog_redo(XLogReaderState *record)
/* ControlFile->checkPointCopy always tracks the latest ckpt XID */
LWLockAcquire(ControlFileLock, LW_EXCLUSIVE);
ControlFile->checkPointCopy.nextFullXid = checkPoint.nextFullXid;
ControlFile->checkPointCopy.nextXid = checkPoint.nextXid;
LWLockRelease(ControlFileLock);
/* Update shared-memory copy of checkpoint XID/epoch */
SpinLockAcquire(&XLogCtl->info_lck);
XLogCtl->ckptFullXid = checkPoint.nextFullXid;
XLogCtl->ckptFullXid = checkPoint.nextXid;
SpinLockRelease(&XLogCtl->info_lck);
/*
@ -10021,9 +10021,9 @@ xlog_redo(XLogReaderState *record)
memcpy(&checkPoint, XLogRecGetData(record), sizeof(CheckPoint));
/* In an ONLINE checkpoint, treat the XID counter as a minimum */
LWLockAcquire(XidGenLock, LW_EXCLUSIVE);
if (FullTransactionIdPrecedes(ShmemVariableCache->nextFullXid,
checkPoint.nextFullXid))
ShmemVariableCache->nextFullXid = checkPoint.nextFullXid;
if (FullTransactionIdPrecedes(ShmemVariableCache->nextXid,
checkPoint.nextXid))
ShmemVariableCache->nextXid = checkPoint.nextXid;
LWLockRelease(XidGenLock);
/*
@ -10054,12 +10054,12 @@ xlog_redo(XLogReaderState *record)
checkPoint.oldestXidDB);
/* ControlFile->checkPointCopy always tracks the latest ckpt XID */
LWLockAcquire(ControlFileLock, LW_EXCLUSIVE);
ControlFile->checkPointCopy.nextFullXid = checkPoint.nextFullXid;
ControlFile->checkPointCopy.nextXid = checkPoint.nextXid;
LWLockRelease(ControlFileLock);
/* Update shared-memory copy of checkpoint XID/epoch */
SpinLockAcquire(&XLogCtl->info_lck);
XLogCtl->ckptFullXid = checkPoint.nextFullXid;
XLogCtl->ckptFullXid = checkPoint.nextXid;
SpinLockRelease(&XLogCtl->info_lck);
/* TLI should not change in an on-line checkpoint */

View File

@ -1613,8 +1613,8 @@ XLogRecGetFullXid(XLogReaderState *record)
Assert(AmStartupProcess() || !IsUnderPostmaster);
xid = XLogRecGetXid(record);
next_xid = XidFromFullTransactionId(ShmemVariableCache->nextFullXid);
epoch = EpochFromFullTransactionId(ShmemVariableCache->nextFullXid);
next_xid = XidFromFullTransactionId(ShmemVariableCache->nextXid);
epoch = EpochFromFullTransactionId(ShmemVariableCache->nextXid);
/*
* If xid is numerically greater than next_xid, it has to be from the last

View File

@ -878,10 +878,10 @@ ProcArrayApplyRecoveryInfo(RunningTransactions running)
LWLockRelease(ProcArrayLock);
/* ShmemVariableCache->nextFullXid must be beyond any observed xid. */
/* ShmemVariableCache->nextXid must be beyond any observed xid. */
AdvanceNextFullTransactionIdPastXid(latestObservedXid);
Assert(FullTransactionIdIsValid(ShmemVariableCache->nextFullXid));
Assert(FullTransactionIdIsValid(ShmemVariableCache->nextXid));
KnownAssignedXidsDisplay(trace_recovery(DEBUG3));
if (standbyState == STANDBY_SNAPSHOT_READY)
@ -1986,7 +1986,7 @@ GetRunningTransactionData(void)
latestCompletedXid = ShmemVariableCache->latestCompletedXid;
oldestRunningXid = XidFromFullTransactionId(ShmemVariableCache->nextFullXid);
oldestRunningXid = XidFromFullTransactionId(ShmemVariableCache->nextXid);
/*
* Spin over procArray collecting all xids
@ -2078,7 +2078,7 @@ GetRunningTransactionData(void)
CurrentRunningXacts->xcnt = count - subcount;
CurrentRunningXacts->subxcnt = subcount;
CurrentRunningXacts->subxid_overflow = suboverflowed;
CurrentRunningXacts->nextXid = XidFromFullTransactionId(ShmemVariableCache->nextFullXid);
CurrentRunningXacts->nextXid = XidFromFullTransactionId(ShmemVariableCache->nextXid);
CurrentRunningXacts->oldestRunningXid = oldestRunningXid;
CurrentRunningXacts->latestCompletedXid = latestCompletedXid;
@ -2123,7 +2123,7 @@ GetOldestActiveTransactionId(void)
* have already completed), when we spin over it.
*/
LWLockAcquire(XidGenLock, LW_SHARED);
oldestRunningXid = XidFromFullTransactionId(ShmemVariableCache->nextFullXid);
oldestRunningXid = XidFromFullTransactionId(ShmemVariableCache->nextXid);
LWLockRelease(XidGenLock);
/*
@ -2191,7 +2191,7 @@ GetOldestSafeDecodingTransactionId(bool catalogOnly)
* a safe, albeit pessimal, value.
*/
LWLockAcquire(XidGenLock, LW_SHARED);
oldestSafeXid = XidFromFullTransactionId(ShmemVariableCache->nextFullXid);
oldestSafeXid = XidFromFullTransactionId(ShmemVariableCache->nextXid);
/*
* If there's already a slot pegging the xmin horizon, we can start with
@ -3361,7 +3361,7 @@ RecordKnownAssignedTransactionIds(TransactionId xid)
*/
latestObservedXid = xid;
/* ShmemVariableCache->nextFullXid must be beyond any observed xid */
/* ShmemVariableCache->nextXid must be beyond any observed xid */
AdvanceNextFullTransactionIdPastXid(latestObservedXid);
next_expected_xid = latestObservedXid;
TransactionIdAdvance(next_expected_xid);

View File

@ -889,7 +889,7 @@ standby_redo(XLogReaderState *record)
* up from a checkpoint and are immediately at our starting point, we
* unconditionally move to STANDBY_INITIALIZED. After this point we
* must do 4 things:
* * move shared nextFullXid forwards as we see new xids
* * move shared nextXid forwards as we see new xids
* * extend the clog and subtrans with each new xid
* * keep track of uncommitted known assigned xids
* * keep track of uncommitted AccessExclusiveLocks

View File

@ -3390,7 +3390,7 @@ ReleasePredicateLocks(bool isCommit, bool isReadOnlySafe)
* transaction to complete before freeing some RAM; correctness of visible
* behavior is not affected.
*/
MySerializableXact->finishedBefore = XidFromFullTransactionId(ShmemVariableCache->nextFullXid);
MySerializableXact->finishedBefore = XidFromFullTransactionId(ShmemVariableCache->nextXid);
/*
* If it's not a commit it's either a rollback or a read-only transaction

View File

@ -165,8 +165,8 @@ pg_control_checkpoint(PG_FUNCTION_ARGS)
nulls[5] = false;
values[6] = CStringGetTextDatum(psprintf("%u:%u",
EpochFromFullTransactionId(ControlFile->checkPointCopy.nextFullXid),
XidFromFullTransactionId(ControlFile->checkPointCopy.nextFullXid)));
EpochFromFullTransactionId(ControlFile->checkPointCopy.nextXid),
XidFromFullTransactionId(ControlFile->checkPointCopy.nextXid)));
nulls[6] = false;
values[7] = ObjectIdGetDatum(ControlFile->checkPointCopy.nextOid);

View File

@ -250,8 +250,8 @@ main(int argc, char *argv[])
printf(_("Latest checkpoint's full_page_writes: %s\n"),
ControlFile->checkPointCopy.fullPageWrites ? _("on") : _("off"));
printf(_("Latest checkpoint's NextXID: %u:%u\n"),
EpochFromFullTransactionId(ControlFile->checkPointCopy.nextFullXid),
XidFromFullTransactionId(ControlFile->checkPointCopy.nextFullXid));
EpochFromFullTransactionId(ControlFile->checkPointCopy.nextXid),
XidFromFullTransactionId(ControlFile->checkPointCopy.nextXid));
printf(_("Latest checkpoint's NextOID: %u\n"),
ControlFile->checkPointCopy.nextOid);
printf(_("Latest checkpoint's NextMultiXactId: %u\n"),

View File

@ -424,14 +424,14 @@ main(int argc, char *argv[])
* if any, includes these values.)
*/
if (set_xid_epoch != -1)
ControlFile.checkPointCopy.nextFullXid =
ControlFile.checkPointCopy.nextXid =
FullTransactionIdFromEpochAndXid(set_xid_epoch,
XidFromFullTransactionId(ControlFile.checkPointCopy.nextFullXid));
XidFromFullTransactionId(ControlFile.checkPointCopy.nextXid));
if (set_xid != 0)
{
ControlFile.checkPointCopy.nextFullXid =
FullTransactionIdFromEpochAndXid(EpochFromFullTransactionId(ControlFile.checkPointCopy.nextFullXid),
ControlFile.checkPointCopy.nextXid =
FullTransactionIdFromEpochAndXid(EpochFromFullTransactionId(ControlFile.checkPointCopy.nextXid),
set_xid);
/*
@ -684,7 +684,7 @@ GuessControlValues(void)
ControlFile.checkPointCopy.ThisTimeLineID = 1;
ControlFile.checkPointCopy.PrevTimeLineID = 1;
ControlFile.checkPointCopy.fullPageWrites = false;
ControlFile.checkPointCopy.nextFullXid =
ControlFile.checkPointCopy.nextXid =
FullTransactionIdFromEpochAndXid(0, FirstNormalTransactionId);
ControlFile.checkPointCopy.nextOid = FirstBootstrapObjectId;
ControlFile.checkPointCopy.nextMulti = FirstMultiXactId;
@ -756,8 +756,8 @@ PrintControlValues(bool guessed)
printf(_("Latest checkpoint's full_page_writes: %s\n"),
ControlFile.checkPointCopy.fullPageWrites ? _("on") : _("off"));
printf(_("Latest checkpoint's NextXID: %u:%u\n"),
EpochFromFullTransactionId(ControlFile.checkPointCopy.nextFullXid),
XidFromFullTransactionId(ControlFile.checkPointCopy.nextFullXid));
EpochFromFullTransactionId(ControlFile.checkPointCopy.nextXid),
XidFromFullTransactionId(ControlFile.checkPointCopy.nextXid));
printf(_("Latest checkpoint's NextOID: %u\n"),
ControlFile.checkPointCopy.nextOid);
printf(_("Latest checkpoint's NextMultiXactId: %u\n"),
@ -847,7 +847,7 @@ PrintNewControlValues(void)
if (set_xid != 0)
{
printf(_("NextXID: %u\n"),
XidFromFullTransactionId(ControlFile.checkPointCopy.nextFullXid));
XidFromFullTransactionId(ControlFile.checkPointCopy.nextXid));
printf(_("OldestXID: %u\n"),
ControlFile.checkPointCopy.oldestXid);
printf(_("OldestXID's DB: %u\n"),
@ -857,7 +857,7 @@ PrintNewControlValues(void)
if (set_xid_epoch != -1)
{
printf(_("NextXID epoch: %u\n"),
EpochFromFullTransactionId(ControlFile.checkPointCopy.nextFullXid));
EpochFromFullTransactionId(ControlFile.checkPointCopy.nextXid));
}
if (set_oldest_commit_ts_xid != 0)

View File

@ -175,12 +175,12 @@ typedef struct VariableCacheData
/*
* These fields are protected by XidGenLock.
*/
FullTransactionId nextFullXid; /* next full XID to assign */
FullTransactionId nextXid; /* next XID to assign */
TransactionId oldestXid; /* cluster-wide minimum datfrozenxid */
TransactionId xidVacLimit; /* start forcing autovacuums here */
TransactionId xidWarnLimit; /* start complaining here */
TransactionId xidStopLimit; /* refuse to advance nextFullXid beyond here */
TransactionId xidStopLimit; /* refuse to advance nextXid beyond here */
TransactionId xidWrapLimit; /* where the world ends */
Oid oldestXidDB; /* database with minimum datfrozenxid */

View File

@ -40,7 +40,7 @@ typedef struct CheckPoint
TimeLineID PrevTimeLineID; /* previous TLI, if this record begins a new
* timeline (equals ThisTimeLineID otherwise) */
bool fullPageWrites; /* current full_page_writes */
FullTransactionId nextFullXid; /* next free full transaction ID */
FullTransactionId nextXid; /* next free transaction ID */
Oid nextOid; /* next free OID */
MultiXactId nextMulti; /* next free MultiXactId */
MultiXactOffset nextMultiOffset; /* next free MultiXact offset */

View File

@ -72,7 +72,7 @@ typedef struct RunningTransactionsData
int xcnt; /* # of xact ids in xids[] */
int subxcnt; /* # of subxact ids in xids[] */
bool subxid_overflow; /* snapshot overflowed, subxids missing */
TransactionId nextXid; /* xid from ShmemVariableCache->nextFullXid */
TransactionId nextXid; /* xid from ShmemVariableCache->nextXid */
TransactionId oldestRunningXid; /* *not* oldestXmin */
TransactionId latestCompletedXid; /* so we can set xmax */

View File

@ -49,7 +49,7 @@ typedef struct xl_running_xacts
int xcnt; /* # of xact ids in xids[] */
int subxcnt; /* # of subxact ids in xids[] */
bool subxid_overflow; /* snapshot overflowed, subxids missing */
TransactionId nextXid; /* xid from ShmemVariableCache->nextFullXid */
TransactionId nextXid; /* xid from ShmemVariableCache->nextXid */
TransactionId oldestRunningXid; /* *not* oldestXmin */
TransactionId latestCompletedXid; /* so we can set xmax */