pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add leader_pid to pg_stat_activity
Date: Thu, 06 Feb 2020 00:23:33 +0000
Message-ID: <E1izUxB-0000w0-9P@gemulon.postgresql.org> (raw)

Add leader_pid to pg_stat_activity

This new field tracks the PID of the group leader used with parallel
query.  For parallel workers and the leader, the value is set to the
PID of the group leader.  So, for the group leader, the value is the
same as its own PID.  Note that this reflects what PGPROC stores in
shared memory, so as leader_pid is NULL if a backend has never been
involved in parallel query.  If the backend is using parallel query or
has used it at least once, the value is set until the backend exits.

Author: Julien Rouhaud
Reviewed-by: Sergei Kornilov, Guillaume Lelarge, Michael Paquier, Tomas
Vondra
Discussion: https://postgr.es/m/CAOBaU_Yy5bt0vTPZ2_LUM6cUcGeqmYNoJ8-Rgto+c2+w3defYA@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/b025f32e0b5d7668daec9bfa957edf3599f4baa8

Modified Files
--------------
doc/src/sgml/monitoring.sgml         | 12 ++++++++++
src/backend/catalog/system_views.sql |  1 +
src/backend/utils/adt/pgstatfuncs.c  | 44 +++++++++++++++++++++---------------
src/include/catalog/pg_proc.dat      |  6 ++---
src/test/regress/expected/rules.out  |  9 ++++----
5 files changed, 47 insertions(+), 25 deletions(-)



Message-ID: <E1izUxB-0000w0-9P@gemulon.postgresql.org>
Permalink:  ../E1izUxB-0000w0-9P@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1izUxB-0000w0-9P@gemulon.postgresql.org

 · 

reply

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: michael@paquier.xyz
  Subject: Re: pgsql: Add leader_pid to pg_stat_activity
  In-Reply-To: <E1izUxB-0000w0-9P@gemulon.postgresql.org>
  References: <E1izUxB-0000w0-9P@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