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

From: "houzj(dot)fnst(at)fujitsu(dot)com" <houzj(dot)fnst(at)fujitsu(dot)com>
To: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, "wangw(dot)fnst(at)fujitsu(dot)com" <wangw(dot)fnst(at)fujitsu(dot)com>
Cc: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Peter Smith <smithpb2250(at)gmail(dot)com>, Dilip Kumar <dilipbalaut(at)gmail(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>
Subject: RE: Perform streaming logical transactions by background workers and parallel apply
Date: 2023-01-04 10:55:34
Message-ID: OS0PR01MB5716087C537FA8311F208B6094F59@OS0PR01MB5716.jpnprd01.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jan 4, 2023 at 13:31 PM Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com> wrote:
> On Tue, Jan 3, 2023 at 2:40 PM wangw(dot)fnst(at)fujitsu(dot)com
> <wangw(dot)fnst(at)fujitsu(dot)com> wrote:
> >
> > On Mon, Jan 2, 2023 at 18:54 PM Amit Kapila
> > <amit(dot)kapila16(at)gmail(dot)com>
> wrote:
> > > On Fri, Dec 30, 2022 at 3:55 PM wangw(dot)fnst(at)fujitsu(dot)com
> > > <wangw(dot)fnst(at)fujitsu(dot)com> wrote:
> > > >
> > > > I've checked it and it looks good to me.
> > > > Rebased the other patches and ran the pgident for the patch set.
> > > >
> > > > Attach the new patch set.
> > > >
> > >
> > > I have added a few DEBUG messages and changed a few comments in
> > > the
> > > 0001 patch. With that v71-0001* looks good to me and I'll commit
> > > it later this week (by Thursday or Friday) unless there are any
> > > major comments or objections.
> >
> > Thanks for your improvement.
> >
> > Rebased the patch set because the new change in HEAD (c8e1ba7).
> > Attach the new patch set.
>
> There are some unused parameters in v72 patches:

Thanks for your comments!

> +static bool
> +pa_can_start(TransactionId xid)
> +{
> + Assert(TransactionIdIsValid(xid));
>
> 'xid' is used only for the assertion check but I don't think it's necessary.

Agree. Removed this check.

> ---
> +/*
> + * Handle a single protocol message received from a single parallel
> +apply
> + * worker.
> + */
> +static void
> +HandleParallelApplyMessage(ParallelApplyWorkerInfo *winfo, StringInfo
> +msg)
>
> In addition, the same is true for 'winfo'.

Agree. Removed this parameter.

Attach the new patch set.
Apart from addressing Sawada-San's comments, I also did some other minor
changes in the patch:

* Adjusted a testcase about crash restart in 023_twophase_stream.pl, I
skipped the check for DEBUG msg as the msg might not be output if the crash happens
before that.
* Adjusted the code in pg_lock_status() to make the fields of
applytransaction lock display in more appropriate places.
* Add a comment to explain why we unlock the transaction before aborting the
transaction in parallel apply worker.

Best regards,
Hou zj

Attachment Content-Type Size
v73-0005-Add-a-main_worker_pid-to-pg_stat_subscription.patch application/octet-stream 9.5 KB
v73-0001-Perform-apply-of-large-transactions-by-parallel-.patch application/octet-stream 264.6 KB
v73-0002-Add-GUC-stream_serialize_threshold-and-test-seri.patch application/octet-stream 12.4 KB
v73-0003-Stop-extra-worker-if-GUC-was-changed.patch application/octet-stream 4.1 KB
v73-0004-Retry-to-apply-streaming-xact-only-in-apply-work.patch application/octet-stream 21.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dilip Kumar 2023-01-04 11:22:37 Re: Perform streaming logical transactions by background workers and parallel apply
Previous Message Spring Zhong 2023-01-04 10:21:30 grouping pushdown