Re: BUG #18280: logical decoding build wrong snapshot for subtransactions
Andy Fan <zhihuifan1213@163.com>
From: Andy Fan <zhihuifan1213@163.com>
To: feichanghong <feichanghong@qq.com>
Cc: pgsql-bugs@lists.postgresql.org,Masahiko Sawada
<sawada.mshk@gmail.com>,Amit Kapila <amit.kapila16@gmail.com>
Date: 2024-01-12T02:00:41Z
Lists: pgsql-bugs
Hi, Thanks for the steps for reproducing this bug and the fix! "feichanghong" <feichanghong@qq.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
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Fix catalog lookup due to wrong snapshot for subtransactions during decoding.
- b793a416bfa8 15.6 landed
- 6b77048e571d 14.11 landed
-
Fix catalog lookup with the wrong snapshot during logical decoding.
- 272248a0c1b1 15.0 cited