model-writtenrun 9291 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Manuel Rigger reported an intermittent unexpected-NULL index error on PostgreSQL 11.4 and supplied a concurrent Java reproducer in #1; Tom Lane reduced it to two sessions with a retained snapshot in #3.
- Tom traced the regression to the introduction of SnapshotNonVacuumable in #5, and Peter Geoghegan explained in #6 that a newly built index could point into a broken HOT chain whose recently dead root contained NULL despite the index entry containing a non-NULL value.
- Tom posted a patch that skipped HOT-updated tuples and passed check-world in #9, but both his submission and Andres Freund's review in #10 identified the direct inspection of heap storage details as a layering problem.
- Andres proposed moving the filtering into visibility semantics in #10, while Tom proposed reading endpoint values directly from index entries in #11; Peter questioned whether dead-entry marking would be preserved in #14, and Tom explained how index-only scanning could retain heap visibility checks and exploit all-visible pages in #17.
- Tom replaced the first approach with an index-only endpoint helper in #18, retaining SnapshotNonVacuumable for visibility while obtaining values from the index; Peter preferred this approach but questioned the benefit of generalizing the duplicated scan logic in #19.
- Tom committed #18 as d3751adcf1, additionally replacing unused executor infrastructure with a temporary memory context as explained in #21; the fix was backpatched through PostgreSQL 11.
- The reported bug was fixed, while broader table-AM abstraction remained deferred: Tom described that future work in #20, and Andres closed the thread in #23 by noting that moving visibility-map access below the AM boundary would require care to avoid extra buffer lookups and pins.