From: cca5507 <cca5507@qq.com>
To: Masahiko Sawada <sawada.mshk@gmail.com>
To: ocean_li_996 <ocean_li_996@163.com>
Cc: pgsql-hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: [BUG] Incorrect historic snapshot may be serialized to diskduring fast-forwarding
Date: Tue, 30 Dec 2025 10:57:46 +0800
Message-ID: <tencent_3E54BE10BD962F65480619CFEC40CFCE2105@qq.com> (raw)
In-Reply-To: <CAD21AoBVW5P8_xQhL_Gqds4DN3vsG_wa1eoZ_rtLJjJSPuBVAg@mail.gmail.com>
References: <tencent_3A071B760AA1A38540B57F297332B7781C08@qq.com>
<1f1c51f3.4ed.19aae7e9de0.Coremail.ocean_li_996@163.com>
<tencent_95D13240784107B9768CA1DD851DB5B52908@qq.com>
<5669a88e.eee.19aaf6aa83a.Coremail.ocean_li_996@163.com>
<CAD21AoBVW5P8_xQhL_Gqds4DN3vsG_wa1eoZ_rtLJjJSPuBVAg@mail.gmail.com>
Hi,
> While I agree with your analysis, I'm not sure what actual problems it
> could lead to in practice. Have you had a chance to reproduce this
> behavior by using DDLs instead of a user-catalog table?
I'm not sure if this can be reproduced by using DDLs, but I will try.
> IIUC the problem can occur if a transaction makes catalog changes and writes
> only NEW_CID WAL records without INVALIDATION WAL records.
+1
> However, I'm not sure there are such transactions in practice.
Maybe currently not, but what about future, I'm not sure yet.
> IIUC it would not be a problem in terms of logical decoding even if we
> don't include their XIDs to the snapshot if they change only user-catalog
> tables. It might be more future proof to mark transactions as catalog-changed
> even when fast-forwarding a NEW_CID record, as you proposed, but I'd
> like to confirm the actual problems first.
Our current design of historic snapshot is to track all catalogs even if only a part
of them are useful for logical decoding. So I think this bug breaks our design even
if it's maybe ok in practice.
--
Regards,
ChangAo Chen
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-hackers@postgresql.org
Cc: cca5507@qq.com, sawada.mshk@gmail.com, ocean_li_996@163.com
Subject: Re: [BUG] Incorrect historic snapshot may be serialized to diskduring fast-forwarding
In-Reply-To: <tencent_3E54BE10BD962F65480619CFEC40CFCE2105@qq.com>
References: <tencent_3A071B760AA1A38540B57F297332B7781C08@qq.com> <1f1c51f3.4ed.19aae7e9de0.Coremail.ocean_li_996@163.com> <tencent_95D13240784107B9768CA1DD851DB5B52908@qq.com> <5669a88e.eee.19aaf6aa83a.Coremail.ocean_li_996@163.com> <CAD21AoBVW5P8_xQhL_Gqds4DN3vsG_wa1eoZ_rtLJjJSPuBVAg@mail.gmail.com> <tencent_3E54BE10BD962F65480619CFEC40CFCE2105@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