Re: Expose lock group leader pid in pg_stat_activity

From: Sergei Kornilov <sk(at)zsrv(dot)org>
To: Julien Rouhaud <rjuju123(at)gmail(dot)com>, Guillaume Lelarge <guillaume(at)lelarge(dot)info>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Expose lock group leader pid in pg_stat_activity
Date: 2019-12-26 11:18:52
Message-ID: 5153051577359132@sas8-b090c2642e35.qloud-c.yandex.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello

I doubt that "Process ID of the lock group leader" is enough for user documentation. I think we need note:
- this field is related to parallel query execution
- leader_pid = pid if process is parallel leader
- leader_pid would point to pid of the leader if process is parallel worker
- leader_pid will be NULL for non-parallel queries or idle sessions

Also patch has no tests. Possible this is normal, not sure how to write a reliable test for this feature.
Patch applies, compiles, pass tests

regards, Sergei

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ashutosh Sharma 2019-12-26 11:32:05 Re: Calling PLpgSQL function with composite type fails with an error: "ERROR: could not open relation with OID ..."
Previous Message Amit Khandekar 2019-12-26 11:05:25 Re: Minimal logical decoding on standbys