Re: Logical replication CPU-bound with TRUNCATE/DROP/CREATE many tables

From: Dilip Kumar <dilipbalaut(at)gmail(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: Keisuke Kuroda <keisuke(dot)kuroda(dot)3862(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Logical replication CPU-bound with TRUNCATE/DROP/CREATE many tables
Date: 2020-10-01 04:18:39
Message-ID: CAFiTN-vGSkaOYDgyeKk_0YWHeSaoOi+Xg2V44A1pmSuiMd7Pqw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Oct 1, 2020 at 9:19 AM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
>
> On Thu, Oct 1, 2020 at 8:22 AM Keisuke Kuroda
> <keisuke(dot)kuroda(dot)3862(at)gmail(dot)com> wrote:
> >
> > Hi Dilip, Amit,
> >
> > Thank you for the patch!
> >
> > I test the patch on the master HEAD(9796f455) and it works fine.
> > * make installcheck-world: passed
> > * walsender process continues to use 100% of the CPU 1core when
> > TRUNCATE 1000 partition: 1s or less
> > ** before patch : 230s
> >
>
> Does this result indicate that it is still CPU bound but it does the
> actual decoding and completes in 1s instead of spending 230s mainly to
> execute unnecessary invalidations?
>
> > There is "ReorderBufferAddInvalidation" in reorderbuffer.h, but I
> > don't think it's needed.
> >
> > src/include/replication/reorderbuffer.h
> > +void ReorderBufferAddInvalidation(ReorderBuffer *, TransactionId,
> > XLogRecPtr lsn,
> > + int nmsgs, SharedInvalidationMessage *msgs);
> >
>
> From the patch perspective, I think it is better if we can add one
> test case as well where we process some invalidations and then the
> rollback happens and we need to process all the invalidations
> together. Basically, this is to cover the new code, if such a test
> already exists then it is fine.

I think we already have such a test case.
019_stream_subxact_ddl_abort.pl is covering this scenario.

--
Regards,
Dilip Kumar
EnterpriseDB: http://www.enterprisedb.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message tsunakawa.takay@fujitsu.com 2020-10-01 04:20:27 RE: [Patch] Optimize dropping of relation buffers using dlist
Previous Message Michael Paquier 2020-10-01 04:12:54 Re: POC: postgres_fdw insert batching