Fix off-by-one error in read IO tracing

Andres Freund <andres@anarazel.de>

Commit: cf66978d7990b219a2eda03c3d4f978f68d046d3
Author: Andres Freund <andres@anarazel.de>
Date: 2026-03-26T14:38:56Z
Fix off-by-one error in read IO tracing

AsyncReadBuffer()'s no-IO needed path passed
TRACE_POSTGRESQL_BUFFER_READ_DONE the wrong block number because it had
already incremented operation->nblocks_done. Fix by folding the
nblocks_done offset into the blocknum local variable at initialization.

Author: Melanie Plageman <melanieplageman@gmail.com>
Reviewed-by: Andres Freund <andres@anarazel.de>
Discussion: https://postgr.es/m/u73un3xeljr4fiidzwi4ikcr6vm7oqugn4fo5vqpstjio6anl2%40hph6fvdiiria
Backpatch-through: 18

Files

PathChange+/−
src/backend/storage/buffer/bufmgr.c modified +3 −3

Discussion