Re: expose parallel leader in CSV and log_line_prefix

Alvaro Herrera <alvherre@2ndquadrant.com>

From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Julien Rouhaud <rjuju123@gmail.com>
Cc: Michael Paquier <michael@paquier.xyz>, Justin Pryzby <pryzby@telsasoft.com>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2020-07-17T15:35:40Z
Lists: pgsql-hackers
> On Fri, Jul 17, 2020 at 7:01 AM Michael Paquier <michael@paquier.xyz> wrote:
>
> > Hmm.  Knowing if a leader is actually running parallel query or not
> > requires a lookup at lockGroupMembers, that itself requires a LWLock.
> > I think that it would be better to not require that.  So what if
> > instead we logged %P only if Myproc has lockGroupLeader set and it
> > does *not* match MyProcPid?

That's what I said first, so +1 for that approach.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



Commits

  1. Add %P to log_line_prefix for parallel group leader

  2. Tweak behavior of pg_stat_activity.leader_pid

  3. Add leader_pid to pg_stat_activity