Re: Fix cumulative WAL statistics double-counting from parallel workers

From: Andres Freund <andres(at)anarazel(dot)de>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>, Lukas Fittl <lukas(at)fittl(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Ahmed Gouda <gouda0x(at)gmail(dot)com>, Bernd Reiß <bd_reiss(at)gmx(dot)at>
Subject: Re: Fix cumulative WAL statistics double-counting from parallel workers
Date: 2026-11-04 18:11:17
Message-ID: zaqq7d7olykclgta23mkqoianaolkqu7rhpix5tqsy2aolmdj3@vvgnacqcbeiy
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2026-11-02 18:32:18 +0900, Michael Paquier wrote:
> On Mon, Nov 02, 2026 at 08:41:15AM +0000, Bertrand Drouvot wrote:
> > On Mon, Nov 02, 2026 at 05:16:29PM +0900, Michael Paquier wrote:
> >> If I am reading the patch right, it means that a leader's pgWalUsage
> >> includes both its own activity *and* the activity of its workers. It
> >> sounds to me like a mistake to do that. Why aren't pgWalUsage and
> >> friends handled in such a way that they only include the activity of
> >> their own process?
> >
> > Wouldn't that change the semantics of pgWalUsage for out of core extensions using
> > it (if any) the same way as PGSS? We can adjust PGSS, but those extensions would
> > start seeing leader only activity once running a version with this change?
>
> We don't have to change the meaning of pgWalUsage in the stable branches.

FWIW, I think it'd be fine to change the behavior in the back branches in this
case. As it is today, it is inaccurate, so the numbers such extensions were
collecting weren't right already. And depending on what hook the extension is
using to collect the information, I think the answer what number we ought to
present is not very clear anyway.

- Andres

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Burd 2026-11-04 18:23:50 Re: Hash index inserts serialise on the metapage tuple counter
Previous Message Shlok Kyal 2026-11-04 18:08:21 Re: Support EXCEPT for ALL SEQUENCES publications