BUG #18728: Inconsistency between pg_wait_events.name and pg_stat_activity.wait_event for LWLocks - Mailing list pgsql-bugs

From PG Bug reporting form
Subject BUG #18728: Inconsistency between pg_wait_events.name and pg_stat_activity.wait_event for LWLocks
Date
Msg-id 18728-450924477056a339@postgresql.org
Whole thread Raw
Responses Re: BUG #18728: Inconsistency between pg_wait_events.name and pg_stat_activity.wait_event for LWLocks
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      18728
Logged by:          Christophe Courtois
Email address:      christophe.courtois@dalibo.com
PostgreSQL version: 17.2
Operating system:   Linux (Debian 12)
Description:

Hi,
When joining pg_stat_activity and pg_wait_events, I've found discrepancies
with wait_event names.

I have launched a pgbench and run this repeatedly:

SELECT distinct wait_event, wait_event_type, w.name, w.description
FROM pg_stat_activity LEFT JOIN pg_wait_events w ON (name=wait_event and
w.type=wait_event_type) order by 1,2 ;

And I got these lines without description, among correct ones with a
description.

     wait_event      | wait_event_type |        name         |
          description                          

---------------------+-----------------+---------------------+--------------------------------------------------------------
...
 WALWriteLock        | LWLock          | ø                   | ø
 SerializableXactHashLock | LWLock          | ø                   | ø
 SerializableFinishedListLock | LWLock          | ø                    | ø
 ProcArrayLock       | LWLock          | ø                   | ø

pg_wait_events.name does contain WALWrite, SerializableXactHash,
SerializableFinishedList or
 ProcArray, but not WALWriteLock, SerializableXactHashLock,
SerializableFinishedListLock, ProcArrayLock.

If I understand correctly, the names of LWLocks are defined in
src/include/storage/lwlocklist.h, and the PG_LWLOCK macro adds 'Lock'
(lwlock.c) ; while the doc and pg_wait_events are generated from the content
of src/backend/utils/activity/wait_event_names.txt, that does not contain
the 'Lock' suffix.

If it cannot be improved, I suggest that the query at the end of
https://www.postgresql.org/docs/17/monitoring-stats.html#WAIT-EVENT-ACTIVITY-TABLE
should use "LEFT OUTER JOIN pg_waits_events", to avoid removing lines.

Thanks,


pgsql-bugs by date:

Previous
From: Nathan Bossart
Date:
Subject: Re: BUG #18711: Attempting a connection with a database name longer than 63 characters now fails
Next
From: Tom Lane
Date:
Subject: Re: BUG #18711: Attempting a connection with a database name longer than 63 characters now fails