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

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Peter Smith <smithpb2250(at)gmail(dot)com>
Cc: "houzj(dot)fnst(at)fujitsu(dot)com" <houzj(dot)fnst(at)fujitsu(dot)com>, shveta malik <shveta(dot)malik(at)gmail(dot)com>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, "wangw(dot)fnst(at)fujitsu(dot)com" <wangw(dot)fnst(at)fujitsu(dot)com>, "shiy(dot)fnst(at)fujitsu(dot)com" <shiy(dot)fnst(at)fujitsu(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Dilip Kumar <dilipbalaut(at)gmail(dot)com>
Subject: Re: Perform streaming logical transactions by background workers and parallel apply
Date: 2023-01-13 03:36:55
Message-ID: CAA4eK1JO54=3s0KM9iZGSrQmmfzk9PEOKkW8TXjo2OKaKrSGCA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jan 13, 2023 at 7:56 AM Peter Smith <smithpb2250(at)gmail(dot)com> wrote:
>
> Here are my review comments for v79-0001.
>
> ======
>
> General
>
> 1.
>
> When Amit suggested [1] changing the name just to "leader_pid" instead
> of "leader_apply_pid" I thought he was only referring to changing the
> view column name, not also the internal member names of the worker
> structure. Maybe it is OK anyway, but please check if that was the
> intention.
>

Yes, that was the intention.

>
> 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.

>
> 4.
>
> @@ -949,6 +949,7 @@ CREATE VIEW pg_stat_subscription AS
> su.oid AS subid,
> su.subname,
> st.pid,
> + st.leader_pid,
> st.relid,
> st.received_lsn,
> st.last_msg_send_time,
>
> IMO it would be very useful to have an additional "kind" attribute for
> this view. This will save the user from needing to do mental
> gymnastics every time just to recognise what kind of process they are
> looking at.
>

This could be a separate enhancement as the same should be true for
sync workers.

--
With Regards,
Amit Kapila.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2023-01-13 03:38:38 Re: Blocking execution of SECURITY INVOKER
Previous Message Andres Freund 2023-01-13 03:29:43 Re: Blocking execution of SECURITY INVOKER