pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedBUG #18728: Inconsistency between pg_wait_events.name and pg_stat_activity.wait_event for LWLocks
3+ messages / 2 participants
[nested] [flat]
Commits from this thread:
2024-12-03 1e5ef3a2a1 5ffbbcfa16 Drop "Lock" suffix from LWLock wait event names
* BUG #18728: Inconsistency between pg_wait_events.name and pg_stat_activity.wait_event for LWLocks
@ 2024-11-27 18:15 PG Bug reporting form <noreply@postgresql.org>
2024-11-28 11:27 ` Re: BUG #18728: Inconsistency between pg_wait_events.name and pg_stat_activity.wait_event for LWLocks Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
0 siblings, 1 reply; 3+ messages in thread
From: PG Bug reporting form @ 2024-11-27 18:15 UTC (permalink / raw)
To: pgsql-bugs@lists.postgresql.org; +Cc: christophe.courtois@dalibo.com
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,
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: BUG #18728: Inconsistency between pg_wait_events.name and pg_stat_activity.wait_event for LWLocks
2024-11-27 18:15 BUG #18728: Inconsistency between pg_wait_events.name and pg_stat_activity.wait_event for LWLocks PG Bug reporting form <noreply@postgresql.org>
@ 2024-11-28 11:27 ` Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2024-12-02 08:36 ` Re: BUG #18728: Inconsistency between pg_wait_events.name and pg_stat_activity.wait_event for LWLocks Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
0 siblings, 1 reply; 3+ messages in thread
From: Bertrand Drouvot @ 2024-11-28 11:27 UTC (permalink / raw)
To: christophe.courtois@dalibo.com; pgsql-bugs@lists.postgresql.org; alvherre@alvh.no-ip.org
Hi,
On Wed, Nov 27, 2024 at 06:15:20PM +0000, PG Bug reporting form wrote:
> 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.
Thanks for the report!
Yeah, LWLock are displayed as <wait_event>Lock in pg_stat_activity
while mentioned as <wait_event> in the doc (and so in pg_wait_events).
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: BUG #18728: Inconsistency between pg_wait_events.name and pg_stat_activity.wait_event for LWLocks
2024-11-27 18:15 BUG #18728: Inconsistency between pg_wait_events.name and pg_stat_activity.wait_event for LWLocks PG Bug reporting form <noreply@postgresql.org>
2024-11-28 11:27 ` Re: BUG #18728: Inconsistency between pg_wait_events.name and pg_stat_activity.wait_event for LWLocks Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
@ 2024-12-02 08:36 ` Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
0 siblings, 0 replies; 3+ messages in thread
From: Bertrand Drouvot @ 2024-12-02 08:36 UTC (permalink / raw)
To: christophe.courtois@dalibo.com; pgsql-bugs@lists.postgresql.org; alvherre@alvh.no-ip.org
Hi,
On Thu, Nov 28, 2024 at 11:27:02AM +0000, Bertrand Drouvot wrote:
> So, it seems to me that the thing to do would be to remove the "Lock" suffix from
> the LWLock wait event names.
>
Proposed that way in [1].
[1]: https://www.postgresql.org/message-id/flat/Z01w1%2BLihtRiS0Te%40ip-10-97-1-34.eu-west-3.compute.inte...
Regards,
--
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2024-12-02 08:36 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-11-27 18:15 BUG #18728: Inconsistency between pg_wait_events.name and pg_stat_activity.wait_event for LWLocks PG Bug reporting form <noreply@postgresql.org>
2024-11-28 11:27 ` Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
2024-12-02 08:36 ` Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox