]> 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:08:13 +0000 (10:08 -0400)
committerAndres Freund <andres@anarazel.de>
Thu, 26 Mar 2026 14:08:13 +0000 (10:08 -0400)
commitfb072e1721230a483f3aa299bcffbe0b8602b2c4
tree2a7712fd97f808246a41c0e14397f342d67ee17d
parent98e96e579b917f87336d82228b889feb2ffe9ddd
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