pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix off-by-one error in read IO tracing
Date: Thu, 26 Mar 2026 14:47:46 +0000
Message-ID: <E1w5lzt-001YV0-2p@gemulon.postgresql.org> (raw)

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

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/fb072e1721230a483f3aa299bcffbe0b8602b2c4

Modified Files
--------------
src/backend/storage/buffer/bufmgr.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)



view thread (2+ messages)

Message-ID: <E1w5lzt-001YV0-2p@gemulon.postgresql.org>
Permalink:  ../E1w5lzt-001YV0-2p@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1w5lzt-001YV0-2p@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: andres@anarazel.de, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Fix off-by-one error in read IO tracing
  In-Reply-To: <E1w5lzt-001YV0-2p@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox