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

From: feichanghong <feichanghong(at)qq(dot)com>
To: feichanghong <feichanghong(at)qq(dot)com>, pgsql-bugs <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re:BUG #18280: logical decoding build wrong snapshot for subtransactions
Date: 2024-01-10 13:56:00
Message-ID: tencent_0726471CA7087C4AC6EF1F19409DF11FCF08@qq.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

&gt; SnapBuildXidSetCatalogChanges (introduced in 272248a) skipping the check for
&gt; the sub-transactions when the parent transaction has been marked as
&gt; 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&nbsp;attached&nbsp;patch&nbsp;has&nbsp;been&nbsp;verified&nbsp;to&nbsp;resolve&nbsp;the&nbsp;mentioned&nbsp;issue.

Best regards.

Alibaba Cloud Computing Ltd.

Attachment Content-Type Size
fix_wrong_snapshot_for_logical_decoding.patch application/octet-stream 5.6 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David G. Johnston 2024-01-10 13:59:45 Re: BUG #18281: Superuser can rename the schema with the prefix "pg_" (Applies to all versions of postgresql)
Previous Message PG Bug reporting form 2024-01-10 13:41:58 BUG #18281: Superuser can rename the schema with the prefix "pg_" (Applies to all versions of postgresql)