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: signature.asc
Description: PGP signature

Reply via email to