pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: christophe.courtois@dalibo.com
Subject: BUG #18728: Inconsistency between  pg_wait_events.name  and pg_stat_activity.wait_event  for LWLocks
Date: Wed, 27 Nov 2024 18:15:20 +0000
Message-ID: <18728-450924477056a339@postgresql.org> (raw)

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,



view thread (3+ messages)  latest in thread

Message-ID: <18728-450924477056a339@postgresql.org>
Permalink:  ../18728-450924477056a339@postgresql.org/
Also on:    postgresql.org/message-id/18728-450924477056a339@postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, christophe.courtois@dalibo.com
  Subject: Re: BUG #18728: Inconsistency between  pg_wait_events.name  and pg_stat_activity.wait_event  for LWLocks
  In-Reply-To: <18728-450924477056a339@postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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