Re: Don't synchronously wait for already-in-progress IO in read stream

Peter Geoghegan <pg@bowt.ie>

From: Peter Geoghegan <pg@bowt.ie>
To: Andres Freund <andres@anarazel.de>
Cc: pgsql-hackers@postgresql.org, Tomas Vondra <tv@fuzzy.cz>, Thomas Munro <thomas.munro@gmail.com>
Date: 2025-11-09T19:51:08Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. bufmgr: Improve StartBufferIO interface

  2. test_aio: Add basic tests for StartReadBuffers()

  3. test_aio: Add read_stream test infrastructure & tests

  4. bufmgr: Make buffer hit helper

  5. bufmgr: Pass io_object and io_context through to PinBufferForBlock()

  6. bufmgr: Restructure AsyncReadBuffers()

  7. aio: Refactor tests in preparation for more tests

On Thu, Sep 11, 2025 at 5:46 PM Andres Freund <andres@anarazel.de> wrote:
> The problem leading to that is that we are currently synchronously waiting for
> IO on a buffer when AsyncReadBuffers() encounters a buffer already undergoing
> IO. If a block is read twice, that means we won't actually have enough IOs in
> flight to have good performance. What's worse, currently the wait is not
> attributed to IO wait (since we're waiting in WaitIO, rather than waiting for
> IO).

This patch no longer cleanly applies. Can you post a new version?

Thanks
-- 
Peter Geoghegan