Incremental Update: Review Feedback and Series Reordering Discussion
Summary
The thread received substantive review feedback from two reviewers (Sami Imseih and Michael Paquier), leading the author (Lukas Fittl) to consider reordering the patch series and deferring patch 0001 (unified Instrumentation struct).
Key Technical Debate: Memory Overhead of Unified Instrumentation Struct
The central new technical disagreement is about patch 0001's approach of replacing separate BufferUsage + WalUsage with a larger Instrumentation struct in DSM shared memory:
-
Michael Paquier's concern:
Instrumentationis larger thanWalUsage+BufferUsagecombined, and contains fields (like_startfields) that workers have no use for. This increases DSM footprint unnecessarily and is conceptually confusing — why push fields to workers that they'll never use? -
Sami Imseih's counter-argument: The actual overhead is 192 bytes per worker (360 bytes for
Instrumentationvs 168 bytes forBufferUsage+WalUsage). Even at 32 workers, that's only ~6 KB — negligible compared to the code cleanup benefits. -
Lukas Fittl's resolution: Acknowledges both points. Notes that the overhead would be much smaller once/if the stack-based instrumentation approach lands (which would eliminate the
_startfields). Proposes reordering the series to lead with the less controversial patches (0003 query text helpers, 0004 shared parallel index build helpers) and deferring 0001/0002 until the stack-based instrumentation design is settled.
Specific Review Comments on Individual Patches
0003 (Query Text Helpers):
- Sami initially went back-and-forth on
RestoreParallelQueryText()combiningdebug_query_stringassignment withpgstat_report_activity(), but concluded it's acceptable for deduplication purposes. - Comment accuracy issue: "no-op (leaving debug_query_string NULL)" is inaccurate — it does set
debug_query_stringto NULL (not truly a no-op). - Michael sees "nice advantages" in this patch — less duplicated logic across three parallel worker callbacks.
0004 (Shared Parallel Index Build Helpers):
- Sami notes "lossy AMs" comment is inaccurate — GIN doesn't use
havedead/brokenhotchainfields but isn't lossy. - Typo: extra space before "launched" in comment.
- Important structural feedback: The GIN queryid fix mentioned in 0004's commit message should be split into its own independent patch and placed first in the series.
- Michael praises the lock-level and snapshot deduplication as "quite beneficial in the long-term."
- Both reviewers agree that extending deduplication to parallel VACUUM is unnecessary — the operations are too different.
Emerging Consensus
- Patches 0003 and 0004 have strong support from both reviewers
- Patches 0001 and 0002 are controversial due to the memory overhead / unused fields concern
- The GIN queryid bugfix should be separated out
- The series will likely be reordered with 0003/0004 leading