public inbox for [email protected]
help / color / mirror / Atom feedFrom: Chao Li <[email protected]>
To: Daniil Davydov <[email protected]>
Cc: Postgres hackers <[email protected]>
Subject: Re: Wrong comment for ReplicationSlotCreate
Date: Tue, 30 Dec 2025 17:18:10 +0800
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAJDiXggZXQZ7bD0QcTizDt6us9aX6ZKK4dWxzgb5x3+TsVHjqQ@mail.gmail.com>
References: <CAJDiXggZXQZ7bD0QcTizDt6us9aX6ZKK4dWxzgb5x3+TsVHjqQ@mail.gmail.com>
> On Dec 29, 2025, at 21:39, Daniil Davydov <[email protected]> wrote:
>
> Hi,
>
> I noticed that the comment for ReplicationSlotCreate function contains this
> description for the "two_phase" option :
>
> * two_phase: Allows decoding of prepared transactions. We allow this option
> * to be enabled only at the slot creation time. If we allow this option
> * to be changed during decoding then it is quite possible that we skip
> * prepare first time because this option was not enabled. Now next time
> * during getting changes, if the two_phase option is enabled it can skip
> * prepare because by that time start decoding point has been moved. So the
> * user will only get commit prepared.
>
> But commit [1] introduced the ability to alter the "two_phase" option for the
> replication slot. Thus, I guess that the comment mentioned above is
> outdated and we should change it.
>
> [1] 1462aad2e4474ab61174f8ab00992cd3d6d57c7b
>
> --
> Best regards,
> Daniil Davydov
> <0001-Fix-comment-for-ReplicationSlotCreate.patch>
The old comment claimed “We allow this option to be enabled only at the slot creation time” that is no longer true after commit 1462aad2e4474ab61174f8ab00992cd3d6d57c7b, so yes, the old comment need updating.
But I think the updated version is too simple. It loses the information that enabling two_phase later can result in missing PREPARE.
So, I would suggest something like:
```
* two_phase: If enabled, allows decoding of prepared transactions.
* 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.
```
Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/
view thread (6+ messages) latest in thread
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