1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-04 20:11:56 +03:00

Rename ShmemVariableCache to TransamVariables

The old name was misleading: It's not a cache, the values kept in the
struct are the authoritative source.

Reviewed-by: Tristan Partin, Richard Guo
Discussion: https://www.postgresql.org/message-id/6537d63d-4bb5-46f8-9b5d-73a8ba4720ab@iki.fi
This commit is contained in:
Heikki Linnakangas
2023-12-08 09:47:15 +02:00
parent 15916ffb04
commit b31ba5310b
18 changed files with 172 additions and 175 deletions

View File

@@ -126,8 +126,8 @@ TransactionIdInRecentPast(FullTransactionId fxid, TransactionId *extracted_xid)
(unsigned long long) U64FromFullTransactionId(fxid))));
/*
* ShmemVariableCache->oldestClogXid is protected by XactTruncationLock,
* but we don't acquire that lock here. Instead, we require the caller to
* TransamVariables->oldestClogXid is protected by XactTruncationLock, but
* we don't acquire that lock here. Instead, we require the caller to
* acquire it, because the caller is presumably going to look up the
* returned XID. If we took and released the lock within this function, a
* CLOG truncation could occur before the caller finished with the XID.
@@ -137,12 +137,12 @@ TransactionIdInRecentPast(FullTransactionId fxid, TransactionId *extracted_xid)
/*
* If the transaction ID has wrapped around, it's definitely too old to
* determine the commit status. Otherwise, we can compare it to
* ShmemVariableCache->oldestClogXid to determine whether the relevant
* CLOG entry is guaranteed to still exist.
* TransamVariables->oldestClogXid to determine whether the relevant CLOG
* entry is guaranteed to still exist.
*/
if (xid_epoch + 1 < now_epoch
|| (xid_epoch + 1 == now_epoch && xid < now_epoch_next_xid)
|| TransactionIdPrecedes(xid, ShmemVariableCache->oldestClogXid))
|| TransactionIdPrecedes(xid, TransamVariables->oldestClogXid))
return false;
return true;