model-writtenrun 7013 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Sami Imseih reported that GetNamedLWLockTranche() crashes in ordinary EXEC_BACKEND backends because the local request array is not inherited, and proposed restricting calls to startup or postmaster execution in #1.
- Nathan Bossart explained that conventional shmem_startup_hook code avoids the crash by calling the function only when ShmemInitStruct() reports an uninitialized structure, and initially favored correcting the documentation in #4.
- Sami supplied a reproducer and proposed using the existing shared-memory tranche array in #5, then implemented that approach in #9; Nathan accepted the design in #10, with little urgency for backpatching because no field reports were known.
- An intervening change removed the shared-memory array needed by the first fix, prompting Nathan to favor rejecting unsafe calls in #11; Sami's replacement patch in #14 restricted access to shmem_startup_hook and updated the documentation.
- Nathan found that the restriction still allowed crashes because EXEC_BACKEND runs the startup hook in every backend in #16, then supplied a different implementation that moves the request array into shared memory in #17.
- Sami accepted the shared-memory approach in #18 and acknowledged that his earlier test had accidentally hidden the unsafe call behind an initialization guard; #20 resubmitted Nathan's implementation unchanged alongside a corrected TAP test module.
- Nathan committed the implementation portion of #20 unchanged as ed1aad15e0, preserving calls outside postmaster on every platform, and deferred the tests in #21; the commit explicitly declined backpatching given the lack of field reports.
- Nathan rewrote the remaining TAP harness as a smaller SQL regression suite in #22 and simplified its dynamic-tranche setup in #23, retaining coverage of registration, lookup, and error cases.
- Sami requested an unregistered-tranche initialization test and fewer startup tranches in #24; Nathan incorporated those changes in #25 and #27, and Sami approved the result in #28.
- Nathan raised the startup-tranche count to 32 in #29 to cover request-array reallocation, and Sami agreed with that adjustment in #30.
- Alexander Lakhin reported reproducible recovery-test failures after the shared-memory change in #31, and Nathan directed the fix discussion to thread #244089 in #32; the patch from #1119339 in that other thread landed with light edits as c3cc2ab87d, preserving the postmaster's original request array so shared memory could be rebuilt after a crash.
- Nathan committed the test harness from #29 as 16607718c0, adding comments and removing reconnect commands while crediting Sami as author and himself as co-author; his final announcement in #33 leaves both the implementation and tests landed, with the recovery regression also fixed.