Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
533020d
Fix minor issues in psql's new \dAc and related commands.
tglsfdc Aug 2, 2020
63e9aa6
Correct comment in simplehash.h.
macdice Aug 3, 2020
f44b9b6
Fix rare failure in LDAP tests.
macdice Aug 3, 2020
b8fdee7
Add %P to log_line_prefix for parallel group leader
michaelpq Aug 3, 2020
5f28b21
Fix behavior of ecpg's "EXEC SQL elif name".
tglsfdc Aug 3, 2020
eeb01e3
Doc: fix obsolete info about allowed range of TZ offsets in timetz.
tglsfdc Aug 3, 2020
9e49676
Remove unnecessary "DISTINCT" in psql's queries for \dAc and \dAf.
tglsfdc Aug 3, 2020
a451b7d
Add nbtree page deletion assertion.
petergeoghegan Aug 3, 2020
9a9db08
Fix replica backward scan race condition.
petergeoghegan Aug 3, 2020
dd87799
Make new SSL TAP test for channel_binding more robust
michaelpq Aug 4, 2020
0f76294
Increase hard-wired timeout values in ecpg regression tests.
tglsfdc Aug 4, 2020
f47b5e1
Remove btree page items after page unlink
akorotkov Aug 4, 2020
7a980df
Fix matching of sub-partitions when a partitioned plan is stale.
tglsfdc Aug 5, 2020
a677535
doc: clarify "state" table reference in tutorial
bmomjian Aug 5, 2020
bab1500
Register llvm_shutdown using on_proc_exit, not before_shmem_exit.
robertmhaas Aug 6, 2020
d5e9652
Fix bogus EXPLAIN output for Hash Aggregate
david-rowley Aug 6, 2020
c254d8d
amcheck: Sanitize metapage's allequalimage field.
petergeoghegan Aug 6, 2020
3a3be80
Remove obsolete amcheck comment.
petergeoghegan Aug 6, 2020
199cec9
Fix yet another issue with step generation in partition pruning.
Aug 7, 2020
3df92bb
Rename nbtree split REDO routine variables.
petergeoghegan Aug 7, 2020
6f0b632
Support testing of cases where table schemas change after planning.
tglsfdc Aug 7, 2020
cea3d55
Remove PROC_IN_ANALYZE and derived flags
alvherre Aug 7, 2020
0a7d771
Make nbtree split REDO locking match original execution.
petergeoghegan Aug 7, 2020
7259736
Implement streaming mode in ReorderBuffer.
Aug 8, 2020
a13421c
Add some const decorations
petere Aug 8, 2020
82a0ba7
Fix the logical streaming test.
Aug 8, 2020
470687b
walsnd: Don't set waiting_for_ping_response spuriously
alvherre Aug 8, 2020
39132b7
Teach amcheck to verify sibling links in all cases.
petergeoghegan Aug 8, 2020
20e7e1f
Remove <@ from contrib/intarray's GiST operator classes.
tglsfdc Aug 8, 2020
1c164ef
Remove useless Assert.
tglsfdc Aug 9, 2020
1b9cde5
Check for fseeko() failure in pg_dump's _tarAddFile().
tglsfdc Aug 9, 2020
d129c07
Correct nbtree page split lock coupling comment.
petergeoghegan Aug 9, 2020
7eeb1d9
Make contrib modules' installation scripts more secure.
tglsfdc Aug 10, 2020
e078fb5
Move connect.h from fe_utils to src/include/common.
nmisch Aug 10, 2020
11da970
Empty search_path in logical replication apply worker and walsender.
nmisch Aug 10, 2020
cec57b1
Document clashes between logical replication and untrusted users.
nmisch Aug 10, 2020
1784f27
Replace remaining StrNCpy() by strlcpy()
petere Aug 10, 2020
1f75b45
Improve tab completion of REINDEX in psql
michaelpq Aug 11, 2020
fea10a6
Rename VariableCacheData.nextFullXid to nextXid.
anarazel Aug 11, 2020
3bd7f99
Track latest completed xid as a FullTransactionId.
anarazel Aug 12, 2020
3546cf8
Improve comments for postmaster.c's BackendList.
tglsfdc Aug 12, 2020
1f42d35
BRIN: Handle concurrent desummarization properly
alvherre Aug 12, 2020
dc7420c
snapshot scalability: Don't compute global horizons while building sn…
anarazel Aug 12, 2020
b8443ea
Fix out-of-date version reference, grammar.
anarazel Aug 13, 2020
a811ea5
Handle new HOT chains in index-build table scans
alvherre Aug 13, 2020
1f51c17
snapshot scalability: Move PGXACT->xmin back to PGPROC.
anarazel Aug 13, 2020
a9306f1
Doc: improve examples for json_populate_record() and related functions.
tglsfdc Aug 14, 2020
1f32136
Fix compilation warnings with libselinux 3.1 in contrib/sepgsql/
michaelpq Aug 14, 2020
5bdf694
Fix typo in test comment.
hlinnaka Aug 14, 2020
0038f94
Fix postmaster's behavior during smart shutdown.
tglsfdc Aug 14, 2020
914140e
Fix obsolete comment in xlogutils.c.
petergeoghegan Aug 14, 2020
2ba5b2d
pg_dump: fix dependencies on FKs to partitioned tables
alvherre Aug 14, 2020
941697c
snapshot scalability: Introduce dense array of in-progress xids.
anarazel Aug 14, 2020
5788e25
snapshot scalability: Move PGXACT->vacuumFlags to ProcGlobal->vacuumF…
anarazel Jul 15, 2020
73487a6
snapshot scalability: Move subxact info to ProcGlobal, remove PGXACT.
anarazel Aug 14, 2020
1e7629d
Be more careful about the shape of hashable subplan clauses.
tglsfdc Aug 15, 2020
b48cac3
Mark a few logical decoding related variables with PGDLLIMPORT.
Aug 15, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
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
  • Loading branch information
anarazel committed Aug 11, 2020
commit fea10a64340e529805609126740a540c8f9daab4
6 changes: 3 additions & 3 deletions src/backend/access/gist/gistxlog.c
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ gistRedoPageReuse(XLogReaderState *record)
if (InHotStandby)
{
FullTransactionId latestRemovedFullXid = xlrec->latestRemovedFullXid;
FullTransactionId nextFullXid = ReadNextFullTransactionId();
FullTransactionId nextXid = ReadNextFullTransactionId();
uint64 diff;

/*
Expand All @@ -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)
{
Expand Down
4 changes: 2 additions & 2 deletions src/backend/access/rmgrdesc/xlogdesc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 4 additions & 4 deletions src/backend/access/transam/clog.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions src/backend/access/transam/commit_ts.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -704,7 +704,7 @@ ActivateCommitTs(void)
}
LWLockRelease(CommitTsLock);

xid = XidFromFullTransactionId(ShmemVariableCache->nextFullXid);
xid = XidFromFullTransactionId(ShmemVariableCache->nextXid);
pageno = TransactionIdToCTsPage(xid);

/*
Expand Down
2 changes: 1 addition & 1 deletion src/backend/access/transam/multixact.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
10 changes: 5 additions & 5 deletions src/backend/access/transam/subtrans.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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)
{
Expand Down
22 changes: 11 additions & 11 deletions src/backend/access/transam/twophase.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand 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;
Expand Down Expand Up @@ -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 *
Expand All @@ -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;
Expand Down Expand Up @@ -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)) +
Expand All @@ -2160,7 +2160,7 @@ ProcessTwoPhaseBuffer(TransactionId xid,

Assert(TransactionIdFollows(subxid, xid));

/* update nextFullXid if needed */
/* update nextXid if needed */
if (setNextXid)
AdvanceNextFullTransactionIdPastXid(subxid);

Expand Down
26 changes: 13 additions & 13 deletions src/backend/access/transam/varsup.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ GetNewTransactionId(bool isSubXact)

LWLockAcquire(XidGenLock, LW_EXCLUSIVE);

full_xid = ShmemVariableCache->nextFullXid;
full_xid = ShmemVariableCache->nextXid;
xid = XidFromFullTransactionId(full_xid);

/*----------
Expand Down Expand Up @@ -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);
}

Expand All @@ -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
Expand Down Expand Up @@ -240,22 +240,22 @@ GetNewTransactionId(bool isSubXact)
}

/*
* Read nextFullXid but don't allocate it.
* Read nextXid but don't allocate it.
*/
FullTransactionId
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
Expand All @@ -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;

Expand All @@ -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);
Expand All @@ -296,7 +296,7 @@ AdvanceNextFullTransactionIdPastXid(TransactionId xid)
* concurrent readers.
*/
LWLockAcquire(XidGenLock, LW_EXCLUSIVE);
ShmemVariableCache->nextFullXid = newNextFullXid;
ShmemVariableCache->nextXid = newNextFullXid;
LWLockRelease(XidGenLock);
}

Expand Down Expand Up @@ -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 */
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/backend/access/transam/xact.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) ==
Expand Down Expand Up @@ -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);
Expand Down
Loading