Rename VariableCacheData.nextFullXid to nextXid.
authorAndres Freund <andres@anarazel.de>
Tue, 11 Aug 2020 18:25:23 +0000 (11:25 -0700)
committerAndres Freund <andres@anarazel.de>
Tue, 11 Aug 2020 19:07:14 +0000 (12:07 -0700)
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

21 files changed:
src/backend/access/gist/gistxlog.c
src/backend/access/rmgrdesc/xlogdesc.c
src/backend/access/transam/clog.c
src/backend/access/transam/commit_ts.c
src/backend/access/transam/multixact.c
src/backend/access/transam/subtrans.c
src/backend/access/transam/twophase.c
src/backend/access/transam/varsup.c
src/backend/access/transam/xact.c
src/backend/access/transam/xlog.c
src/backend/access/transam/xlogreader.c
src/backend/storage/ipc/procarray.c
src/backend/storage/ipc/standby.c
src/backend/storage/lmgr/predicate.c
src/backend/utils/misc/pg_controldata.c
src/bin/pg_controldata/pg_controldata.c
src/bin/pg_resetwal/pg_resetwal.c
src/include/access/transam.h
src/include/catalog/pg_control.h
src/include/storage/standby.h
src/include/storage/standbydefs.h

index 3f0effd5e4296a63e866e1955edb0218fee3dd3d..7b5d1e98b70b84cf0241cb4cf6712b61a330fc72 100644 (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)
                {
index 1cd97852e8f3108cc24e82e6405930cf5fad7a39..3200f777f5a374b4384e374ec7ebca04ed0944fc 100644 (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,
index f3da40ae017faf8ef1d220701b7715164d6182eb..dd2f4d5bc7e7f854da3061e4c446f1e822b8fc20 100644 (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)
index 903280ae92d09b1320be15d73c002f3a46966e8b..5244b06a2b651aa3b2fe6d06bb3b04c84dd61ee9 100644 (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);
 
        /*
index 475f5ed86110a76ce2af299ac4e1e2e96e73ca1f..b8bedca04a4dae61e2e263cc2e20470cd669314c 100644 (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.
                 */
index f33ae407a60915a3f1893fa6535fc8c9f6ea022c..a087a5554210c30fc46d1e9d6560dba83ca15c23 100644 (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)
        {
index 9b2e59bf0ec187effcfd63b776f4704446de421b..31f135f5cedc1d6920d1a37cec67553b5b9562ed 100644 (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);
 
index 0142bc70f6a63e535138b60c869a1abc415e0897..3ebd75118f06e5db8bf3d319ff4cf04eb14cfb53 100644 (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;
index 727d616035935436359ba793135a268bb06666fb..7ccb7d68ed9a620eba64369822125780d49f46d2 100644 (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);
index 756b838e6a54368c217b439e470ae3fcfb4d387d..53945c0e305dfc6606b3a0870079c6dad88e3b37 100644 (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 */
index a757baccfc55102d4d4efa25188afba6b7db4706..67996018da27690f84eda75cc9238fbfea96446a 100644 (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
index b44853356446a6d31f86fdb1d6b9e2ef62c9d2c2..be0240e0ddcd4d730c10838e6bd8903c80226b21 100644 (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);
index f5229839cfc3b8c81087f775ef4b1882afbae71b..52b2809dac0384b02c173e8366974611c4dedbb5 100644 (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
index d24919f76b67ce3bb5016b024e79d5c16df0d024..a2f8e7524b499b26407895e95f96cd66fcc6099d 100644 (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
index 419b58330fea03e9979e5d7356a5011b2f3f027b..609231275893011aaf5991ad03b031b149f64cb4 100644 (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);
index e73639df744be4f2872633fcfb4678e18e0f4346..3e00ac0f701ab82479066421c2bb7b4848f0bc7b 100644 (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"),
index 233441837f8a831bf011fba569c422b39c0ad97d..cb6ef1918206a01551b5c6dab6e864619655f4f0 100644 (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)
index a91a0c7487d88ba9f5d2ab609eef5685a4c68c37..85508300e9a20332a772532758e2c04a1daa0db2 100644 (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 */
 
index de5670e53826c8ce5d47d80d6a02cc71a2be7af6..06bed90c5e9e5796e222d6e1631818341fd3fea7 100644 (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 */
index cfbe426e5ae319f4eb9d2bd314b4530773596679..faaf1d3817b6cda948e63b15106f11c875fc4421 100644 (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 */
 
index 4876d2eeea13643099814e926be154cf0c150b51..4dda1c403a4b805d5519b969456a6bc5502a6537 100644 (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 */