model-writtenrun 9467 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Noah Misch opened the thread in 2013 after finding that a missing postmaster.pid allowed startup despite surviving backends, and proposed stronger shared-memory checks plus preserving the PID file during immediate shutdown #1.
- Stephen Frost and Robert Haas supported stronger checks but raised compatibility concerns about retaining postmaster.pid, so Noah dropped that part of the proposal #2 #3 #4.
- After a nearly five-year gap, Noah submitted the safety implementation and a separate HINT correction, extended protection to single-user mode, and stopped recycling segments belonging to other data directories #9.
- The initial submission deliberately left the shared-memory key-turnover loophole unresolved; Noah considered an additional tracking file or scanning extra keys but questioned whether either justified its complexity #9 #15.
- Dmitry Dolgov's testing exposed that pg_sleep() now exited on postmaster death, so Noah replaced it with a regress.c wait_pid() call and added the necessary test-library plumbing #10 #11 #12.
- Kyotaro Horiguchi identified confusing state naming and redundant attach/detach operations, prompting Noah to consolidate analysis into PGSharedMemoryAttach() and make callers responsible for detaching #14 #16.
- Daniel Gustafsson tested both patches successfully, requested shmdt() failure diagnostics and a recovery-test rename, and Noah accepted the diagnostic change #17 #18.
- The HINT attachment from #16 landed unchanged as 5a907404b5, replacing advice to remove shared memory or the PID file with advice to terminate old server processes.
- The safety attachment from #16 landed as 2f932f71d9 with additional detach-error logging and the test renamed to 017_shm.pl.
- Concurrent buildfarm runs then exposed shared-memory key collisions, and Noah's proposed port-holder postmaster became 16ee6eaf80 without an attached patch #20.
- Further buildfarm failures persisted, so Noah announced a rollback and reverted the safety landing and its follow-ups in 82150a05be, leaving the HINT correction in place #21.
- Noah's revised submission reserved separate port ranges for concurrent tests, retried asynchronous process termination, imported usleep(), reduced semaphore use, and treated shmat() EACCES as a foreign segment rather than a startup blocker #22.
- Thomas Munro corrected the explanation of signal delivery and process reaping, and the revised safety patch landed as c098509927 with that comment clarification #25 #26.
- An MSYS Perl failure led to 947a35014f, which added a pg_ctl kill fallback to PostgresNode::kill9() without a new attached patch #29.
- Because older branches lacked the required pg_ctl signal support, 2bc0474792 removed that fallback there and skipped the MSYS shared-memory test instead #29.
- Another unattached portability repair, 9daefff122, translated the regression-library path from MSYS form to a Windows filename #29.
- Windows port conflicts prompted 4ab02e8156, which supplemented wildcard-address probing with concrete loopback addresses #29.
- Thomas reported macOS firewall prompts caused by wildcard probing, and Noah agreed that non-Windows configurations could omit that probe #27 #28.
- Noah subsequently reported twelve days of buildfarm stability after the portability repairs and an additional EPIPE fix, considering the main safety work complete #29.
- After Noah corrected the proposed comments, Thomas submitted the Unix-only probing adjustment in #31 and committed it with further comment edits as 8efe710d9c #30 #32.
- The thread ended with Noah accepting the committed probing behavior; all submitted changes had landed, while the previously documented shared-memory key-turnover limitation remained outside the implemented protection #33 #22.