model-writtenrun 6985 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Xiaoran Wang reproduced a permanently stale function-cache entry during concurrent schema changes and proposed checking tuple visibility after detoasting instead of retrying for every accepted invalidation message #1.
- Tom Lane rejected the InvalidBuffer workaround and questioned the snapshot choice #2; after Xiaoran suggested checking xmax directly #3, Tom supplied a complete patch using the scan's live tuple and buffer, with randomized assertion-build failures to exercise otherwise elusive retry paths #4.
- Tom then replaced direct buffer inspection with the existing systable_recheck_tuple API #5, and Xiaoran approved that version #6.
- Xiaoran proposed skipping visibility checks when the invalidation counter had not advanced #7, but Tom declined the extra dependency and bug risk for this uncommon path #8; the visibility-check version landed as 3b4d85cf15, with only branch adaptations from #5.
- Tom kept the accompanying formatting separate in d29a4fbacf and registered that formatting change in .git-blame-ignore-revs through 36578fa049; these unattached housekeeping changes are attributed to the deferred formatting work in thread #48648.
- Tom considered moving the counter optimization into systable_recheck_tuple but questioned its applicability to catalogs without catcaches #9, while Xiaoran pointed out their snapshot-invalidation mechanism #11; no supplied candidate implements that optimization.
- Noah Misch identified that systable_recheck_tuple cannot detect in-place updates #10; the implementation subsequently developed in thread #48640 landed from #564239 with a small include adjustment as f9f47f0d93, adding tuple-copy comparison for affected catalogs, and Noah later confirmed the fix here #12.
- Heikki Linnakangas reopened the problem for cache lists that receive invalidations while being built #13; Tom explained that invalidated existing members already make the list stale #14, but Heikki demonstrated that a newly inserted member could remain missing indefinitely and supplied an injection-point reproducer #15.
- Heikki proposed replacing visibility rechecks with a stack of in-progress entries that receive invalidations, abandoning an attempt to insert partially built entries directly into the cache because it was too invasive #16; Michael Paquier spotted the wrong attachment #17, and Heikki supplied the correct reproducer-and-fix series #18.
- Noah endorsed the stack approach and retaining the test, but found an infinite retry under debug_discard_caches and requested clearer test naming, safer longjmp variable handling, and a compiler-warning fix #19; Heikki incorporated those changes while retaining stack allocation and PG_TRY cleanup rather than adopting relcache's array and transaction callback #20.
- Noah's final review caught a missing heap_freetuple call and an accidentally forced debug_discard_caches setting in the test #21; Heikki corrected those and comments, then committed #20 as af8cd1639a, confirming the landing and backpatch work in #22.
- Andres Freund reported intermittent injection-point test failures in March and again in September #23 #24; Arseniy Mukhin supplied a small follow-up that waits for the injection point before allowing the competing operation #25.
- At the thread's end, Andres reproduced the race by delaying execution after the query_until marker and confirmed that Arseniy's wait_for_event patch fixes it #26; the main fixes have landed, but the supplied thread contains no landing confirmation for the final test-stability patch #25.