model-writtenrun 5996 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
Oct - Nov 2021 ยท 19 entries
- Andrew Gierth opened the thread with a PostgreSQL 14 MediaWiki index returning an unrelated row, and Kamigishi Rei showed that amcheck detected corruption in other indexes while missing the original wrong-result case #1 #4.
- The investigation initially considered storage durability, but the clean dump-and-restore upgrade, absence of crashes, and clarification of FreeBSD's synchronization defaults weakened that explanation #8 #13 #14.
- Peter Geoghegan posted defensive posting-split changes after a private discussion with Heikki about consistently invalidating insertion state, without claiming that these changes fixed the underlying corruption #18.
- Page images revealed duplicate heap TIDs, and Peter explained how an ordinary index tuple could consequently be mistaken for a posting-list tuple #19; additional checks without a matching attachment landed as a5213adf3d, which Peter announced as damage-limiting hardening #22.
- David Rowley investigated the parallel index-build hypothesis, while additional heap images showed index TIDs pointing to LP_UNUSED items and redirected attention toward pruning or VACUUM recycling heap locations before removing their index entries #26 #28.
- Kamigishi reproduced corruption after REINDEX with WAL archiving enabled, providing a way to reconstruct the failure instead of relying only on already-corrupt page images #36 #56.
- Alvaro Herrera supplied a standalone pg_waldump full-page-image extraction patch, and Andres Freund separately supplied heap WAL descriptions exposing unused, dead, and redirected offsets; Kamigishi applied Andres's patch and returned the expanded WAL trace #58 #76 #79.
- Andres reproduced the root cause with two large indexes and one small index: parallel VACUUM skipped the small index in both worker and leader processing, then recycled the corresponding heap locations; he traced this to PostgreSQL 14 refactoring #80 #81.
- Kamigishi's VACUUM VERBOSE output confirmed that real affected indexes were omitted, after which Peter posted the corrective leader-processing condition together with separate heapam assertions for invalid TIDs supplied by indexes #83 #84.
- Kamigishi tested the draft fix successfully, and Andres requested both regression coverage for mixed index sizes and runtime errors rather than assertion-only detection of invalid index TIDs #85 #86.
- Discussion of whether redirect pointers could target dead items led Peter to document HOT-chain invariants with a standalone pruning assertion patch, which Pavel Borisov tested successfully with assertion checking enabled #88 #89 #90 #91.
- Peter revised the VACUUM fix with clearer state naming and a regression test based on Masahiko Sawada's work, and combined the heapam and pruning assertions into its companion patch #92.
- Masahiko approved the VACUUM fix but questioned relying on an nbtree assertion to detect a VACUUM regression; Peter retained that test for the imminent release and described a more explicit parallel VACUUM state machine as future work #93 #94.
- The first patch of #92 landed with comment and test cleanups as 9bacec15b6, fixing skipped indexes and receiving a PostgreSQL 14 backport while the companion hardening remained under review #94.
- Peter resubmitted the remaining hardening with runtime errors and detailed index locations, and Andres requested unlikely() annotations and clearer pruning comments #95 #96.
- Peter kept the new heapam errors and pruning assertions on the development branch because of concerns about introducing additional failures into existing PostgreSQL 14 workloads; Andres accepted the follow-up wording #97 #98.
- The remaining patch #95 was split into pruning assertions with revised comments in 5cd7eb1f1c and invalid-index-TID runtime checks with minor cleanup in e7428a99a1, after which Peter announced that everything had been pushed #99.
- Justin Pryzby subsequently reported likely existing damage from the same bug, and Peter recommended REINDEX while explaining that amcheck cannot reliably detect every surplus or duplicated TID caused by it #100 #101.
- At the thread's end, the diagnosed VACUUM fix and defensive checks had landed, while the diagnostic WAL attachments had no landing shown here; Alexander Kukushkin's separate corruption report remained unresolved and was redirected toward another HOT-pruning investigation because his workload had not run manual VACUUM #99 #102 #103.