model-writtenrun 8020 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
Jul - Oct 2020 · 20 entries
- Robert Haas opened the thread with a proposal for heap_force_kill() and heap_force_freeze(), explaining that corrupted visibility information could leave tables unvacuumable and make extraction-and-reload recovery impractical #1.
- Stephen Frost and Tom Lane favored a contrib module but opposed immediate backpatching, while Peter Eisentraut wanted a beta cycle before considering distribution to existing releases #2 #3 #16.
- Tom argued for improving VACUUM's handling and identification of corrupted tuples, while Robert maintained that diagnostic improvements still needed complementary repair tools #8 #9.
- Alvaro Herrera posted an independent heapam.c workaround that trusted committed hint bits during freezing, but Andres Freund warned that it could conceal corruption and Alvaro acknowledged that concern; it did not become part of the landed surgery module #26 #28 #30.
- After Andres suggested ordinary SQL might repair identified tuples, Robert demonstrated a case where corrupted transaction information made tuples invisible while VACUUM continued to fail, supporting the need for direct heap surgery #29 #34.
- Ashutosh Sharma supplied the first pg_surgery implementation, with functions that sort TIDs by page, modify line pointers or visibility information under cleanup locks, and WAL-log the repaired pages #35.
- Andrey Borodin and MBeena Emerson identified validation, skipped-tuple reporting, and unnecessary WAL issues; Ashutosh incorporated their feedback before Robert's detailed review strengthened locking, permissions, and bounds checks #36 #39 #46 #48 #52.
- Robert argued that expert recovery tools should retain direct TOAST-table access, and Ashutosh restored it while correcting unchanged-page bookkeeping; subsequent revisions added materialized-view support, owner checks, fuller tuple freezing, documentation, and negative tests #54 #61 #65 #69.
- Rajkumar Raghuwanshi demonstrated recovery from deliberately corrupted visibility information and later reported successful standby and concurrency testing #58 #78.
- Asim Praveen proposed recognizing heap-compatible access methods by their handler, which Ashutosh temporarily adopted; Robert later restored the ordinary heap-AM check to follow existing precedent #70 #76 #100.
- Masahiko Sawada identified visibility-map and tuple-header risks, and Alvaro explained why relying on a later VACUUM could leave further corruption; Ashutosh added immediate visibility-map repair and ctid resetting, then corrected clearing to cover all visibility-map bits and simplified TID processing #73 #79 #87 #92 #97.
- Robert rejected a blanket prohibition on concurrent operations because online repair was a central use case, and preferred explicit warnings about dangerous operations over overly specific recovery recipes #95 #98.
- Robert's revised patch moved reporting and validation outside critical sections, skipped redirected line pointers instead of following potentially corrupted chains, accepted empty TID arrays, and expanded regression coverage #100.
- Mark Dilger's parallel review supplied the sorted-input precondition comment added to Ashutosh's final submission, which landed unchanged as the new pg_surgery module without a backpatch #101 #105 #109 34a947ca13.
- Tom reproduced a buildfarm regression failure caused by concurrent snapshots affecting VACUUM results, prompting Ashutosh to propose a temporary test table; Tom's review then questioned transaction-wrapped tests and requested clearer documentation #111 #112 #114 #116.
- Robert revised Ashutosh's test fix to use temporary tables for both heap cases, and that posted patch landed unchanged as the regression-stabilization commit #118 #121 0811f766fd.
- Further buildfarm failures exposed a deeper problem: Amit Kapila identified inconsistent pruning and VACUUM cutoffs, and Tom supplied a concurrent-sleep reproducer while explicitly rejecting its timing-dependent harness for inclusion #125 #126 #128 #129.
- Andres explained the interaction between heuristic visibility horizons and exact VACUUM cutoffs, proposed centralizing temporary-table horizon handling in procarray.c, and took responsibility for implementing the fix #138 #141 #142.
- After a gap, Andres posted a prototype and then a polished version with corrected horizon initialization, removal of obsolete isTopLevel parameters, and isolation tests; the latter landed with only an additional test comment #143 #144 94bc27b576.
- The new isolation tests exposed another bug under force_parallel_mode=regress: horizon computation could run before MyDatabaseId was initialized and wrongly ignore active database sessions; Andres explained the diagnosis and committed a conservative startup-horizon fix without posting an attachment #146 #147 #148 1c7675a7a4.
Jan 2021 · 1 entry
- Released-version availability resurfaced in January: Robert reiterated that backpatching lacked consensus, Michael Paquier suggested external distribution, and Andrey reported successfully packaging the extension for PostgreSQL 12 #149 #150 #151 #152 #153.
Mar 2021 · 1 entry
- By the final message, the module and its fixes had landed, while Peter Geoghegan pointed to separate work removing vacuumlazy.c's tupgone special case and related WAL complexity, acknowledging that concurrent aborts could still make pruning and VACUUM disagree #154.