model-writtenrun 6116 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Thomas Munro opened the thread with an experiment replacing signal-mediated interrupt delivery with shared flags and latch wakeups, aiming to simplify cooperative interrupts and prepare for possible threaded backends #1.
- Andres Freund questioned startup behavior, memory ordering, and function-call overhead, prompting Thomas to introduce an atomic bitmap and switch between private and shared pending-interrupt storage #2 #3.
- Robert Haas raised blocking-I/O concerns, and Thomas argued that network waits should already use latch facilities because relying on signal interruption would leave existing wakeup races #4 #5 #7.
- After nearly three years, Thomas revived the bitmap design with updated interrupt reasons and recovery-conflict handling, although Windows CI initially failed #8.
- Heikki Linnakangas found missing interrupt-mask entries and races when switching interrupt storage, while Robert explained why background-worker startup notifications still needed postmaster involvement; Thomas fixed those issues and split notification changes into a prerequisite that passed Windows testing #9 #10 #11.
- Heikki explored identifying children through postmaster-managed slots, then proposed reversing the implementation layers so interrupts would replace latches themselves rather than merely set them #12 #17.
- Heikki's replacement series introduced general-wakeup and recovery-continuation interrupts, preparatory ProcNumber conversions, and a separate logical-replication launcher wakeup fix; Thomas supported the direction and its potential for more selective wakeups #18 #19 #20.
- The first preparations from #20 landed unchanged: unused WalSnd latch removal as 6c0c49f7d3, an unnecessary include removal as 094ae07160, and unused WaitLatch arguments cleanup as f9ecb57a50.
- Heikki surveyed extension compatibility and favored an external forward-compatibility header, while Michael Paquier supported a clean core API transition and Robert considered the proposed compatibility options acceptable #22 #23 #24.
- The ProcNumber conversions from #20 were consolidated into a9c546a5a3, while the two wakeup-function renames were separated into 368d8270c8, both with light cleanup.
- With those prerequisites committed, Heikki reposted the remaining interrupt work and demonstrated the compatibility-header approach by adapting pg_cron across supported releases; Jelte Fennema-Nio ultimately supported maintaining the header on the wiki #25 #26 #28.
- Heikki restored Thomas's background-worker notification patch on the new interrupt base, and Thomas's subsequent review led to suppressing redundant wakeups and using one sleeping flag; Robert supplied the shorter INTERRUPT_GENERAL name #30 #31 #32 #37.
- Andres requested that WaitEventSet code movement be separated for review and argued for unifying the overlapping interrupt mechanisms, leading Heikki to post a standalone three-patch prerequisite series #38 #39 #41.
- Andres reviewed that series and caught a postmaster-death mode-switching bug; Heikki committed ShutdownLatchSupport removal unchanged as a98e4dee63, corrected ModifyWaitEvent control flow in 84e5b2f07a, and landed the WaitEventSet split with comment, include, and Windows build fixes as 393e0d2314 #42 #43.
- Heikki then combined the latch replacement with Thomas's earlier ProcSignal removal, introduced mask-based APIs, and consolidated the competing interrupt files, while leaving several design questions open #44 #45.
- Andres's July review challenged the limited interrupt-bit capacity, repeated per-process dispatch logic, memory barriers, and composability, proposing registered handlers and a maintained mask of enabled interrupts #46 #47.
- Joel Jacobson benchmarked the combined design, reported that it improved on master but trailed his separate LISTEN/NOTIFY optimization, and advocated incremental subsystem-specific state management above the shared interrupt mechanism #48 #49.
- Heikki returned with a substantial redesign using registered callbacks and an enabled-interrupt mask, moving the infrastructure into src/backend/ipc and directing review of the recovery-conflict prerequisites to a separate thread #50.
- The next revision implemented 64-bit masks and extension interrupt allocation, added auxiliary-process ProcNumber publication, and deferred most replacement of postmaster-to-child kill() calls #51.
- Andres approved the SIGINT consistency prerequisite, which landed with a small commit-message correction as a92b809f9d, but also identified signal-handler self-deadlocks with emulated 64-bit atomics and increased CHECK_FOR_INTERRUPTS overhead #52.
- Heikki addressed those problems with separate pending-interrupt flags and split 32-bit storage where necessary, then introduced an attention mask that lets senders avoid unnecessary wakeups and interrupt-processing checks #53 #54.
- After further rebasing, Andres tested the series and reported shutdown assertion failures involving the sleeping flag, questioned memory-ordering guarantees, and requested more preparatory extraction #55 #56.
- The latest full-series revision clears the sleeping flag before postmaster-death exits, clarifies the infrastructure-versus-standard-interrupt header split, and extracts header movement and other prerequisites, while retaining the attention-mask design #57.
- The auxiliary-process ProcNumber prerequisite from #57 subsequently landed with only comment and commit-message polish as 842169b6c1.
- Heikki committed the SIGCHLD-centralization prerequisite from #57 as 2e2751e697, moving duplicated resets into InitPostmasterChild() with comment and commit-message edits; Andres had considered its single-user behavior during review in #52.
- Zsolt Parragi reported an automated-review finding that 2e2751e697 broke COPY TO PROGRAM in standalone backends inheriting an ignored SIGCHLD, supplied a reproducer, and posted a fix restoring the reset in InitStandaloneProcess() #58.
- At the last message, the standalone-backend fix is posted without a recorded review or landing, while the main latch-and-ProcSignal replacement remains under review after its preparatory commits #58 #57.