From 5da14938f7bfb96b648ee3c47e7ea2afca5bcc4a Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Fri, 15 May 2020 14:28:19 -0400 Subject: Rename SLRU structures and associated LWLocks. Originally, the names assigned to SLRUs had no purpose other than being shmem lookup keys, so not a lot of thought went into them. As of v13, though, we're exposing them in the pg_stat_slru view and the pg_stat_reset_slru function, so it seems advisable to take a bit more care. Rename them to names based on the associated on-disk storage directories (which fortunately we *did* think about, to some extent; since those are also visible to DBAs, consistency seems like a good thing). Also rename the associated LWLocks, since those names are likewise user-exposed now as wait event names. For the most part I only touched symbols used in the respective modules' SimpleLruInit() calls, not the names of other related objects. This renaming could have been taken further, and maybe someday we will do so. But for now it seems undesirable to change the names of any globally visible functions or structs, so some inconsistency is unavoidable. (But I *did* terminate "oldserxid" with prejudice, as I found that name both unreadable and not descriptive of the SLRU's contents.) Table 27.12 needs re-alphabetization now, but I'll leave that till after the other LWLock renamings I have in mind. Discussion: https://postgr.es/m/28683.1589405363@sss.pgh.pa.us --- src/backend/access/transam/varsup.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/backend/access/transam/varsup.c') diff --git a/src/backend/access/transam/varsup.c b/src/backend/access/transam/varsup.c index 2570e7086a7..e14b53bf9e3 100644 --- a/src/backend/access/transam/varsup.c +++ b/src/backend/access/transam/varsup.c @@ -303,22 +303,22 @@ AdvanceNextFullTransactionIdPastXid(TransactionId xid) /* * Advance the cluster-wide value for the oldest valid clog entry. * - * We must acquire CLogTruncationLock to advance the oldestClogXid. It's not + * We must acquire XactTruncationLock to advance the oldestClogXid. It's not * necessary to hold the lock during the actual clog truncation, only when we * advance the limit, as code looking up arbitrary xids is required to hold - * CLogTruncationLock from when it tests oldestClogXid through to when it + * XactTruncationLock from when it tests oldestClogXid through to when it * completes the clog lookup. */ void AdvanceOldestClogXid(TransactionId oldest_datfrozenxid) { - LWLockAcquire(CLogTruncationLock, LW_EXCLUSIVE); + LWLockAcquire(XactTruncationLock, LW_EXCLUSIVE); if (TransactionIdPrecedes(ShmemVariableCache->oldestClogXid, oldest_datfrozenxid)) { ShmemVariableCache->oldestClogXid = oldest_datfrozenxid; } - LWLockRelease(CLogTruncationLock); + LWLockRelease(XactTruncationLock); } /* -- cgit v1.2.3