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: Simon Riggs <simon(at)2ndquadrant(dot)com>, 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-09 05:25:14
Message-ID: CAFiTN-v9V=cx+qMA8ho+cRj_bWpx7hVGkWMDUOK=+iWpg8=UmQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Oct 9, 2020 at 10:29 AM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
>
> On Fri, Oct 9, 2020 at 10:06 AM Dilip Kumar <dilipbalaut(at)gmail(dot)com> wrote:
> >
> > On Fri, Oct 9, 2020 at 8:40 AM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
> > >
> > > On Thu, Oct 8, 2020 at 2:34 PM Simon Riggs <simon(at)2ndquadrant(dot)com> wrote:
> > > >
> > > > On Thu, 8 Oct 2020 at 09:47, Dilip Kumar <dilipbalaut(at)gmail(dot)com> wrote:
> > > >
> > > > > > This script will wait 10 seconds after INSERT exits
> > > > > > before executing TRUNCATE, please wait for it to run.
> > > >
> > > > Has this been tested with anything other than the one test case?
> > > >
> > > > It would be good to know how the patch handles a transaction that
> > > > contains many aborted subtransactions that contain invals.
> > > >
> > >
> > > Are you thinking from the angle of performance or functionality? I
> > > don't see how this patch can impact either of those. Basically, it
> > > will not execute any extra invalidations then it is executing without
> > > the patch for aborted subtransactions. Can you please explain in a bit
> > > more detail about your fear?
> > >
> > > Having said that, I think it would be a good idea to test the scenario
> > > you mentioned to ensure that we have not broken anything unknowingly.
> >
> > Yeah, even I feel that nothing should impact in this area because on
> > abort we are anyway executing all the invalidations and we will
> > continue to do so with the patch as well.
> >
>
> True, but I think we execute the invalidations only for the streaming
> case, otherwise, neither we need to execute invalidations nor we are
> doing it for abort case.

Right

> > I will test this scenario
> > to ensure nothing is broken.
> >
>
> If I have not missed anything then probably you need to prepare a
> scenario where we need to do streaming.

Yes the test should be like
BEGIN
Savepoint 1
- DDL
- large operation
rollback to s1;
-DDL
large operation
rollback to s1;
...

So ideally every time it tries to stream the subtransaction there
should be concurrent abort detected and it will execute all the
invalidations.

> I am fine with the testing of
> the non-streaming case as well if you want to ensure that we have not
> broken that case by starting to execute invalidations.

Okay

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2020-10-09 05:31:23 Re: Parallel copy
Previous Message Amit Kapila 2020-10-09 05:12:38 Re: Parallel copy