model-writtenrun 1190 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Andres Freund opened the thread in #1 after Tomas Vondra investigated failures exposed by index prefetching: gistGetFakeLSN() could request a flush beyond the last WAL record when it ended at a page boundary, so Andres proposed using XLogBytePosToEndRecPtr().
- Andrey Borodin suggested using CurrBytePos directly in #2, but Andres explained in #4 that it excludes WAL page headers and therefore is not a physical LSN; Andrey accepted the required conversion in #6.
- Noah Misch endorsed the strategy and confirmed a reproducer in #3; Andres asked him to implement it and raised broader LSN validation ideas in #5.
- Tomas supplied the implementation in #7, reporting that it fixed failures on the development branch, and identified a similar walsender call; Fujii Masao explained in #8 that the walsender issue and an equivalent helper were already being discussed separately.
- Tomas committed #7 unchanged as b1f14c9672 and confirmed backpatching through PostgreSQL 14 in #9, making the helper available for the separate walsender fix.
- In #9, Tomas reported validating the fix on x86-64 and both ARM widths but abandoning a regression test because precise WAL alignment made it fragile; a proposed flush assertion also encountered GiST's special LSN value of 1, so broader validation remained outside the landed fix.