model-writtenrun 3227 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
Aug - Sep 2020 · 2 entries
- Alvaro Herrera opened the thread with a tested LWLock replacement for a heavily contended WAL spinlock in a deployment replicating from 64 sites, protecting both LogwrtResult and LogwrtRqst in #1.
- Andres Freund proposed individual 64-bit atomic fields instead of another lock in #2, discounted emulated-atomic performance concerns in #4, and supported a reusable monotonic-advance helper in #7.
Jan - Feb 2021 · 2 entries
- Alvaro's atomic prototype in #14 converted both result and request positions but failed pg_upgrade testing; Andres's review in #16 identified coherence hazards, excessive atomic operations, and barrier issues.
- Alvaro narrowed the conversion to LogwrtResult in #17, leaving request bookkeeping under the spinlock, while Andres supplied full-barrier helper semantics and reiterated that WALWriteLock permitted ordinary atomic writes in #18.
Nov 2021 · 1 entry
- After a long gap, Alvaro separated the local Write and Flush variables in #21 and added optional atomic conversion of asyncXactLSN and WalWriterSleeping in #22, although he later said there was insufficient evidence to require that additional conversion in #24.
Mar - Apr 2022 · 3 entries
- Tom Lane objected that the local-variable representation change obscured the functional patch in #25, prompting Alvaro to separate it into its own patch in #26.
- Alvaro questioned whether XLogWrite still needed to keep request positions ahead of result positions in #27, removed that maintenance in #28, and omitted the separate local-variable cleanup.
- Unresolved memory-ordering concerns led Alvaro to defer the work beyond PostgreSQL 15 in #30; after the rebase in #31, he withdrew it because another change had reduced its urgency in #32.
Feb - Apr 2024 · 12 entries
- Jeff Davis revived the work in 2024, rebasing it, fixing stale local-result values exposed by assertions, and proposing a Copy pointer to cache completed WAL-buffer insertion progress in #34.
- Bharath Rupireddy folded Jeff's fixup into the series, initialized the atomic fields, and separated the monotonic helpers in #35; Jeff then emphasized refreshing both local values and loading Flush before Write in #36.
- The discussion considered eliminating the backend-local cache, but Robert Haas highlighted cache-line contention risks in #37, and Jeff accepted retaining it while suggesting safer access wrappers in #38.
- Bharath introduced a common refresh macro and invariant checks in #40, then moved failing Copy/Write/Flush checks into XLogWrite and restored request-position maintenance in #41.
- Alvaro reorganized the work into separate shared fields, atomic access, and Copy tracking in #42, dropping the unused u32 helper because it had no caller.
- After Bharath approved the structure and reported repeated successful tests in #44, Alvaro committed the first part of #42 as c9920a9068, changing only the refresh macro's name.
- Jeff reiterated the required read order in #46, and Alvaro's remaining series in #47 adopted ordinary atomic writes under WALWriteLock with paired barriers, reserving monotonic advancement for the Copy pointer.
- Jeff approved the revised atomic-access patch in #48, and Bharath tested it and requested clearer ordering comments in #49; #51 incorporated cleanup and made monotonic advancement return the latest observed position.
- Testing without native atomics or spinlocks exposed initialization occurring too late in #51; ee1cbe806d committed that submission's first patch with initialization moved into XLOGShmemInit, leaving the Copy work in #52.
- Thomas Munro raised possible related parula LWLock failures in #54, and Bharath offered to investigate in #55, but this thread records no definitive diagnosis.
- After Alvaro explained why successful compare-exchange still required returning the newly installed value in #56, Jeff accepted the helper in #57, and Alvaro reported landing the Copy remainder with an insert-oriented name, added comments, and a read barrier in #58.
- Jeff questioned the distinction between reserved WAL positions and completed copies in #59; Alvaro explained logInsertResult and acknowledged Jeff's original authorship in #60, and Jeff accepted the terminology while requesting clearer comments in #61.
Jun - Jul 2024 · 5 entries
- Alexander Lakhin reopened the thread with a Windows x86 assertion failure in #62 and identified the helper's local comparator as the alignment problem in #64.
- Alvaro's union-based alignment attempt in #65 proved unsuitable because double could also be four-byte aligned; Tom questioned the assertion and corrected the alignment test in #66 and #69, leading to the conditional-alignment patch in #70, which Alexander successfully tested in #73.
- Andres explained that MSVC's comparator was passed by value and proposed generic-wrapper and return-handling cleanups in #75, leading Alvaro to replace forced alignment with selective platform assertions in #76.
- The final patch in #76 landed unchanged as 3a9d0d774d, including a PostgreSQL 17 backport; Alvaro's closing message #77 confirmed that Alexander had tested it successfully before the push.
- By #77, the principal WAL changes and the reported Windows fix had landed, while the optional async-state conversion and removal of the local result cache had not been included, and further buildfarm results were still awaited.