model-writtenrun 3053 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Michael Paquier proposed preserving statistics across crashes by flushing them after non-shutdown checkpoints and restart points, storing the checkpoint redo LSN inside the statistics file, and retaining the existing shutdown callback; he deliberately avoided LSN-based filenames and directory cleanup in #1.
- Konstantin Knizhnik questioned discarding older statistics and proposed durable writes in #2, while Tomas Vondra raised corruption and stale autovacuum-counter concerns in #3; Michael explained that missing statistics already suppress ordinary vacuum and analyze decisions, arguing that retaining older statistics could improve matters, and accepted durability as an independent improvement in #4.
- Michael first landed the unchanged process-context assertion from #1 as 734c057a89, then posted a rebased series with a new durable_rename() prerequisite in #5.
- Bertrand Drouvot supported retaining older statistics in #6, approved the durability patch with a comment correction in #7, and identified a crash-before-next-checkpoint case where unlinking the restored statistics file would lose the saved statistics in #8.
- Michael incorporated Bertrand's comment and committed the durability prerequisite from #5 as ec678692f6, announcing it in #10; the remaining series in #11 also stopped unlinking successfully read statistics and updated restart tests.
- Bertrand requested clearer redo-LSN and format-error diagnostics and corrected comments in #12; Michael expanded this into a separate statistics-file diagnostic patch and revised the redo-LSN validation in #13, while declining a redundant assertion because the underlying write routine already checked the process context.
- Bertrand reviewed the expanded diagnostics and approved the redo-LSN and flushing patches in #14; Michael clarified in #15 that the unrelated vacuum-test revert attached to #13 should be ignored, added data-size and invalid-entry-type warnings, and landed the diagnostics as ca1ba50fcb.
- After Bertrand confirmed the remaining patches still looked good in #16, Michael committed the redo-LSN prerequisite from #15 as b860848232, adding redo LSNs to both read and write DEBUG2 messages and posting only the outstanding checkpoint-flushing patch in #17.
- Michael rebased the remaining patch and adapted injection-point tests to retained crash statistics in #18; Bertrand reviewed those adjustments and found them satisfactory in #19.
- Heikki Linnakangas identified potential persistent orphaned statistics entries and a repeated-crash scenario producing a redo-LSN mismatch, which he attributed to missing statistics flushing at the end-of-recovery checkpoint, in #20; he also raised propagating selected statistics to standbys.
- At the thread's close, Michael kept statistics replication outside this effort, expressed concern about the cost of restoring autovacuum-based garbage collection, and promised to investigate the recovery-checkpoint omission in #21; the four preparatory commits had landed, but checkpoint-time statistics persistence remained under review with those correctness questions unresolved.