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 --- doc/src/sgml/monitoring.sgml | 89 +++++++++++++++++++++++++------------------- 1 file changed, 51 insertions(+), 38 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml index 87502a49b6b..afad0aaa991 100644 --- a/doc/src/sgml/monitoring.sgml +++ b/doc/src/sgml/monitoring.sgml @@ -1754,12 +1754,13 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser Waiting to manage space allocation in shared memory. - AsyncCtlLock - Waiting to read or update shared notification state. + NotifySLRULock + Waiting to access the NOTIFY message SLRU + cache. - AsyncQueueLock - Waiting to read or update notification messages. + NotifyQueueLock + Waiting to read or update NOTIFY messages. AutoFileLock @@ -1785,13 +1786,13 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser B-tree index. - CLogControlLock - Waiting to read or update transaction status. + XactSLRULock + Waiting to access the transaction status SLRU cache. - CLogTruncationLock + XactTruncationLock Waiting to execute pg_xact_status or update - the oldest transaction id available to it. + the oldest transaction ID available to it. CheckpointLock @@ -1802,8 +1803,8 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser Waiting to manage fsync requests. - CommitTsControlLock - Waiting to read or update transaction commit timestamps. + CommitTsSLRULock + Waiting to access the commit timestamp SLRU cache. CommitTsLock @@ -1828,12 +1829,12 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser Waiting to read or update shared multixact state. - MultiXactMemberControlLock - Waiting to read or update multixact member mappings. + MultiXactMemberSLRULock + Waiting to access the multixact member SLRU cache. - MultiXactOffsetControlLock - Waiting to read or update multixact offset mappings. + MultiXactOffsetSLRULock + Waiting to access the multixact offset SLRU cache. MultiXactTruncationLock @@ -1844,9 +1845,9 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser Waiting to allocate or assign an OID. - OldSerXidLock - Waiting to read or record conflicting serializable - transactions. + SerialSLRULock + Waiting to access the serializable transaction conflict SLRU + cache. OldSnapshotTimeMapLock @@ -1907,8 +1908,8 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser Waiting to find or allocate space in shared memory. - SubtransControlLock - Waiting to read or update sub-transaction information. + SubtransSLRULock + Waiting to access the sub-transaction SLRU cache. SyncRepLock @@ -1941,8 +1942,9 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser Waiting to allocate or assign a transaction id. - async - Waiting for I/O on an async (notify) buffer. + NotifyBuffer + Waiting for I/O on a NOTIFY message SLRU + buffer. buffer_content @@ -1958,12 +1960,12 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser pool. - clog - Waiting for I/O on a clog (transaction status) buffer. + XactBuffer + Waiting for I/O on a transaction status SLRU buffer. - commit_timestamp - Waiting for I/O on commit timestamp buffer. + CommitTsBuffer + Waiting for I/O on a commit timestamp SLRU buffer. lock_manager @@ -1971,16 +1973,17 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser join or exit a locking group (used by parallel query). - multixact_member - Waiting for I/O on a multixact_member buffer. + MultiXactMember + Waiting for I/O on a multixact member SLRU buffer. - multixact_offset - Waiting for I/O on a multixact offset buffer. + MultiXactOffsetBuffer + Waiting for I/O on a multixact offset SLRU buffer. - oldserxid - Waiting for I/O on an oldserxid buffer. + SerialBuffer + Waiting for I/O on a serializable transaction conflict SLRU + buffer. parallel_append @@ -2018,8 +2021,8 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser in a parallel query. - subtrans - Waiting for I/O on a subtransaction buffer. + SubtransBuffer + Waiting for I/O on a sub-transaction SLRU buffer. tbm @@ -4190,7 +4193,13 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i + + SLRU + + + PostgreSQL accesses certain on-disk information + via SLRU (simple least-recently-used) caches. The pg_stat_slru view will contain one row for each tracked SLRU cache, showing statistics about access to cached pages. @@ -4484,11 +4493,15 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i Resets statistics to zero for a single SLRU cache, or for all SLRUs in the cluster. If the argument is NULL, all counters shown in the pg_stat_slru view for all SLRU caches are - reset. The argument can be one of async, - clog, commit_timestamp, - multixact_offset, - multixact_member, oldserxid, or - subtrans to reset the counters for only that entry. + reset. The argument can be one of + CommitTs, + MultiXactMember, + MultiXactOffset, + Notify, + Serial, + Subtrans, or + Xact + to reset the counters for only that entry. If the argument is other (or indeed, any unrecognized name), then the counters for all other SLRU caches, such as extension-defined caches, are reset. -- cgit v1.2.3