From: | Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com> |
---|---|
To: | christophe(dot)courtois(at)dalibo(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org, alvherre(at)alvh(dot)no-ip(dot)org |
Subject: | Re: BUG #18728: Inconsistency between pg_wait_events.name and pg_stat_activity.wait_event for LWLocks |
Date: | 2024-11-28 11:27:02 |
Message-ID: | Z0hThk/ySU8ZeICy@ip-10-97-1-34.eu-west-3.compute.internal |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
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(dot)courtois(at)dalibo(dot)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).
From what I can see, the issue has been introduced in da952b415f that added
back the "Lock" suffix into the LWLock wait event names. I'm saying "added back"
because the "Lock" suffix was removed in 14a9101091.
I looked at the thread ([1]) that lead to da952b415f and I don't see that the
intention was to "revert" 14a9101091.
So, it seems to me that the thing to do would be to remove the "Lock" suffix from
the LWLock wait event names.
Adding Álvaro in the loop to get his thoughts on it.
Regards,
--
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com
From | Date | Subject | |
---|---|---|---|
Next Message | Vladyslav Hutych | 2024-11-28 12:03:56 | Dropping partition with CASCADE drops constraints on partitioned table |
Previous Message | Bertrand Drouvot | 2024-11-28 08:12:05 | Re: BUG #18711: Attempting a connection with a database name longer than 63 characters now fails |