From: feichanghong <feichanghong@qq.com>
To: Amit Kapila <amit.kapila16@gmail.com>
Cc: pgsql-bugs <pgsql-bugs@lists.postgresql.org>
Subject: Re: BUG #18280: logical decoding build wrong snapshot for subtransactions
Date: Tue, 23 Jan 2024 20:27:59 +0800
Message-ID: <tencent_723A813F904CD8386E1078951ADEED326409@qq.com> (raw)
In-Reply-To: <CAA4eK1L7FC3o6tqnXXimxTc7wmUXw2SWQ7bs2Fc_eBK2OpFSDg@mail.gmail.com>
References: <18280-4c8060178cb41750@postgresql.org>
<tencent_0726471CA7087C4AC6EF1F19409DF11FCF08@qq.com>
<CAA4eK1L7FC3o6tqnXXimxTc7wmUXw2SWQ7bs2Fc_eBK2OpFSDg@mail.gmail.com>
Thank you for your attention.
> On Jan 23, 2024, at 19:42, Amit Kapila <amit.kapila16@gmail.com> wrote:
>
> On Wed, Jan 10, 2024 at 7:56 PM feichanghong <feichanghong@qq.com> wrote:
>>
>>> SnapBuildXidSetCatalogChanges (introduced in 272248a) skipping the check for
>>> the sub-transactions when the parent transaction has been marked as
>>> containing catalog changes should be the root cause of the problem.
>>
>> My fix is to remove the ReorderBufferXidHasCatalogChanges condition from the SnapBuildXidSetCatalogChanges function. This approach has a false positive; the subtransactions that didn't change catalog to the snapshot are also added to the commit list. But that won't be a problem since we use snapshot built during decoding only to read system catalogs, as 272248a's commit message says.
>>
>
> Thanks, your analysis sounds correct to me. BTW, I think this should
> occur only in 15 and 14 because in prior branches we didn't check if
> the xact has catalog changes before marking its subxacts. From 16
> onwards, we already accurately serialize the xacts and subxacts that
> have made any catalog changes, so this problem shouldn't be there. Can
> you please once verify the same?
>
Yes, I verified versions 11 to 16 one by one, and this problem only occurs
in 14 and 15.
Best Regards,
Fei Changhong
Alibaba Cloud Computing Ltd.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: feichanghong@qq.com, amit.kapila16@gmail.com, pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18280: logical decoding build wrong snapshot for subtransactions
In-Reply-To: <tencent_723A813F904CD8386E1078951ADEED326409@qq.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox