model-writtenrun 4943 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
May - Aug 2021 · 3 entries
- Kirill Reshke reported standby snapshot scans consuming most CPU and delaying WAL replay when a long primary transaction coincided with a large max_connections setting, then supplied a doubly linked list implementation in #1 and #2.
- Mihail Nikalayeu reproduced the problem, found correctness and initialization errors in the first patch, and replaced it with lazily maintained offsets for skipping invalid entries, supplying master and PostgreSQL 13 versions in #3, #4, and #5.
- Andres Freund argued that replay costs and binary searches warranted broader data-structure work, while Andrey Borodin favored the smaller offset optimization plus more frequent compression over a complicated redesign in #6, #8, and #14.
Oct - Nov 2021 · 2 entries
- Mihail reduced repeated offset reads and reported benchmarks eliminating the standby throughput drop caused by a long transaction; Alexander Korotkov then suggested ordinary 32-bit values instead of atomic wrappers, which Mihail adopted alongside a separate memory-barrier patch in #15, #16, #17, and #18.
- After questioning the barrier implementation, Andrey separated it from the offset optimization and rebased the latter for independent consideration; Mihail accepted that version and improved its commit message in #19, #21, #22, and #23.
Jul - Sep 2022 · 4 entries
- Andrey's naming and concurrency-documentation review produced a revised offset patch, which he considered ready for a committer in #25, #26, and #27.
- Kyotaro Horiguchi suggested storing indexes instead of distances, while Simon Riggs proposed avoiding sparse-array scans by compressing more frequently rather than maintaining another array in #28 and #29.
- Andrey warned that compression could itself burden some workloads, and Simon supplied a separate optimization for successive binary searches during transaction-tree removal in #32, #33, and #35.
- Mihail implemented Kyotaro's index suggestion but found Simon's simpler compression approach performed comparably; broader benchmarking then led him to adopt compression with a frequency of 64, which Simon polished for submission in #36, #37, and #38.
Nov 2022 · 10 entries
- When Tom Lane revisited the patch, he initially could not reproduce the original slowdown, and discussion returned to balancing snapshot costs against startup-process work in #42, #44, and #47.
- Andres identified that sampling transaction IDs divisible by a constant could miss compression indefinitely with certain subtransaction workloads, and Tom recommended counting compression attempts instead in #45 and #46.
- The discussion also revisited removing the spinlock, but Tom clarified that adding entries can occur without ProcArrayLock, preventing the proposed compression by other backends; Mihail reposted the old barrier patch while reporting no measurable benefit in #48, #50, #51, and #53.
- Andres proposed tracking wasted snapshot-scan work, and Mihail implemented and initially benchmarked an atomic counter that triggered compression after enough wasted work accumulated in #49 and #54.
- Simon added forced compression after pruning old transactions and when the startup process became idle, addressing workloads with little read traffic or little incoming WAL in #57.
- Tom questioned the shared counter's contention cost and proposed combining the simpler occupancy heuristic with forced events and an already-compact check; Simon accepted a transaction-count fallback in #58, #60, and #61.
- Mihail combined the fixed heuristic, transaction-end counter, forced events, explicit compression reasons, and a one-second idle limit in #62, then reported broader benchmarks supporting a frequency of 128 in #63.
- Tom found that idle maintenance should decide whether compression was worthwhile before acquiring ProcArrayLock, and requested internal lock handling; he also deferred the separate search and barrier optimizations because their additional benefit remained unproven in #64.
- Tom committed #62 with moderate changes to locking, idle call coverage, naming, and the compression frequency as 8242752f9c, announced the push in #65, and backpatched the fix because older branches suffered more severely.
- The compression work was closed as committed, while possible follow-up work was directed to a separate commitfest entry; Tom questioned the need for an additional startup-process assertion, and Simon expressed satisfaction with the completed fix in #66, #67, and #68.