Re: Stack-based tracking of per-node WAL/buffer usage

Andres Freund <andres@anarazel.de>

From: Andres Freund <andres@anarazel.de>
To: Lukas Fittl <lukas@fittl.com>
Cc: Heikki Linnakangas <hlinnaka@iki.fi>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, Zsolt Parragi <zsolt.parragi@percona.com>, Tomas Vondra <tomas@vondra.me>, Peter Smith <smithpb2250@gmail.com>
Date: 2026-04-05T23:12:08Z
Lists: pgsql-hackers
Hi,

On 2026-04-05 17:02:28 -0400, Andres Freund wrote:
> With that I pushed 0001.

For 0002 I:
- fixed a few comments still refering to node in the generic Instr* functions
- added comment about the async_mode buglet to the commit message
- added an async_mode argument to InstrInitNode(), as its callsite already
  needed to be touched, and it felt wrong that InstrAllocNode() could do
  things that were not possible with InstrInitNode()
- Deduplicated the code between InstrStop() and InstrStotNode() by introducing
  InstrStopCommon()

After those (and some testing) I pushed this.

Greetings,

Andres Freund



Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. instrumentation: Allocate query level instrumentation in ExecutorStart

  2. instrumentation: Move ExecProcNodeInstr to allow inlining

  3. instrumentation: Separate per-node logic from other uses

  4. instrumentation: Separate trigger logic from other uses

  5. instrumentation: Rename INSTR_TIME_LT macro to INSTR_TIME_GT

  6. instrumentation: Keep time fields as instrtime, convert in callers