model-writtenrun 9394 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Martijn van Oosterhout traced NOTIFY contention across roughly 150 databases to excessive listener wakeups and exclusive locking, then proposed advancing the queue tail less frequently and suppressing unnecessary cross-database signals #1.
- Martijn posted corrected patches, added an early exit to the tail-scanning loop, and supplied a reproduction test reporting PostgreSQL CPU usage falling from roughly 270% to 5% #2.
- Tom Lane identified unlocked shared-pointer reads and inaccurate comments, questioned whether the early exit would save work, and proposed chained wakeups for tail cleanup while retaining prompt notification delivery #3.
- Martijn accepted the locking concerns and proposed tracking listeners explicitly and delaying cleanup wakeups; he and Tom regarded separating reader and writer locks as a potentially excessive refactor #4 #5.
- Martijn clarified that a listener list would replace scans over all backend slots, and Tom corrected where that metadata should live while suggesting a mostly contiguous listener array as an alternative #6 #7.
- Martijn raised readability and identifier-confusion concerns about the array alternative but agreed to experiment; the thread ended with Thomas Munro moving the work to the September commitfest as waiting on the author #8 #9.
- Work subsequently continued in thread #41018, whose later patchset #433407 is identified as the source of 51004c7172; the committed implementation makes senders attempt tail advancement every four queue pages and signals listeners in other databases only when sufficiently behind.