Subject: Re: Perform streaming logical transactions by background workers and parallel apply

From: Peter Smith <[email-masked]>
Date: Fri, 13 Jan 2023 16:05:39 +1100

On Fri, Jan 13, 2023 at 2:37 PM Amit Kapila <[email-masked]> wrote:
>
> > 3.
> >
> >        <entry role="catalog_table_entry"><para role="column_definition">
> > +       <structfield>leader_pid</structfield> <type>integer</type>
> > +      </para>
> > +      <para>
> > +       Process ID of the leader apply worker if this process is a parallel
> > +       apply worker; NULL if this process is a leader apply worker or does not
> > +       participate in parallel apply, or a synchronization worker
> > +      </para></entry>
> >
> > I felt this change is giving too many details and ended up just
> > muddying the water.
> >
>
> I see that we give a similar description for other parameters as well.
> For example leader_pid in pg_stat_activity, see client_dn,
> client_serial in pg_stat_ssl. It is better to be consistent here and
> this gives the reader a bit more information when the value is NULL
> for the new column.
>

It is OK to give extra details as those other examples do, but my
point -- where I wrote "the leader apply worker and the (not leader)
apply worker are one-and-the-same process" -- was there are currently
only 3 kinds of workers possible (leader apply, parallel apply,
tablsync). If it is not a "parallel apply" worker then it can only be
one of the other 2. So I think it is sufficient and less confusing to
say:

Process ID of the leader apply worker if this process is a parallel
apply worker; NULL if this process is a leader apply worker or a
synchronization worker.

------
Kind Regards,
Peter Smith.
Fujitsu Australia