From: Amit Kapila <akapila@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Reconsider pg_stat_subscription_workers view.
Date: Tue, 01 Mar 2022 01:00:05 +0000
Message-ID: <E1nOqs0-000MbB-Mg@gemulon.postgresql.org> (raw)
Reconsider pg_stat_subscription_workers view.
It was decided (refer to the Discussion link below) that the stats
collector is not an appropriate place to store the error information of
subscription workers.
This patch changes the pg_stat_subscription_workers view (introduced by
commit 8d74fc96db) so that it stores only statistics counters:
apply_error_count and sync_error_count, and has one entry for
each subscription. The removed error information such as error-XID and
the error message would be stored in another way in the future which is
more reliable and persistent.
After removing these error details, there is no longer any relation
information, so the subscription statistics are now a cluster-wide
statistics.
The patch also changes the view name to pg_stat_subscription_stats since
the word "worker" is an implementation detail that we use one worker for
one tablesync and one apply.
Author: Masahiko Sawada, based on suggestions by Andres Freund
Reviewed-by: Peter Smith, Haiying Tang, Takamichi Osumi, Amit Kapila
Discussion: https://postgr.es/m/20220125063131.4cmvsxbz2tdg6g65@alap3.anarazel.de
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/7a85073290856554416353a89799a4c04d09b74b
Modified Files
--------------
doc/src/sgml/logical-replication.sgml | 4 +-
doc/src/sgml/monitoring.sgml | 99 +----
src/backend/catalog/system_functions.sql | 4 +-
src/backend/catalog/system_views.sql | 27 +-
src/backend/postmaster/pgstat.c | 656 +++++++++++++---------------
src/backend/replication/logical/worker.c | 44 +-
src/backend/utils/adt/pgstatfuncs.c | 156 +++----
src/include/catalog/catversion.h | 2 +-
src/include/catalog/pg_proc.dat | 27 +-
src/include/pgstat.h | 129 ++----
src/test/regress/expected/rules.out | 23 +-
src/test/subscription/t/026_stats.pl | 102 +++++
src/test/subscription/t/026_worker_stats.pl | 165 -------
src/tools/pgindent/typedefs.list | 8 +-
14 files changed, 582 insertions(+), 864 deletions(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: akapila@postgresql.org
Subject: Re: pgsql: Reconsider pg_stat_subscription_workers view.
In-Reply-To: <E1nOqs0-000MbB-Mg@gemulon.postgresql.org>
References: <E1nOqs0-000MbB-Mg@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox