model-writtenrun 391 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Ayush Tiwari opened the thread with three reproducible after-startup shmem problems—stale backend state after errors, partially allocated batches that could not be retried, and legacy allocation calls that could deadlock inside callbacks—and attached separate fixes in #1.
- Ashutosh Bapat recommended TopMemoryContext ownership, PG_TRY/PG_FINALLY cleanup, injection points, and a configurable test allocation size in #2, while judging complete allocation rollback too invasive late in the PostgreSQL 19 release cycle.
- Ayush adopted explicit cleanup and replaced batch preflight with removal of unfinished index entries in #3, explaining that clearing local pointers alone would still let another backend attach to incompletely initialized memory.
- Ashutosh objected to removing index entries while leaking anonymous shared memory and proposed an initialized flag instead in #4; he also argued that existing assertions and lock documentation were sufficient for legacy callback misuse.
- Ayush narrowed the proposal to backend cleanup in #5, dropping rollback and legacy-call rejection, documenting incomplete initialization, and introducing a shared request memory context; he retained a runtime-settable test GUC because a postmaster-only GUC could not be defined during late loading.
- Ashutosh simplified ownership to direct TopMemoryContext allocations in #6; Ayush then identified an unsafe return inside PG_TRY and the need for same-backend retries in #7, leading to corrected control flow and tests in #8 and editorial fixes in #10.
- After Ayush rebased the patch in #11, Heikki Linnakangas revived initialization tracking in #12, choosing to mark abandoned areas and reject attachment until restart rather than implement reclamation or retry, and immediately corrected a broken comment in #13.
- Ayush reported passing assertion-enabled and injection-point tests but identified leaked options in #14; Heikki restored explicit TopMemoryContext cleanup and folded tests into the two implementation patches in #15, which Ayush endorsed in #16.
- Heikki committed the first patch from #15 unchanged as c54b6979e0 and the second unchanged as 07fdee7c8a, then announced completion in #17.
- Andres Freund reported that huge-page rounding could leave enough reserve for the supposedly failing 128 kB allocation to succeed in #18, prompting Ayush's test-only patch disabling huge pages during that phase in #19.
- Alexander Lakhin connected two buildfarm failures to the same issue in #20, and Andres committed Ayush's fix unchanged as e916927cfb and confirmed the push in #21.
- By the final message #21, both backend fixes and the test reliability follow-up had landed; full allocation rollback remained deferred, and the explicit legacy-call rejection dropped in #5 was not part of the committed work.