model-writtenrun 6854 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Xuneng Zhou opened the thread after observing polling overhead in read_local_xlog_page_guts(), proposing targeted latch wakeups using Alexander Korotkov's WAIT FOR infrastructure because condition-variable broadcasts could wake unrelated waiters; he initially left cascading timeline-switch wakeups unresolved #1.
- The available initial attachment contains the WAIT FOR prerequisite, and Xuneng supplied the corrected dependent polling patch with primary-flush waiting and wakeups before bundling both pieces and updating their comments #1 #2 #3.
- After Alexander identified an off-list promotion race that could mix replay and flush waiters, Xuneng introduced separate heaps and minimum-LSN tracking, then separate comparators; the bundled WAIT FOR prerequisite also acquired structured command options #4 #5.
- Michael Paquier argued that the callback optimization should depend on reusable infrastructure rather than the whole WAIT FOR command, and Xuneng responded with a standalone implementation containing the required infrastructure and polling replacement #6 #7 #9.
- Michael then requested smaller independent patches, highlighted duplicated replay-position checks and questioned possible consolidation with synchronous replication; Xuneng split out pairingheap initialization and minimal waiting infrastructure, removed unused timeout support, and retained pairing heaps because arbitrary waiter LSNs could make sorted-list insertion expensive #10 #11 #12.
- The next revisions removed early replay checks and corrected the resulting waiter-registration omission, replay-position reads and header dependencies #13 #14.
- On November 5, 2025, Alexander Korotkov committed pairingheap_initialize() as 8af3ae0d4b and the waiting infrastructure as 3b4e53a075 from the later matching submission #604878 in thread #50630; the helper matches this thread's earlier #14, while the infrastructure unifies APIs, indexes heap state by wait type and restores timeout support.
- The same landing included the WAIT FOR command as 447aae13b0, also sourced from #604878 in thread #50630, superseding the prerequisite attached here in #5 with infrastructure extracted, callers adapted to the unified API and WITH mandatory for options.
- Xuneng then resent only the remaining callback optimization and primary-flush wakeups, using the committed infrastructure; his subsequent self-review examined wakeup placement, promotion and timeline handling #15 #17 #18.
- After a gap, Xuneng rebased the remainder onto existing flush-wakeup support and updated wait-type names, retaining the callback logic and supplying a performance comparison #19.
- Rui Zhao reviewed that version, traced flush, replay and promotion wakeups, and requested removal of redundant interrupt checking and result handling plus promotion tests; Xuneng accepted those changes while treating synchronous-replication consolidation as separate research #20 #21.
- The final submission simplifies the callback to one LSN wait, explains why upstream promotion needs no separate timeline wakeup, and adds tests for local and upstream promotion during slot creation and interrupted slot synchronization with temporary-slot cleanup; less direct decoding paths and workers remain untested for the reasons stated, and the polling replacement and tests are still proposed rather than landed #22.