model-writtenrun 7025 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Yura Sokolov proposed removing msgnumLock in favor of atomic maxMsgNum accesses and read/write barriers after customer investigations found spinlock contention, reporting that the change helped the customer in #1.
- Heikki Linnakangas found a missing wraparound adjustment and suggested consistently unsigned counters in #2; Yura implemented both in #3, while retaining explicit wraparound handling because natural overflow would complicate comparisons.
- Andres Freund identified a possible hasMessages/maxMsgNum reordering that could lose invalidations in #5; Yura responded in #6 with a full barrier before the reader's atomic load and a barrier-providing writer accessor.
- Andres questioned whether the short spinlock critical section explained the reported slowdown and suggested false sharing in #7; Yura supplied profiling evidence and explained frequent planning-time invalidation checks and small read batches in #8 and #9.
- Yura questioned existing ARM spinlock ordering in #10, then withdrew that concern in #11 after explaining how mutual exclusion plus acquire/release semantics prevent the problematic interleavings.
- In #11, Yura replaced the direct atomic proposal with a shared/exclusive spinlock implementation, extending it to XLogRecoveryCtlData->info_lck to address contention from many WAL senders.
- Andres opposed introducing more userspace spinlock variants and requested a reproducer in #12; Yura instead supplied an optimistic version-validated lock in #13, arguing that readers avoiding shared-memory writes scaled best.
- After Andres again requested reproducible evidence in #14, Sergey Shinderuk supplied a concurrent temporary-table DDL and select-only pgbench workload in #15, reporting that removing the reader spinlock reduced the throughput penalty from about 25% to about 6%.
- Andres favored returning to straightforward atomics with sufficient barriers in #16; Yura defended the reusable two-call-site primitive in #17, but Andres declined to pursue RWOptSpin and advocated higher-level invalidation improvements in #18.
- The supplied discussion ends with Olga Antonova testing #13 and reporting 6–8% throughput gains across three NUMA nodes and 1.5–2% on one node in #19; the broader lock proposal still had unresolved design objections and no landing recorded in these messages.
- On September 24, 2026, Nathan Bossart committed the unsigned-counter prerequisite as 25217d91b1, with explicit threshold-clamping conditionals; its latest matching submission is #1155244 in thread #253035, superseding the previous attribution to #6 while retaining Yura's author credit.
- Nathan also committed the atomic conversion as df3978c234 from the later submission #1155244 in thread #253035, using barrier-providing accessors; the commits realize the earlier sinvaladt.c approach, while this thread's RWSpin, RWOptSpin, and xlogrecovery.c changes remain unlanded in the supplied evidence.