Hello,

On Thu, Dec 26, 2019 at 12:18 PM Sergei Kornilov <s...@zsrv.org> wrote:
>
> 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

As I understand it, lock group is some infrastructure that is used by
parallel queries, but could be used for something else too.  So if
more documentation is needed, we should say something like "For now,
only parallel queries can have a lock group" or something like that.

The fact that leader_pid == pid for the leader and different for the
other member should be obvious, I'm not sure that it's worth
documenting that.

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

Yes, I was unsure if some extra testing was required.  We could set
force_parallel_mode to on and query "select leader_pid is not null
from pg_stat_activity where pid = pg_backend_pid(), and then the
opposite test, which should do the trick.


Reply via email to