Re: BUG #18280: logical decoding build wrong snapshot for subtransactions

From: Andy Fan <zhihuifan1213(at)163(dot)com>
To: feichanghong <feichanghong(at)qq(dot)com>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org,Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>,Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Subject: Re: BUG #18280: logical decoding build wrong snapshot for subtransactions
Date: 2024-01-12 02:00:41
Message-ID: 878r4vmho2.fsf@163.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


Hi,

Thanks for the steps for reproducing this bug and the fix!

"feichanghong" <feichanghong(at)qq(dot)com> writes:

>> 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.

The patch looks good to me.

Added Masahiko who is the author of commit 272248a and Amit who is alway
good at this area as well. Hope this can get more attention from them.

--
Best Regards
Andy Fan

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Richard Guo 2024-01-12 06:50:33 Re: BUG #18284: Filter in left lateral join not respected
Previous Message PG Bug reporting form 2024-01-11 22:44:37 BUG #18285: pgdg.list doesn't work