Re:BUG #18280: logical decoding build wrong snapshot for subtransactions - Mailing list pgsql-bugs

From feichanghong
Subject Re:BUG #18280: logical decoding build wrong snapshot for subtransactions
Date
Msg-id tencent_0726471CA7087C4AC6EF1F19409DF11FCF08@qq.com
Whole thread Raw
In response to BUG #18280: logical decoding build wrong snapshot for subtransactions  (PG Bug reporting form <noreply@postgresql.org>)
Responses Re: BUG #18280: logical decoding build wrong snapshot for subtransactions  (Andy Fan <zhihuifan1213@163.com>)
Re: BUG #18280: logical decoding build wrong snapshot for subtransactions  (Amit Kapila <amit.kapila16@gmail.com>)
List pgsql-bugs
> 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 attached patch has been verified to resolve the mentioned issue.

Best regards.


Alibaba Cloud Computing Ltd.
Attachment

pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #18281: Superuser can rename the schema with the prefix "pg_" (Applies to all versions of postgresql)
Next
From: "David G. Johnston"
Date:
Subject: Re: BUG #18281: Superuser can rename the schema with the prefix "pg_" (Applies to all versions of postgresql)