model-writtenrun 6995 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
Jul - Sep 2025 · 22 entries
- Sami Imseih opened the thread with a dshash-backed proposal to make dynamically registered LWLock tranche names visible to every backend, so pg_stat_activity would report the extension's name consistently instead of sometimes reporting extension #1.
- Bertrand Drouvot suggested reusing custom wait-event machinery, and Sami supplied an alternative API that allocated a tranche and registered its wait event together #2 #6.
- Nathan Bossart argued for passing the name directly to LWLockNewTrancheId() and eliminating per-backend LWLockRegisterTranche() calls; Sami accepted that API simplification and moved away from custom wait events #5 #7 #8.
- Tom Lane warned against involving the postmaster in dynamic shared structures, while Nathan suggested an indexed DSA array and Rahila Syed proposed a fixed shared-memory table with bounded names #10 #12 #13.
- Sami implemented an in-place DSA containing a growable array of pointers to names, keeping startup names local and making later registrations shared while updating callers to the single-step API #21.
- Nathan rebased the DSA patch and raised lookup-cost concerns; Bertrand supported caching, and Sami added a backend-local array rather than another hash table #22 #23 #26 #29 #31.
- Bertrand's testing exposed incorrect DSA freeing, duplicate startup registration, and cache misses that still returned extension; Rahila also identified needless copying and freeing of individual names during growth #32 #35 #36.
- Sami corrected allocation and lookup handling, switched resizing to copying name pointers, synchronized the local cache more completely, and added an injection-point test module #34 #40.
- Nathan questioned accepting unregistered tranche IDs and found a build failure without injection points; subsequent revisions separated tests, simplified synchronization, rejected invalid IDs, and replaced injection-point instrumentation with debug logging #41 #42 #43 #44.
- Windows testing revealed that startup names were not inherited under EXEC_BACKEND, so Sami synchronized both startup-requested and dynamic names; Bertrand then reviewed comments, assertions, DSA sizing, and test organization #45 #46 #47 #48.
- Nathan reconsidered dshash to avoid maintaining a growable DSA array, but Andres Freund argued that a bounded shared array would avoid unnecessary mappings and complexity, and Tom supported limiting name lengths #49 #52 #53 #55 #57.
- Sami replaced the DSA design with fixed shared memory, initially allowing 1024 tranches; Nathan then explained how an append-only array and a backend-local counter could eliminate both the name cache and locking on ordinary lookups #62 #66 #70 #72.
- The name-length limit exposed the DSM registry's longer names and DSA suffix, leading Nathan to propose one tranche for each dshash table and its backing DSA; Sami added that change as a separate patch #63 #64 #65 #73 #74.
- Bertrand found NULL-name validation problems and recommended strlcpy(); Sami corrected validation ordering, expanded tests, clarified byte limits, and reduced the proposed tranche capacity to 128 #75 #76 #77 #78.
- Nathan prepared a two-patch series with DSM registry changes first, char ** shared-name access, and tests deferred; Sami restored validation details and briefly added an EXEC_BACKEND repair, which Nathan asked to keep in its original thread #79 #80 #82 #83.
- The DSM registry prerequisite last attached in #82 landed with only comment edits as 5487058b56, limiting names and sharing one tranche between DSA and dshash; Nathan then reposted the remaining implementation and restored tests for CI #84.
- CI exposed misaligned shared-memory pointer stores, which Nathan fixed; Bertrand approved the correction and supplied a separate CACHELINEALIGN cleanup, but Nathan deferred that cleanup until after the tranche work #85 #87 #89.
- Rahila found a stale declaration and questioned synchronization and the fixed capacity; Nathan removed the declaration, documented why the local counter permits safe unlocked reads, and left a configurable limit out of the final proposal #88 #90.
- The implementation from #90 landed as 38b602b028 with naming and comment edits, a 256-tranche limit, and names limited to NAMEDATALEN-1 bytes; its test companion remained deferred #91.
- After landing, Rahila again questioned a possible counter/name visibility window, and Nathan explained that the shared counter and name are published under one lock while the cached counter belongs exclusively to each backend #92 #93.
- Nathan proposed reverting the request array's eager 256-entry allocation because it wasted memory and duplicated a later limit check; Sami spotted that the proposed revert still allocated the larger size, and the corrected patch landed as d814d7fc3d #94 #95 #96.
- The deferred tests last attached here in #90 were subsequently rewritten into a dedicated SQL regression harness in thread #52146, where the later patchset #600866 supplied 16607718c0 with only reconnect removal and comment additions; the landing is attributed to that thread and credits Sami with Nathan as co-author.
Nov 2025 · 5 entries
- In November, Alexander Lakhin reported that exhausting tranche IDs with test_dsa could leave autoprewarm incompletely initialized and cause a stuck-spinlock PANIC on a later call #97.
- Sami initially proposed caching test_dsa_resowners()'s tranche ID in a static variable, but Nathan explained that avoiding leaks across backends required shared storage and that the registry also needed to reject incompletely initialized entries #99 #100 #101 #102.
- Nathan supplied a two-patch repair covering registry initialization state and one shared tranche for both test_dsa functions; Sami tested the failure handling, requested entry names in errors, and approved the revised series #103 #104 #105 #106.
- The registry guard from #105 landed as ac2800ddc1, whose supplied diff adapts the fix to a DSM-segment-only registry layout, while the unchanged test_dsa component landed separately as c5c74282f2.
- Nathan's final message confirms both November fixes were committed, closing the active repair round; the core feature and allocation correction had also landed, the dedicated tests landed through thread #52146, and the separate Windows work and optional alignment cleanup remained outside this thread's completed series #107 #83 #89.