Re: "duplicated" wait events - Mailing list pgsql-hackers

From Drouvot, Bertrand
Subject Re: "duplicated" wait events
Date
Msg-id e81ca8a9-1d11-110c-1e62-87348b6a2986@gmail.com
Whole thread Raw
In response to Re: "duplicated" wait events  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
List pgsql-hackers
Hi,

On 8/7/23 7:46 AM, Kyotaro Horiguchi wrote:
> At Fri, 4 Aug 2023 17:07:51 +0200, "Drouvot, Bertrand" <bertranddrouvot.pg@gmail.com> wrote in
>> SynRep currently appears in "IPC" and "LWLock" (see [2])
>> WALWrite currently appears in "IO" and "LWLock" (see [2])
>>
>> I think that can lead to confusion and it would be better to avoid
>> duplicate wait event
>> name across Wait Class (and so fix those 2 ones above), what do you
>> think?
> 
> I think it would be handy to be able to summirize wait events by event
> names, instead of classes. In other words, grouping wait events
> through all classes according to their purpose. From that perspective,
> I'm rather fan of consolidating event names (that is, the opposite of
> your proposal).
> 

I could agree if they had the same descriptions and behaviors.

For example with WALWrite:

WALWrite in "IO" is described as "Waiting for a write to a WAL file" and
is described in "LWLock" as "Waiting for WAL buffers to be written to disk".
Having two distinct descriptions seems to suggest the wait events are not the same.

Also I think it makes sense to distinguish both as the LWLock one could
be reported as waiting in LWLockReportWaitStart() while trying to grab the
lock in LW_SHARED mode (as done in GetLastSegSwitchData()).

I think there is 2 things to address:

1) fix the current duplicates
2) put safeguard in place

As far 1), it could be easily done by updating wait_event_names.txt (renaming duplicates)
in the master branch. As the duplication has been introduced in 14a9101091
(so starting as of PG 13) we would need to update monitoring.sgml for <= 16 should we want to
back patch.

2) could be handled in generate-wait_event_types.pl on master.

Regards,

-- 
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com



pgsql-hackers by date:

Previous
From: Yuya Watari
Date:
Subject: Re: [PoC] Reducing planning time when tables have many partitions
Next
From: "Drouvot, Bertrand"
Date:
Subject: Re: WIP: new system catalog pg_wait_event