model-writtenrun 6871 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Antonin Houska traced corruption exposed by REPACK stress testing to decoding a commit record before CLOG was updated, and supplied a reproducer showing both incorrect query results and persistent corruption from wrongly set hint bits #1.
- Antonin proposed polling CLOG before building decoding snapshots #2, but Andres Freund questioned whether ordinary MVCC visibility also required the transaction to leave ProcArray #3; Antonin explained that waiting during streaming decoding could deadlock synchronous replication #5.
- Alvaro Herrera explained the commit, CLOG, synchronous-replication, and ProcArray ordering, then proposed reorganizing polling to avoid repeatedly checking transactions already known committed #6 #7 #8.
- Alvaro posted the revised polling patch alongside an experiment that omitted still-running transactions from snapshots, while reporting subscription-test failures with that alternative #13; Antonin raised further concerns about TransactionIdIsInProgress() shortcuts #14.
- After several months, Antonin renewed the push for a release fix #16, and Alvaro returned to CLOG polling with a cache intended to reduce repeated status checks and potential I/O #17.
- Zhijie Hou identified stale-cache and XID-wraparound risks and proposed limiting ProcArray waits to SnapBuildInitialSnapshot(), whose callers do not stream changes to synchronous subscribers #18.
- Noah Misch emphasized that REPACK could automatically discard the last good copy of a table after replication-related data loss #22, and Alvaro committed to fixing the problem before release #23.
- Rui Zhao replaced polling with a single running-transaction scan and transaction-lock waits during initial MVCC snapshot construction, explaining why historic snapshots need no additional wait and reporting successful regression testing #25.
- Rui also supplied deterministic REPACK and USE_SNAPSHOT tests that reproduced missing changes and publisher-side hint-bit corruption without the fix, overcoming the original isolation-test blocking problem #25.
- Zhijie independently demonstrated that an exported snapshot could see a transaction still present in ProcArray #26; his reproducer expected the buggy behavior, so Alvaro did not use it as a passing regression test for the fix #32.
- Antonin accepted restricting the wait to initial snapshots and suggested placing it in the existing XID-inversion loop #27 #31, which Alvaro implemented and tested #32.
- Rui found that this revision counted uninitialized snapshot entries, supplied a corrective delta and test assertion, and explained why filtering against one captured running-XID list avoids repeated lock-manager and ProcArray work #34.
- Alvaro posted a filtered inversion-loop variant incorporating Rui's correction, but favored returning to Rui's original loop instead #35 #36; Rui agreed to omit redundant subtransaction waits and clarify the separation between historic and ordinary MVCC snapshots #37.
- The supplied commit 070e21268b takes the core fix from #25, limits waiting to top-level transactions, and revises the comments; its inspected diff contains no test files.
- Although the originating REPACK discussion thread #51992 also claims 070e21268b as arising from discussion, the matching implementation was subsequently submitted in this thread at #25, establishing this thread as the patch source.
- Alvaro announced that the fix had been pushed to all supported branches, with tests on branches supporting the required facilities, and closed the release open items; documenting the top-level-first running-XID ordering was left as follow-on work #38.