model-writtenrun 3859 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Kyotaro Horiguchi reported that pg_walfile_name_offset() paired the preceding segment filename with offset zero at segment boundaries and proposed subtracting one byte from the supplied LSN before calculating both results #1.
- Jehan-Guillaume de Rorthais objected that shifting every offset could regress existing tools and make offsets disagree with their LSNs, suggesting a segment-length offset at the boundary instead #2.
- Four years later, Bruce Momjian revived the issue with both the original approach and an alternative that returns the segment containing the supplied LSN; Matthias van de Meent corrected the swapped attachment descriptions and favored the latter because it avoids underflow at zero #3 #4.
- Bruce selected the current-LSN approach and extended it to pg_walfile_name(); Michael Paquier checked the other XLByteToPrevSeg callers and recommended avoiding backpatches, which Bruce accepted because the behavior change is incompatible #5 #6 #7.
- Andres Freund supplied segment-size-independent boundary test queries, which Michael supported and Bruce incorporated while removing documentation and comments describing the old behavior #8 #9 #10.
- Andres then identified an additional regression test that assumed a fixed segment size, and Bruce removed that test while retaining the portable boundary tests #11 #12.
- Bruce committed the final patch unchanged apart from rebase metadata as 344afc7769, crediting Kyotaro as co-author and Andres as test author, and closed the thread by announcing its application to master without backpatches #12 #13.