bufmgr: Return whether WaitReadBuffers() needed to wait
Andres Freund <andres@anarazel.de>
bufmgr: Return whether WaitReadBuffers() needed to wait Thanks to the previous commit, pgaio_wref_check_done() will now detect whether IO has completed even if userspace has not yet consumed the kernel completion. This knowledge can be useful for callers of WaitReadBuffers() to know whether it needed to wait or not, e.g. for adjusting read-ahead aggressiveness or for instrumentation. Reviewed-by: Melanie Plageman <melanieplageman@gmail.com> Reviewed-by: Nazir Bilal Yavuz <byavuz81@gmail.com> Discussion: https://postgr.es/m/f3xxfrkafjxpyqxywcxricxgyizjirfceychyxsgn7bwjp5eda@kwbduhy7tfmu Discussion: https://postgr.es/m/CAH2-Wz%3DkMg3PNay96cHMT0LFwtxP-cQSRZTZzh1Cixxf8G%3Dzrw%40mail.gmail.com Discussion: https://postgr.es/m/a177a6dd-240b-455a-8f25-aca0b1c08c6e@vondra.me
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/storage/buffer/bufmgr.c | modified | +16 −1 |
| src/include/storage/bufmgr.h | modified | +1 −1 |
Discussion
- AIO / read stream heuristics adjustments for index prefetching 23 messages · 2026-03-31 → 2026-04-05
- index prefetching 492 messages · 2023-06-08 → 2026-07-07
- EXPLAIN: showing ReadStream / prefetch stats 53 messages · 2026-03-15 → 2026-05-04