Re: SUBTRANS: Minimizing calls to SubTransSetParent() - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: SUBTRANS: Minimizing calls to SubTransSetParent()
Date
Msg-id CANbhV-Fg4qObbC1id6CzHhAS4k1U0k-GBvbZsBieZ4L=OHirfg@mail.gmail.com
Whole thread Raw
In response to Re: SUBTRANS: Minimizing calls to SubTransSetParent()  (Dilip Kumar <dilipbalaut@gmail.com>)
Responses Re: SUBTRANS: Minimizing calls to SubTransSetParent()
Re: SUBTRANS: Minimizing calls to SubTransSetParent()
List pgsql-hackers
On Thu, 11 Aug 2022 at 06:32, Dilip Kumar <dilipbalaut@gmail.com> wrote:

> > > So I still think some adjustment is required in XidInMVCCSnapdhot()
> >
> > That is one way to resolve the issue, but not the only one. I can also
> > change AssignTransactionId() to recursively register parent xids for
> > all of a subxid's parents.
> >
> > I will add in a test case and resolve the dependency in my next patch.
>
> Okay, thanks, I will look into the updated patch after you submit that.

PFA two patches, replacing earlier work
001_new_isolation_tests_for_subxids.v3.patch
002_minimize_calls_to_SubTransSetParent.v8.patch

001_new_isolation_tests_for_subxids.v3.patch
Adds new test cases to master without adding any new code, specifically
addressing the two areas of code that are not tested by existing tests.
This gives us a baseline from which we can do test driven development.
I'm hoping this can be reviewed and committed fairly smoothly.

002_minimize_calls_to_SubTransSetParent.v8.patch
Reduces the number of calls to subtrans below 1% for the first 64 subxids,
so overall will substantially reduce subtrans contention on master for the
typical case, as well as smoothing the overflow case.
Some discussion needed on this; there are various options.
This combines the work originally posted here with another patch posted on the
thread "Smoothing the subtrans performance catastrophe".

I will do some performance testing also, but more welcome.

-- 
Simon Riggs                http://www.EnterpriseDB.com/

Attachment

pgsql-hackers by date:

Previous
From: Nathan Bossart
Date:
Subject: Re: archive modules
Next
From: vignesh C
Date:
Subject: Re: Handle infinite recursion in logical replication setup