localbuf: Add Valgrind buffer access instrumentation

Andres Freund <andres@anarazel.de>

Commit: 8ab4241b9f4f73f2168bcaebc990f8b0a6b7bc81
Author: Andres Freund <andres@anarazel.de>
Date: 2025-04-07T19:20:30Z
Releases: 18.0
localbuf: Add Valgrind buffer access instrumentation

This mirrors 1e0dfd166b3 (+ 46ef520b9566), for temporary table buffers. This
is mainly interesting right now because the AIO work currently triggers
spurious valgrind errors, and the fix for that is cleaner if temp buffers
behave the same as shared buffers.

This requires one change beyond the annotations themselves, namely to pin
local buffers while writing them out in FlushRelationBuffers().

Reviewed-by: Noah Misch <noah@leadboat.com>
Co-authored-by: Noah Misch <noah@leadboat.com>
Discussion: https://postgr.es/m/3pd4322mogfmdd5nln3zphdwhtmq3rzdldqjwb2sfqzcgs22lf@ok2gletdaoe6

Files

PathChange+/−
src/backend/storage/buffer/bufmgr.c modified +13 −0
src/backend/storage/buffer/localbuf.c modified +25 −0

Discussion

  • AIO v2.0 213 messages · 2024-09-01 → 2025-07-29