| From: | Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com> |
|---|---|
| To: | Michael Paquier <michael(at)paquier(dot)xyz> |
| Cc: | Lukas Fittl <lukas(at)fittl(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Andres Freund <andres(at)anarazel(dot)de>, 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-02 08:41:15 |
| Message-ID: | auhMq2+E14O9jFJh@bdtpg |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
Hi,
On Mon, Nov 02, 2026 at 05:16:29PM +0900, Michael Paquier wrote:
> On Thu, Oct 29, 2026 at 03:58:03PM -0700, Lukas Fittl wrote:
> > Instead, at least for now, the easier solution seems to be to
> > accumulate imported instrumentation data into both the existing
> > pg(Wal|Buffer)Usage globals, and a separate set called
> > pg(Wal|Buffer)UsageFromWorkers that counts only the activity from the
> > workers. Any caller that wants to isolate the leader-only activity for
> > reporting to the cumulative statistics system then subtracts the
> > worker portion from the global instrumentation using a helper function
> > (ComputeOwnWalUsage), and workers continue to report their own
> > activity directly to the cumulative statistics system.
>
> 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?
Regards,
--
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com
| From | Date | Subject | |
|---|---|---|---|
| Next Message | vignesh C | 2026-11-02 08:51:58 | Re: WAL record CRC calculated incorrectly because of underlying buffer modification |
| Previous Message | Bertrand Drouvot | 2026-11-02 08:33:19 | Re: Fix cumulative WAL statistics double-counting from parallel workers |