public inbox for [email protected]  
help / color / mirror / Atom feed
From: Chao Li <[email protected]>
To: Daniil Davydov <[email protected]>
Cc: Postgres hackers <[email protected]>
Subject: Re: Wrong comment for ReplicationSlotCreate
Date: Sun, 4 Jan 2026 07:39:13 +0800
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAJDiXgj-UHGy9gKeqO=sQnXq1p88ULcBgpf62_p2n2+Ay84uMw@mail.gmail.com>
References: <CAJDiXggZXQZ7bD0QcTizDt6us9aX6ZKK4dWxzgb5x3+TsVHjqQ@mail.gmail.com>
	<[email protected]>
	<CAJDiXghEf_BviOC9Ci-it2p1v0DOa+0yqfCyBV89rXSkcd-5JA@mail.gmail.com>
	<[email protected]>
	<CAJDiXgj-UHGy9gKeqO=sQnXq1p88ULcBgpf62_p2n2+Ay84uMw@mail.gmail.com>



> On Jan 2, 2026, at 00:31, Daniil Davydov <[email protected]> wrote:
> 
> Hi,
> 
> On Wed, Dec 31, 2025 at 9:32 AM Chao Li <[email protected]> wrote:
>> 
>> You’re right that during CREATE_REPLICATION_SLOT, SnapBuildFindSnapshot() ensures we don’t miss PREPARE records for prepared transactions that exist at creation time.
>> 
>> 1462aad2e introduced support for altering logical replication slot options, including two_phase, after the slot has been created. The commit comment says:
>> ```
>>    Changing the 'two_phase' option for a subscription from 'true' to 'false'
>>    is permitted only when there are no pending prepared transactions
>>    corresponding to that subscription. Otherwise, the changes of already
>>    prepared transactions can be replicated again along with their corresponding
>>    commit leading to duplicate data or errors.
>> ```
>> 
>> true->false is not allowed, however false->true is permitted. So, I think the old comment is still possible today:
>> ```
>> *     Note that enabling this option after decoding has already advanced
>> *     may result in missing PREPARE records for transactions that were
>> *     prepared before the option was enabled.
>> ```
>> 
> 
> Hm, I still can't understand why the comment that you provided is correct.
> 
> How can we "miss PREPARE records" if slot creation requires all  prepared
> transactions to finish? The commit message says about risks during the
> change of the parameter "on the fly". But we are dealing with slot creation.
> 
> --
> Best regards,
> Daniil Davydov

No problem, maybe I am wrong. Then please ignore my comment and wait for other review comments.

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/










view thread (2+ messages)

reply

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 using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: Wrong comment for ReplicationSlotCreate
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox