model-writtenrun 1087 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
Aug 2025 · 2 entries
- Bertrand Drouvot proposed fixed-size, cluster-wide lock statistics grouped by lock type, with a pg_stat_lock view exposing requests, waits, timeouts, deadlock checks, deadlocks and fast-path acquisitions to help diagnose contention and tune configuration #1.
- Greg Sabino Mullane reviewed naming, documentation and overhead, while Jeff Davis, Tom Lane and Michael Paquier questioned actionable uses and aggregation; Bertrand defended grouping by lock type as a starting point for investigating individual objects through pg_locks #2 #3 #4 #5 #8 #10.
Dec 2025 · 1 entry
- After a gap, Bertrand rebased the proposal in December and February, then followed Michael's recommendation to remove waits and deadlocks from the initial counter set and avoid duplicating the lock-type documentation #13 #14 #15 #16.
Feb - Apr 2026 · 19 entries
- Andres Freund challenged the cost and usefulness of counting every acquisition and proposed waits, wait_time and fast-path slot exhaustion instead; Bertrand substantially rewrote the patch around those metrics, initially reusing the log_lock_waits timing path #17 #20 #21.
- Michael argued that statistics should not depend on logging, leading Bertrand to introduce track_lock_timing, unconditional waits and a separate timed_waits counter; Andres objected to the extra GUC and counter split, so Bertrand isolated the GUC into an optional patch and subsequently removed the split #22 #23 #24 #25 #26 #28.
- After another rebase, Michael supported the reduced metric set and dropping the optional GUC; Bertrand also moved the isolation scenarios into their own test and shortened their sleeps #29 #30 #31.
- Michael then requested unconditional collection of qualifying long waits and a smaller header dependency, producing a series that collected waits independently of log_lock_waits and extracted lock-tag declarations into locktag.h #32 #33.
- Michael committed the header portion as 322bab7974, expanding the extraction from #33 to include lock-tag construction macros and lock-method declarations so users of the new header would not need LOCKTAG internals spread across headers #34.
- Alvaro Herrera used the new header to start a separate include-dependency cleanup, expanding four patches into fourteen lock.h cleanups plus a clog.h cleanup; removing lock.h from proc.h was left out because the required forward declarations were judged too cumbersome #35 #36.
- Bertrand checked the header dependencies and identified a redundant hsearch.h include, while Michael suggested moving further discussion of this separate cleanup to another thread #37 #38.
- Michael split the code movement from #33 into a90d865182, then landed the statistics and view as 4019f725f5 with light code, documentation and test edits after testing with CLOBBER_CACHE_ALWAYS #39.
- Alvaro combined the first fourteen patches of #36 into 2102ebb195, incorporating Bertrand's include correction and declaration sorting, and landed its unchanged clog.h component separately as f227b7b20c #40.
- Andres reported frequent Windows CI failures in the new isolation test; Michael explained that fixed sleeps could not reliably ensure deadlock-timeout processing and removed only that test in 7c64d56fd9, leaving the feature installed #41 #42.
- Bertrand recorded replacement test coverage as an open item and supplied TAP tests using a ProcSleep() injection-point notice plus a new BackgroundPsql stderr-wait helper, eliminating hardcoded sleeps #43 #47.
- Michael revised the TAP tests to use a waiting injection point and existing query_until()/echo synchronization, eliminating the proposed stderr helper; Bertrand then removed the unnecessary on_error_stop override and planned more CI runs #48 #49.
- Tomas Vondra discovered that a nonblocking statistics flush could skip contended entries and then erase their pending data, and questioned whether per-type locks provided any benefit #51.
- Bertrand benchmarked corrected per-type locking against a single lock, found no observable performance advantage, and supplied a single-lock fix that made flushes all-or-nothing while simplifying reset and snapshot callbacks #52.
- After additional successful CI runs, Michael landed the TAP tests from #49 as 557a9f1e3e with formatting and a minor Perl punctuation fix #53.
- Michael landed the single-lock patch from #52 as 404a17c155, changing only a protection comment and acknowledging the pending-statistics loss #54.
- Andres then reported an injection-point detach failure in the replacement test; Michael reproduced it with an artificial delay and supplied a patch removing the race between local-point cleanup and explicit detach, with adjusted attachment and wakeup synchronization #55 #56 #57.
- Michael committed that final patch unchanged apart from whitespace as 3284e3f63c after repeated CI runs; Bertrand's subsequent review raised the possibility of another backend reaching the now-global point but judged the synchronization safe #58 #59.
- At the thread's end, the reduced statistics feature, header cleanups, replacement TAP tests and both follow-up fixes had landed, and Michael reported quiet CI and buildfarm results while continuing to watch test stability #61.