model-writtenrun 5118 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Tom Lane opened the thread with an April 2021 fix announcement explaining that heap_update could miss visibility-map pins after temporarily releasing buffer locks; he limited backpatching to v12 because older branches required riskier prerequisite changes #1.
- In September 2022, Jaime Casanova reported the same PANIC on PostgreSQL 15 beta4 and subsequently confirmed it on RC1, showing that the earlier fix was incomplete #2 #3.
- Tom identified a remaining relation-extension path that skipped visibility-map pin acquisition when the conditional lock on the old page succeeded #5, then supplied a patch that also rechecks free space because acquiring those pins can release the target-page lock #7.
- Peter Geoghegan explained why PostgreSQL 15 VACUUM changes might expose the race more frequently #6; Tom proposed backpatching through v12 despite uncertainty about older-version reachability, and Peter agreed #8 #9.
- Tom committed the attached patch unchanged as 2dc2e4e31a, with backports through v12.
- After the commit, discussion turned to a related heap_delete failure on v13; Peter proposed that VACUUM could already hold a cleanup lock before another session pinned the page, potentially explaining the older-version report #10 #12 #13.
- Tom questioned whether that explanation required backpatching all the related fixes into v10 and v11, while warning that prerequisite changes could introduce new bugs; Peter initially distinguished heap_update but then acknowledged uncertainty #14 #15 #16 #17.
- Jeff Davis showed that heap_delete already rechecks visibility after acquiring the buffer lock, undermining the proposed explanation, and Peter withdrew it; the v13 failure remained unexplained #18 #19.
- Jaime later described reproducing the failure with ten sqlsmith processes against selected regression tables and reported about twelve hours without failure after the fix; this testing occurred after the commit #20.
- The thread ended with Alvaro Herrera reporting roughly daily related crashes on PostgreSQL 14 customer systems, strengthening evidence of practical impact; the patch had landed, while older-version reachability and any further backpatching remained unresolved #21.