model-writtenrun 8501 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Zhiguo Zhou opened the proposal in #1 to remove WAL reservation spinlock contention through atomic fetch-add and advance writes of the next record's predecessor link, reporting a 2.04-fold TPC-C improvement on a 480-vCPU machine with 128 insertion locks.
- Yura Sokolov identified unsafe predecessor reads and writes on platforms lacking suitable atomic access, questioned the remaining reservation spinlock, and requested clearer invariants in #4; after Wenhui Qiu questioned the lock-count increase in #5, Zhou agreed to separate that tuning from the reservation algorithm in #6 and #8.
- Sokolov supplied an alternative implementation in #10 that retained atomic reservation but exchanged predecessor links through a Cuckoo hash table, avoiding changes to WAL-buffer insertion order.
- When Sokolov suggested shortening predecessor links in #12, Matthias van de Meent explained in #13 that full predecessor addresses protect against stale records in torn writes to recycled WAL segments, making a shortened-offset format unsafe without additional protection.
- Zhou reported similar large-machine gains from both implementations in #15 and favored Sokolov's hash table because his own approach disrupted insertion conventions, still failed TAP tests, and risked format changes.
- Sokolov expanded the hash-table implementation in #19 with native-64-bit and fallback-32-bit entry protocols, fuller position identification, and separate shared storage, while removing the active insertion-lock-count increase.
- Japin Li initially reported improved BenchmarkSQL throughput and patch-cleanup issues in #21, then found intermittent stuck-spinlock panics when testing reservation changes alone in #26; Sokolov fixed out-of-range hash positions, removed an accidentally included patch file, and added cache-local slot strategies in #27.
- Li's isolated tests in #30 showed small regressions, prompting Sokolov to request comparisons that separated lock-count effects from reservation effects in #31; Li's expanded results in #33 showed most of the benefit came from additional insertion locks.
- Questioning whether roughly 1.1% extra throughput justified the hash table's complexity, Sokolov supplied an experimental patch in #34 that omitted real predecessor links and disabled their validation to measure an upper bound, explicitly acknowledging recovery-test failures.
- Sokolov continued the correctness-preserving hash-table branch in #35, restoring cache-line separation for the reservation counter and selecting the eight-slot, two-cache-line strategy to reduce the regressions seen with eight insertion locks.
- Zhou explained in #36 that increasing locks alone severely hurt his much larger machine, whereas combining the changes helped substantially, and abandoned further pursuit of his WAL-buffer approach after a remaining streaming-recovery failure suggested a deeper insertion redesign.
- After comparing test environments, Zhou reported in #40 that the revised hash table with 64 locks improved HammerDB throughput by about 44% while increasing locks alone caused severe regressions; he attributed the discrepancy with Li's results partly to workload and server-core differences.
- Sokolov made smaller-server performance a remaining concern in #41, and Zhou answered with scaling measurements from 8 to 64 physical cores showing no regression for the revised patch plus 64 locks in #42; Sokolov noted that restoring cache-line padding could explain the improvement in #43.
- Andres Freund reported reproducible Windows failures consistent with an EXEC_BACKEND null pointer in #44, and Sokolov fixed the missing backend-local hash-table pointer initialization in #45.
- Sokolov rebased the hash-table patch in April 2025 in #46, and Zhou took over resubmission with another rebase after a six-month gap in #47.
- After another year, Zhou returned in #48 with a major redesign using native 128-bit CAS to update current and previous reservation positions together, preserving full predecessor links and the WAL format while eliminating the hash table; the patch adds capability detection, a spinlock fallback, and atomic-operation and crash-recovery tests.
- The final submission #48 retains eight insertion locks by default and keeps lock-count configuration separate; Zhou reports Andrew Kim's off-list review and testing, near-baseline default-eight throughput, and larger gains with 64 locks, while noting that increasing locks still regresses a large logical-message workload.
- At the end of #48, the CAS redesign remains proposed for review with no linked commit: Linux native, fallback, and CAS-only EXEC_BACKEND checks reportedly passed, Windows, ARM, and big-endian execution remain unverified, LLVM bitcode flags require manual matching, and a separate writer-wait diagnostic is excluded pending further discussion.