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

From Dilip Kumar
Subject Re: SUBTRANS: Minimizing calls to SubTransSetParent()
Date
Msg-id CAFiTN-sGAT=c0q7AKewtxmYaDWAfjmUzn5wQckt=y47s5jbmcw@mail.gmail.com
Whole thread Raw
In response to Re: SUBTRANS: Minimizing calls to SubTransSetParent()  (Simon Riggs <simon.riggs@enterprisedb.com>)
List pgsql-hackers
On Wed, Nov 16, 2022 at 8:41 AM Simon Riggs
<simon.riggs@enterprisedb.com> wrote:
>
> > No, that's not what XidInMVCCSnapshot does. If snapshot->suboverflowed
> > is set (ie, somebody somewhere/somewhen overflowed), then it does
> > SubTransGetTopmostTransaction and searches only the xips with the result.
> > This behavior requires that all live subxids be correctly mapped by
> > SubTransGetTopmostTransaction, or we'll draw false conclusions.
>
> Your comments are correct wrt to the existing coding, but not to the
> patch, which is coded as described and does not suffer those issues.
>

This will work because of these two changes in patch 1) even though
the snapshot is marked "overflow" we will include all the
subtransactions information in snapshot->subxip. 2) As Simon mentioned
in XidInMVCCSnapshot(), first, we search the subxip cache in
snapshot->subxip, and only if it is not found in that we will look
into the SLRU.  So now because of 1) we will always find any
concurrent subtransaction in "snapshot->subxip".

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



pgsql-hackers by date:

Previous
From: Nathan Bossart
Date:
Subject: Re: Suppressing useless wakeups in walreceiver
Next
From: Simon Riggs
Date:
Subject: Re: Hash index build performance tweak from sorting