model-writtenrun 5718 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
Jan - Mar 2022 ยท 16 entries
- Andres Freund opened the thread after the existing pg_stat_subscription_workers implementation complicated his shared-memory statistics work, arguing that lossy statistics storage was unsuitable for error state and retained oversized entries for dropped tables #1.
- Masahiko Sawada initially explained that transaction skipping could also use server logs and that catalog updates during failed transactions were problematic, while David G. Johnston wanted reliable current-error information; Andres showed how to abort the failed transaction before recording state and proposed LSNs instead of wraparound-prone XIDs #2 #5 #6.
- The discussion explored catalog tables, shared memory and retry behavior: Peter Eisentraut favored tables for storing error information, Amit Kapila defended automatic retries for transient failures, and Andres emphasized durable information when users might skip replicated transactions #14 #19 #23.
- Andres drew a firm distinction between cumulative counters and individual error details, prompting Amit to accept separating persistent error information from statistics and to promise a revert if that separation could not be completed before feature freeze #24 #27.
- Sawada proposed a broader roadmap covering an error catalog, cleanup of obsolete entries, error LSNs, transaction skipping and skipped-change history, with history potentially deferred to a later release; these remained proposals beyond the attached statistics patch #30.
- Andres then argued for counters keyed only by subscription and against exposing worker identity, while Sawada explained why cumulative counters should remain separate from the existing dynamic pg_stat_subscription view; the discussion converged on a separate subscription-level statistics view #40 #42 #44 #47 #48.
- Sawada's first patch removed error messages, transaction IDs and relation-specific details, retaining apply and synchronization error counters under the provisional name pg_stat_subscription_activity #55.
- Takamichi Osumi, Haiying Tang and Peter Smith identified documentation mistakes, unnecessary test setup and overly restrictive counter checks, while Amit and Sawada retained PG_TRY/PG_CATCH reporting because the process-exit path would clear the worker's subscription identity before statistics reporting #57 #63 #64 #65 #66.
- Andres observed that subscription statistics should live globally alongside the global subscription catalog, leading Sawada to rework storage in #67, add reset timestamps and reset-all support, and count failures during tablesync catch-up as synchronization errors #61 #62.
- Peter Eisentraut opposed the activity name because the view held accumulated counters and favored pg_stat_subscription_stats, also explaining that a counters suffix would poorly accommodate timestamp fields #71 #73 #77.
- Further review produced missing reset documentation, consistent naming, typedef registration and worker subscription-ID cleanup in #80, while reset-counter tests were left out because lost or reordered statistics messages could make them unstable #69 #70 #75 #76.
- Amit took over preparation of the patch, adopted pg_stat_subscription_stats, removed an obsolete database-ID field, renamed subscription-drop messages and reorganized helper functions while incorporating Peter Smith's remaining comments #86.
- Peter Smith and Takamichi Osumi accepted the revised patch after discussing wording and column ordering, and Amit posted the final revision with small cleanup changes and a statistics-file format bump; Tang subsequently reported successful review and testing #95 #98 #99 #100.
- Amit committed Sawada's patch from #99 as 7a85073290, adding only a catalog-version bump to the submitted code, and announced the push in #101; detailed error storage remained future work.
- After the commit, Andres questioned subscription-specific reset-all support and the proliferation of statistics-reset interfaces, while Amit defended consistency with replication-slot and SLRU resets; that broader interface disagreement remained unresolved #102 #103 #104 #105.
- The submitted statistics replacement was fully committed, and the thread ended with Andres announcing that it had unblocked a rebased shared-memory statistics patch in its separate thread #106.