model-writtenrun 7082 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Thomas Munro opened the thread with six patches preparing read streams for asynchronous and out-of-order I/O: circular-index helpers, larger buffer queues, dynamic pin limits, and buffer forwarding #1.
- The forwarding design kept buffers pinned between short reads instead of unpinning and repinning them, preserving the two-step start/wait API and leaving the single-block fast path unaffected; Thomas explained how this recovered the benefits of an earlier three-step design #1 #3.
- Kirill Reshke questioned the circular-index assertions, and Thomas explained why temporary wraparound beyond queue_size was valid; that helper refactor disappeared from subsequent submissions without a stated reason #2 #4 #9.
- Andres Freund reported that temporary-table tests reproduced the pin-limit problem and passed with the patches, but Thomas then found that callbacks could acquire pins after the limit check and delayed committing the pin-limit changes #5 #6 #7.
- The queue-capacity patch from #1 landed separately as 55918f798b, with capacity expanded further to include one completed but unconsumed I/O in addition to the configured concurrency.
- Thomas returned with pin checks moved directly into the I/O-start function, plus changes to keep issuing advice across large sequential chunks after random jumps and to make look-ahead depend on cache hits and misses rather than sequentiality #9.
- Andres argued that starting a stream with no unpinned buffers could legitimately fail, questioned the exhaustion logic, and requested clearer advice flags and the name seq_until_processed; Thomas adopted the naming and advice cleanup, corrected the progress condition, and restored the forwarding patches #10 #11.
- The pin-limit API and its read-stream caller landed from #11 as 01261fb078 and 92fc6856cb, with Soft removed from API names, comments revised, and an unrelated reset change deferred; Thomas supplied a multi-cursor reproduction and retained the decision against backpatching #12.
- The advice improvement developed in #11 landed as 7ea8cd1566, with additional changes to advice gating and sequential-region completion handling; attribution belongs to thread #49191, where Melanie Plageman forwarded Thomas's patch in the later matching attachment #585985.
- The distance simplification from #11 landed as 799959dc7c, retaining rapid growth after I/O but omitting the proposed direct-I/O concurrency override.
- Andres subsequently found a temporary-buffer exhaustion test failing on FreeBSD CI, and Thomas made its intended one-page-per-cursor behavior explicit with a bounded ctid predicate, which passed that CI task; the underlying platform-dependent pin-count difference remained unexplained #13 #14.
- Both forwarding patches from #11 landed as ed0b87caac and ce1a75c4fe, with comment cleanup, adaptation to the current stream combine limit, and additional buffer-manager assertions.
- Andres then reported that adding forwarded buffers could overflow the 16-bit pin allowance with large shared_buffers, while Thomas considered converting the stream's integer types more broadly #15 #16.
- At the thread's last exchange, Thomas authorized Andres's minimal fix; it subsequently landed as 8ce79483dc, widening buffer_limit and clamping after addition, while broader integer-type cleanup and the earlier local-buffer policy questions remained outside the completed changes #11 #12 #17 #18.