From: Amit Kapila <akapila@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Display the leader apply worker's PID for parallel apply workers
Date: Wed, 18 Jan 2023 03:44:26 +0000
Message-ID: <E1pHzNC-004ECo-82@gemulon.postgresql.org> (raw)
Display the leader apply worker's PID for parallel apply workers.
Add leader_pid to pg_stat_subscription. leader_pid is the process ID of
the leader apply worker if this process is a parallel apply worker. If
this field is NULL, it indicates that the process is a leader apply
worker or a synchronization worker. The new column makes it easier to
distinguish parallel apply workers from other kinds of workers and helps
to identify the leader for the parallel workers corresponding to a
particular subscription.
Additionally, update the leader_pid column in pg_stat_activity as well to
display the PID of the leader apply worker for parallel apply workers.
Author: Hou Zhijie
Reviewed-by: Peter Smith, Sawada Masahiko, Amit Kapila, Shveta Mallik
Discussion: https://postgr.es/m/CAA4eK1+wyN6zpaHUkCLorEWNx75MG0xhMwcFhvjqm2KURZEAGw@mail.gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/d540a02a724b9643205abce8c5644a0f0908f6e3
Modified Files
--------------
doc/src/sgml/logical-replication.sgml | 3 +-
doc/src/sgml/monitoring.sgml | 36 ++++++++----
src/backend/catalog/system_views.sql | 1 +
.../replication/logical/applyparallelworker.c | 6 +-
src/backend/replication/logical/launcher.c | 64 ++++++++++++++++------
src/backend/utils/adt/pgstatfuncs.c | 21 +++++--
src/include/catalog/catversion.h | 2 +-
src/include/catalog/pg_proc.dat | 6 +-
src/include/replication/logicallauncher.h | 2 +
src/include/replication/worker_internal.h | 4 +-
src/test/regress/expected/rules.out | 3 +-
11 files changed, 105 insertions(+), 43 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: Display the leader apply worker's PID for parallel apply workers
In-Reply-To: <E1pHzNC-004ECo-82@gemulon.postgresql.org>
References: <E1pHzNC-004ECo-82@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