pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Melanie Plageman <melanieplageman@gmail.com>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix test_aio read_buffers() to work without cassert
Date: Tue, 31 Mar 2026 19:05:44 +0000
Message-ID: <E1w7ePH-002Lkx-0y@gemulon.postgresql.org> (raw)

Fix test_aio read_buffers() to work without cassert

In a production build, StartReadBuffers() doesn't populate all fields
of a ReadBuffersOperation for a buffer hit because no callers use them
(they are populated in assert builds).

read_buffers() (a test-only function) relied on some of these fields, so
AIO tests failed on non-assert builds (discovered on the buildfarm after
commit 020c02bd908).

Fix by tracking the required information ourselves in read_buffers() and
avoiding reliance on the ReadBuffersOperation unless we know that we did
IO.

Reported-by: Alexander Lakhin <exclusion@gmail.com>
Author: Melanie Plageman <melanieplageman@gmail.com>
Reviewed-by: Andres Freund <andres@anarazel.de>
Discussion: https://postgr.es/m/9ce8f5d8-8ab2-4aa2-b062-c5d74161069c%40gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/8519251ee975a8cca16fb35d699c1a39f2d217a1

Modified Files
--------------
src/test/modules/test_aio/test_aio.c | 22 ++++++++++------------
1 file changed, 10 insertions(+), 12 deletions(-)



Message-ID: <E1w7ePH-002Lkx-0y@gemulon.postgresql.org>
Permalink:  ../E1w7ePH-002Lkx-0y@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1w7ePH-002Lkx-0y@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: melanieplageman@gmail.com, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Fix test_aio read_buffers() to work without cassert
  In-Reply-To: <E1w7ePH-002Lkx-0y@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