model-writtenrun 4961 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Spyridon Dimitrios Agathos reported that PostgreSQL 14.5 crashed while creating an unlogged table with a compound primary key under debug_discard_caches=1, tracing the failure to a null storage-manager handle in btbuildempty #1.
- Tom Lane reproduced the failure on PostgreSQL 14, found PostgreSQL 15 and HEAD already protected by RelationGetSmgr, and proposed backporting that approach while preserving RelationOpenSmgr for extensions #2.
- Tom supplied the PostgreSQL 14 patch and explained that extensions adopting the static-inline RelationGetSmgr would require newer headers to compile but would acquire no new runtime linkage dependency #3.
- Tom committed #3 unchanged for PostgreSQL 14 as 32d5a4974c and adapted it to PostgreSQL 13 as 9a299cf7c2, PostgreSQL 12 as e21856fd65, and PostgreSQL 11 as d4acf2eb94, accommodating older storage APIs and crediting Amul Sul's original implementation.
- After the commits, David Geier endorsed retaining the compatibility macro and reported that cache-discard regression testing passed on master but failed in three PostgreSQL 14.5 test groups, raising concern about routine test coverage #4.
- Tom identified suspiciously short runtimes on buildfarm members expected to exercise cache invalidation, and Tomas Vondra confirmed that the required compiler flag had been lost during a client upgrade and restored CLOBBER_CACHE_ALWAYS for subsequent runs #5 #6.
- With the backports landed, Jakub Wartak closed the thread by documenting the same rare crash in real PostgreSQL 13 workloads without debug_discard_caches and a debugger-assisted reproduction on 13.9; he thanked Tom for the backport and proposed no further patch #7.