model-writtenrun 8028 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
Jun - Jul 2020 · 8 entries
- Masahiko Sawada opened the thread because spill counters could only be reset by restarting logical replication, while Fujii Masao objected to mixing cumulative statistics with live process information and Sawada wanted SQL-interface decoding covered too #1 #3 #5.
- Magnus Hagander argued that counters tied to a WALSender disappear on reconnect and cannot support reliable long-term monitoring, favoring replication-slot aggregation and persistence #9 #24.
- Amit Kapila explored per-process statistics for tuning logical_decoding_work_mem, but Tomas Vondra advocated collector-managed per-slot counters and rejected automatic resets when that setting changes; the discussion converged on the slot-based approach #23 #32 #33 #38 #45.
- Sawada's proof of concept introduced pg_stat_replication_slots and an array of collector entries keyed by slot name, with updates sent while decoding commits #48.
- Ajin Cherian tested two publications and found both slots accumulating spill statistics; Sawada explained that logical decoding processes WAL before publication filtering, so this was expected behavior #49 #50.
- Review considered stable slot identifiers and UDP message ordering, but the participants retained slot names and accepted occasional lost updates rather than inventing slot OIDs for this feature #51 #54 #58 #61.
- Because the replacement was too substantial for PostgreSQL 13's beta period, Amit posted a revert, Sawada identified missing release-note cleanup, and the revert landed with light adjustments as d973747281, including a PostgreSQL 13 backport #59 #60 #64.
- Amit rebased Sawada's implementation for PostgreSQL 14, and Sawada added the reset function and bounds handling so reordered create/drop messages could not overflow the collector's slot array #65 #66 #70.
Sep - Oct 2020 · 17 entries
- After the summer gap, Amit's detailed review led to stats_reset exposure, slot-name validation, reset-loop corrections and statistics-file changes; an incidental archiver/SLRU error-handling patch was attached and then moved to a separate discussion #71 #72 #73.
- Amit supplied comment fixes and took over revisions that moved reporting into DecodeCommit and DecodeAbort, counted spill-before-stream transactions correctly, avoided counting empty spills and sent slot-creation messages under the allocation lock #76 #77.
- Amit added polling-based regression tests as a separate patch, then removed the temporary always-spill debugging GUC and cleaned up formatting; Dilip Kumar's review led to logical-only view rows, clearer comments and consistent counter ordering #78 #79 #82 #84.
- Sawada's subsequent review produced SlotIsLogical() checks and suppression of reset messages for physical slots, while discussion retained an initially empty reset timestamp for newly created slots #85 #86 #87 #89 #90.
- The feature portion of #90 landed as 9868167500 with a catalog-version bump, while its regression tests were deliberately held for a later commit #92.
- Amit separately rebased the streaming-statistics extension, identified that counters should be updated only after successful transaction processing, and agreed with Sawada to continue that work in another thread #97 #99 #103.
- Sawada expanded the remaining tests to reset counters and decode the same transaction again using pg_logical_slot_peek_changes(), moving them into dedicated stats files and applying Amit's helper-name and cleanup requests #95 #96 #98 #101 #105.
- Noriyoshi Shinoda independently proposed renaming name to slot_name, changing its type and fixing the CLOS macro typo; Sawada's review improved the catalog definition, NameStr() usage and regression expectations #100 #102 #104.
- The tests landed unchanged from #105 as 8fccf75834, but buildfarm failures immediately showed that exact spill_count expectations were unstable #107.
- Tom Lane questioned exact-count testing and identified possible platform-alignment effects, while Amit explained how interleaved background transactions could publish partial accumulated statistics; the fix skipped empty transactions and asserted positive spill counters #110 #112 #115 #117.
- After adding explanatory comments and reproducing the failure with a debugger, Amit committed #119 unchanged as 2050832d0d; Sawada also reproduced the problem and confirmed the fix #121 #123 #124.
- Tom questioned whether even the revised test could miss spilling entirely, and Amit explained that decoding continues and later reports the completed transaction's statistics #125 #126.
- Shinoda alternately removed and restored the proposed name-type conversion, but discussion of collector storage and pg_stat_wal_receiver settled on retaining text; Amit selected the earlier #127 instead of #130 #131 #132.
- The selected rename and macro fix landed as 03d51b776d, with Amit adding missing contrib/test_decoding updates and a catalog-version bump #134.
- Amit followed up on the unclear counter documentation, Sawada caught a missing word, and the expanded descriptions from #142 landed unchanged as 2f0760c9ff #137 #138 #141.
- Justin Pryzby supplied further wording corrections, then reviewed the resulting patch and suggested dropping 'accordingly'; Amit made that final edit and committed #144 as 9e0f87a495 #143 #145 #147.
- At the final message, the replacement spill statistics, reset tests, test-stability fix, column rename and documentation updates had landed; streaming statistics had been redirected to another thread, and its completion is not established here #103 #147.