Re: Add new wait event to XactLockTableWait - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Add new wait event to XactLockTableWait
Date
Msg-id aEYRgDVS4lflxUyr@paquier.xyz
Whole thread Raw
In response to Add new wait event to XactLockTableWait  (Xuneng Zhou <xunengzhou@gmail.com>)
Responses Re: Add new wait event to XactLockTableWait
List pgsql-hackers
On Sun, Jun 08, 2025 at 10:30:45PM +0800, Xuneng Zhou wrote:
> This is more problematic in logical replication scenarios where these
> waits can be very long - for example, when creating a logical
> replication slot on a busy system. Without a specific wait event, it's
> hard to distinguish legitimate wait from other issues.

Gotcha.

> Based on suggestions from Fujii and Kevin [1], the patch introduces
> WAIT_EVENT_XACT_DONE ("Waiting for a transaction to commit or abort")
> and instructs both functions to report this event during their
> pg_usleep() calls  With patch applied, when backends are waiting in
> these functions, pg_stat_activity will show what they're waiting for.

+     pgstat_report_wait_start(WAIT_EVENT_XACT_DONE);
[...]
+     pgstat_report_wait_start(WAIT_EVENT_XACT_DONE);

Wouldn't it be better to use two wait events named differently to be
able to make the difference between the two code paths?
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: amcheck support for BRIN indexes
Next
From: Thomas Munro
Date:
Subject: Re: Non-reproducible AIO failure