Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5da1493

Browse files
committed
Rename SLRU structures and associated LWLocks.
Originally, the names assigned to SLRUs had no purpose other thanbeing 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 andthe pg_stat_reset_slru function, so it seems advisable to take a bitmore care. Rename them to names based on the associated on-diskstorage directories (which fortunately we *did* think about, to someextent; since those are also visible to DBAs, consistency seems likea good thing). Also rename the associated LWLocks, since those namesare 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. Thisrenaming could have been taken further, and maybe someday we will do so.But for now it seems undesirable to change the names of any globallyvisible functions or structs, so some inconsistency is unavoidable.(But I *did* terminate "oldserxid" with prejudice, as I found thatname both unreadable and not descriptive of the SLRU's contents.)Table 27.12 needs re-alphabetization now, but I'll leave that tillafter the other LWLock renamings I have in mind.Discussion:https://postgr.es/m/28683.1589405363@sss.pgh.pa.us
1 parent756abe2 commit5da1493

File tree

20 files changed

+406
-382
lines changed

20 files changed

+406
-382
lines changed

‎doc/src/sgml/monitoring.sgml

Lines changed: 51 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1754,12 +1754,13 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
17541754
<entry>Waiting to manage space allocation in shared memory.</entry>
17551755
</row>
17561756
<row>
1757-
<entry><literal>AsyncCtlLock</literal></entry>
1758-
<entry>Waiting to read or update shared notification state.</entry>
1757+
<entry><literal>NotifySLRULock</literal></entry>
1758+
<entry>Waiting to access the <command>NOTIFY</command> message SLRU
1759+
cache.</entry>
17591760
</row>
17601761
<row>
1761-
<entry><literal>AsyncQueueLock</literal></entry>
1762-
<entry>Waiting to read or updatenotification messages.</entry>
1762+
<entry><literal>NotifyQueueLock</literal></entry>
1763+
<entry>Waiting to read or update<command>NOTIFY</command> messages.</entry>
17631764
</row>
17641765
<row>
17651766
<entry><literal>AutoFileLock</literal></entry>
@@ -1785,13 +1786,13 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
17851786
B-tree index.</entry>
17861787
</row>
17871788
<row>
1788-
<entry><literal>CLogControlLock</literal></entry>
1789-
<entry>Waiting toread or updatetransaction status.</entry>
1789+
<entry><literal>XactSLRULock</literal></entry>
1790+
<entry>Waiting toaccess thetransaction status SLRU cache.</entry>
17901791
</row>
17911792
<row>
1792-
<entry><literal>CLogTruncationLock</literal></entry>
1793+
<entry><literal>XactTruncationLock</literal></entry>
17931794
<entry>Waiting to execute <function>pg_xact_status</function> or update
1794-
the oldest transactionid available to it.</entry>
1795+
the oldest transactionID available to it.</entry>
17951796
</row>
17961797
<row>
17971798
<entry><literal>CheckpointLock</literal></entry>
@@ -1802,8 +1803,8 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
18021803
<entry>Waiting to manage fsync requests.</entry>
18031804
</row>
18041805
<row>
1805-
<entry><literal>CommitTsControlLock</literal></entry>
1806-
<entry>Waiting toread or update transaction commit timestamps.</entry>
1806+
<entry><literal>CommitTsSLRULock</literal></entry>
1807+
<entry>Waiting toaccess the commit timestamp SLRU cache.</entry>
18071808
</row>
18081809
<row>
18091810
<entry><literal>CommitTsLock</literal></entry>
@@ -1828,12 +1829,12 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
18281829
<entry>Waiting to read or update shared multixact state.</entry>
18291830
</row>
18301831
<row>
1831-
<entry><literal>MultiXactMemberControlLock</literal></entry>
1832-
<entry>Waiting toread or updatemultixact membermappings.</entry>
1832+
<entry><literal>MultiXactMemberSLRULock</literal></entry>
1833+
<entry>Waiting toaccess themultixact memberSLRU cache.</entry>
18331834
</row>
18341835
<row>
1835-
<entry><literal>MultiXactOffsetControlLock</literal></entry>
1836-
<entry>Waiting toread or updatemultixact offsetmappings.</entry>
1836+
<entry><literal>MultiXactOffsetSLRULock</literal></entry>
1837+
<entry>Waiting toaccess themultixact offsetSLRU cache.</entry>
18371838
</row>
18381839
<row>
18391840
<entry><literal>MultiXactTruncationLock</literal></entry>
@@ -1844,9 +1845,9 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
18441845
<entry>Waiting to allocate or assign an OID.</entry>
18451846
</row>
18461847
<row>
1847-
<entry><literal>OldSerXidLock</literal></entry>
1848-
<entry>Waiting toread or record conflicting serializable
1849-
transactions.</entry>
1848+
<entry><literal>SerialSLRULock</literal></entry>
1849+
<entry>Waiting toaccess the serializable transaction conflict SLRU
1850+
cache.</entry>
18501851
</row>
18511852
<row>
18521853
<entry><literal>OldSnapshotTimeMapLock</literal></entry>
@@ -1907,8 +1908,8 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
19071908
<entry>Waiting to find or allocate space in shared memory.</entry>
19081909
</row>
19091910
<row>
1910-
<entry><literal>SubtransControlLock</literal></entry>
1911-
<entry>Waiting toread or updatesub-transactioninformation.</entry>
1911+
<entry><literal>SubtransSLRULock</literal></entry>
1912+
<entry>Waiting toaccess thesub-transactionSLRU cache.</entry>
19121913
</row>
19131914
<row>
19141915
<entry><literal>SyncRepLock</literal></entry>
@@ -1941,8 +1942,9 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
19411942
<entry>Waiting to allocate or assign a transaction id.</entry>
19421943
</row>
19431944
<row>
1944-
<entry><literal>async</literal></entry>
1945-
<entry>Waiting for I/O on an async (notify) buffer.</entry>
1945+
<entry><literal>NotifyBuffer</literal></entry>
1946+
<entry>Waiting for I/O on a <command>NOTIFY</command> message SLRU
1947+
buffer.</entry>
19461948
</row>
19471949
<row>
19481950
<entry><literal>buffer_content</literal></entry>
@@ -1958,29 +1960,30 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
19581960
pool.</entry>
19591961
</row>
19601962
<row>
1961-
<entry><literal>clog</literal></entry>
1962-
<entry>Waiting for I/O on aclog (transaction status) buffer.</entry>
1963+
<entry><literal>XactBuffer</literal></entry>
1964+
<entry>Waiting for I/O on a transaction status SLRU buffer.</entry>
19631965
</row>
19641966
<row>
1965-
<entry><literal>commit_timestamp</literal></entry>
1966-
<entry>Waiting for I/O on commit timestamp buffer.</entry>
1967+
<entry><literal>CommitTsBuffer</literal></entry>
1968+
<entry>Waiting for I/O onacommit timestamp SLRU buffer.</entry>
19671969
</row>
19681970
<row>
19691971
<entry><literal>lock_manager</literal></entry>
19701972
<entry>Waiting to add or examine locks for backends, or waiting to
19711973
join or exit a locking group (used by parallel query).</entry>
19721974
</row>
19731975
<row>
1974-
<entry><literal>multixact_member</literal></entry>
1975-
<entry>Waiting for I/O on amultixact_member buffer.</entry>
1976+
<entry><literal>MultiXactMember</literal></entry>
1977+
<entry>Waiting for I/O on amultixact member SLRU buffer.</entry>
19761978
</row>
19771979
<row>
1978-
<entry><literal>multixact_offset</literal></entry>
1979-
<entry>Waiting for I/O on a multixact offset buffer.</entry>
1980+
<entry><literal>MultiXactOffsetBuffer</literal></entry>
1981+
<entry>Waiting for I/O on a multixact offsetSLRUbuffer.</entry>
19801982
</row>
19811983
<row>
1982-
<entry><literal>oldserxid</literal></entry>
1983-
<entry>Waiting for I/O on an oldserxid buffer.</entry>
1984+
<entry><literal>SerialBuffer</literal></entry>
1985+
<entry>Waiting for I/O on a serializable transaction conflict SLRU
1986+
buffer.</entry>
19841987
</row>
19851988
<row>
19861989
<entry><literal>parallel_append</literal></entry>
@@ -2018,8 +2021,8 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser
20182021
in a parallel query.</entry>
20192022
</row>
20202023
<row>
2021-
<entry><literal>subtrans</literal></entry>
2022-
<entry>Waiting for I/O on asubtransaction buffer.</entry>
2024+
<entry><literal>SubtransBuffer</literal></entry>
2025+
<entry>Waiting for I/O on asub-transaction SLRU buffer.</entry>
20232026
</row>
20242027
<row>
20252028
<entry><literal>tbm</literal></entry>
@@ -4190,7 +4193,13 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
41904193
</tgroup>
41914194
</table>
41924195

4196+
<indexterm>
4197+
<primary>SLRU</primary>
4198+
</indexterm>
4199+
41934200
<para>
4201+
<productname>PostgreSQL</productname> accesses certain on-disk information
4202+
via <firstterm>SLRU</firstterm> (simple least-recently-used) caches.
41944203
The <structname>pg_stat_slru</structname> view will contain
41954204
one row for each tracked SLRU cache, showing statistics about access
41964205
to cached pages.
@@ -4484,11 +4493,15 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i
44844493
Resets statistics to zero for a single SLRU cache, or for all SLRUs in
44854494
the cluster. If the argument is NULL, all counters shown in
44864495
the <structname>pg_stat_slru</structname> view for all SLRU caches are
4487-
reset. The argument can be one of <literal>async</literal>,
4488-
<literal>clog</literal>, <literal>commit_timestamp</literal>,
4489-
<literal>multixact_offset</literal>,
4490-
<literal>multixact_member</literal>, <literal>oldserxid</literal>, or
4491-
<literal>subtrans</literal> to reset the counters for only that entry.
4496+
reset. The argument can be one of
4497+
<literal>CommitTs</literal>,
4498+
<literal>MultiXactMember</literal>,
4499+
<literal>MultiXactOffset</literal>,
4500+
<literal>Notify</literal>,
4501+
<literal>Serial</literal>,
4502+
<literal>Subtrans</literal>, or
4503+
<literal>Xact</literal>
4504+
to reset the counters for only that entry.
44924505
If the argument is <literal>other</literal> (or indeed, any
44934506
unrecognized name), then the counters for all other SLRU caches, such
44944507
as extension-defined caches, are reset.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp