| From: | Michael Paquier <michael(at)paquier(dot)xyz> |
|---|---|
| To: | Lukas Fittl <lukas(at)fittl(dot)com> |
| Cc: | Andres Freund <andres(at)anarazel(dot)de>, Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(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-05 05:33:40 |
| Message-ID: | auwVNOik4oOhAIjv@paquier.xyz |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Wed, Nov 04, 2026 at 04:10:08PM -0800, Lukas Fittl wrote:
> Basically the original approach on this thread here is ugly, but it
> works, doesn't have performance impact, and is easy to reason about.
> I'm advocating for getting this in to both master and the back
> branches, and then separately work on solving it more elegantly, which
> in my perspective makes most sense in combination with the stack-based
> instrumentation thread you linked.
It still feels itchy because that's still abusing of what I think
should not be the definition of pgWalUsage, and it's a workaround.
I'm wondering if Andres' extra argument about just breaking pgWalUsage
to not include worker data would not be the best move, actually, even
on stable branches.. That feels risky, still simpler logic links to a
simpler definition of these objects, not mixing more concepts into
them.
> As it stands the other thread on stack-based instrumentation does not
> solve this problem (yet), but it contains the prerequisite
> infrastructure that's needed, because it avoids the global counters
> (pgWalUsage, etc) that move forward as activity happens, and instead
> records into the current stack entry that then accumulates into the
> parent separately on query end. I'm working on an updated version for
> that thread that illustrates how that helps us with the problem at hand.
Ah, OK. Good to now, even if that does not address the double
counting.
--
Michael
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Chao Li | 2026-11-05 05:39:24 | Re: -Wcast-qual home stretch |
| Previous Message | Chao Li | 2026-11-05 05:27:04 | Re: Fix DEFAULT marker handling in COPY FROM ... HEADER MATCH |