pgsql: Add a view to show the stats of subscription workers.

Поиск
Список
Период
Сортировка
От Amit Kapila
Тема pgsql: Add a view to show the stats of subscription workers.
Дата
Msg-id E1mrtvV-0002Gz-73@gemulon.postgresql.org
обсуждение исходный текст
Ответы Re: pgsql: Add a view to show the stats of subscription workers.  (Amit Kapila <amit.kapila16@gmail.com>)
Список pgsql-committers
Add a view to show the stats of subscription workers.

This commit adds a new system view pg_stat_subscription_workers, that
shows information about any errors which occur during the application of
logical replication changes as well as during performing initial table
synchronization. The subscription statistics entries are removed when the
corresponding subscription is removed.

It also adds an SQL function pg_stat_reset_subscription_worker() to reset
single subscription errors.

The contents of this view can be used by an upcoming patch that skips the
particular transaction that conflicts with the existing data on the
subscriber.

This view can be extended in the future to track other xact related
statistics like the number of xacts committed/aborted for subscription
workers.

Author: Masahiko Sawada
Reviewed-by: Greg Nancarrow, Hou Zhijie, Tang Haiying, Vignesh C, Dilip Kumar, Takamichi Osumi, Amit Kapila
Discussion: https://postgr.es/m/CAD21AoDeScrsHhLyEPYqN3sydg6PxAPVBboK=30xJfUVihNZDA@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/8d74fc96db5fd547e077bf9bf4c3b67f821d71cd

Modified Files
--------------
doc/src/sgml/monitoring.sgml                | 157 +++++++++++
src/backend/catalog/system_functions.sql    |   4 +
src/backend/catalog/system_views.sql        |  23 ++
src/backend/commands/subscriptioncmds.c     |  16 +-
src/backend/postmaster/pgstat.c             | 409 +++++++++++++++++++++++++++-
src/backend/replication/logical/worker.c    |  54 +++-
src/backend/utils/adt/pgstatfuncs.c         | 128 ++++++++-
src/include/catalog/catversion.h            |   2 +-
src/include/catalog/pg_proc.dat             |  18 ++
src/include/pgstat.h                        | 109 +++++++-
src/test/regress/expected/rules.out         |  18 ++
src/test/subscription/t/026_worker_stats.pl | 154 +++++++++++
src/tools/pgindent/typedefs.list            |   4 +
13 files changed, 1069 insertions(+), 27 deletions(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Michael Paquier
Дата:
Сообщение: pgsql: Fix typos
Следующее
От: Michael Paquier
Дата:
Сообщение: pgsql: Fix flags of some GUCs and improve some descriptions