Re: Fix pg_stat_get_backend_wait_event() for aux processes

From: Andres Freund <andres(at)anarazel(dot)de>
To: Sami Imseih <samimseih(at)gmail(dot)com>
Cc: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, Robert Haas <robertmhaas(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Fix pg_stat_get_backend_wait_event() for aux processes
Date: 2026-02-05 16:58:41
Message-ID: 7ik7bb7vujldmeq2lfonoqzdmnmfwejr643kdjhfqdejhroh7v@dd3oilvh5yg2
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2026-02-04 17:48:57 -0600, Sami Imseih wrote:
> >
> > There is also a discussion [0] about wait event/activity field
> > inconsistency
> > with pg_stat_activity with a repro in [1].
>
>
> The repro I was referring to in [1] is actually
> https://www.postgresql.org/message-id/ab1c0a7d-e789-5ef5-1180-42708ac6fe2d%40postgrespro.ru

That is inherent. The wait event is updated in an unsynchronized fashion. As
noted in that thread.

Making it synchronized (via st_changecount) would make wait event overhead
vastly higher.

Greetings,

Andres Freund

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2026-02-05 17:14:27 Re: FileFallocate misbehaving on XFS
Previous Message Nazir Bilal Yavuz 2026-02-05 16:56:24 Re: Don't synchronously wait for already-in-progress IO in read stream