]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix off-by-one error in read IO tracing
authorAndres Freund <andres@anarazel.de>
Thu, 26 Mar 2026 14:07:59 +0000 (10:07 -0400)
committerAndres Freund <andres@anarazel.de>
Thu, 26 Mar 2026 14:38:56 +0000 (10:38 -0400)
commitcf66978d7990b219a2eda03c3d4f978f68d046d3
treec4a21aae293cecb091f05e6d0137f78e14c6b5f1
parent906a0469728e1dead174e0b738337f6f07a99601
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
src/backend/storage/buffer/bufmgr.c