model-writtenrun 1721 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Vignesh Ravichandran opened the thread after observing that unchanged WAL files accounted for more than 95% of copied data in many production rewinds, asking whether older common WAL could be skipped #1.
- Justin Kwan supplied an implementation credited to himself and Vignesh that skipped segments preceding the divergence segment, initially targeting PostgreSQL 15 beta and then adapting it to PostgreSQL 14.4 #2 #3.
- Tom Lane directed the feature toward development master, while Michael Paquier warned against filesystem timestamp tests; Justin consequently retargeted the patch and replaced timestamp assertions with log checks #4 #6 #7.
- Alexander Korotkov supported the approach but requested calculated WAL filenames and proper indentation, and Andres Freund supplied a test-log-path fix while warning that reading a shared regression log could confuse separate rewind runs #9 #10.
- Michael Paquier recommended command_checks_all(), explicit file-content classification and care around source/target existence assumptions; with no revision forthcoming, he returned the submission with feedback in November 2022 #11 #12.
- John Hsu revived the work in July 2025, adapting it to current master and introducing relation/WAL/other classification; he explained that an existing assertion now covered the helper's source/target existence precondition #13.
- Japin Li's reviews led John to move the WAL decision helper into filemap.c, rename the classifier and temporarily use global divergence state, after which Japin gave an LGTM #14 #17 #18 #19.
- The discussion also considered skipping log directories, but John favored preserving pg_rewind's existing copying behavior and offered a separate documentation change; that idea was not included in the submitted implementation #16 #18.
- John discovered that the revised tests were ineffective and replaced them with a dedicated common-WAL test #21.
- Robert Haas endorsed the optimization but requested complete-path classification, equal-size checks and explicit parameter passing; John implemented those changes and added timestamp-based verification of skipped copying #22 #23.
- Srinath Reddy Sadipiralla questioned whether the divergence-segment comparison was necessary, but Robert explained that a partially written segment could differ between servers, so the comparison was retained #24 #30.
- Srinath requested unequal-size WAL coverage and supplied a fix-up with clearer variables, stronger assertions and a longer timestamp delay; John incorporated it while reusing existing file-map logging #26 #27 #28 #32.
- Robert and John resisted expanding the patch into comprehensive validation of manually altered WAL files, while Srinath's remaining review produced documentation and presentation improvements #31 #33 #36 #39.
- Michael Paquier extracted the classifier from #39 and committed it with equivalent implementation cleanup as 6ae08d9583, then posted the remaining optimization and registered its renamed test in meson.build #41.
- Michael again challenged timestamp-based tests and proposed printing every WAL file action; Srinath supplied an inline adjustment, and Michael accepted debug-output and size checks without additional post-rewind queries or timestamp comparisons #41 #43 #45.
- Robert opposed adding checks for deliberately malformed equal-size WAL files, and the final attachment retained the existing size comparison while removing timestamp tests and sleeps #42 #46.
- Srinath tested the final attachment with substantial WAL retention, reported a large reduction in copied data, and identified a comment typo and obsolete stat code; Michael incorporated those light edits and committed #46 as 5173bfd044 #47 #48.
- After both changes landed, Michael suggested checksum comparisons as a possible further safeguard, but Robert argued that reading both copies would undermine the performance gain and that pg_rewind should rely on PostgreSQL-specific invariants; the thread ended with both commits landed and no checksum patch submitted #50 #51.