Remove stale XXX comment in logical launcher

Started by Zhijie Hou (Fujitsu)3 months ago8 messageshackers
Jump to latest
#1Zhijie Hou (Fujitsu)
houzj.fnst@fujitsu.com

Hi,

I noticed one comment in the launcher that can be removed:

if (!retain_dead_tuples)
/* XXX unclear why we don't request logical decoding disable */
ReplicationSlotDropAcquired(false);

Since the conflict detection slot is a physical one, there is no logical
decoding state to disable when dropping it. The condition it depends on is also
self-evident from the surrounding code and the block comment above, which
already explains why the slot is dropped. So here is a patch to remove the XXX
comment.

Best Regards,
Zhijie Hou

Attachments:

t253652_1
v1-0001-Remove-stale-XXX-comment-in-logical-launcher.patchapplication/octet-stream; name=v1-0001-Remove-stale-XXX-comment-in-logical-launcher.patchDownload+0-2
#2shveta malik
shveta.malik@gmail.com
In reply to: Zhijie Hou (Fujitsu) (#1)
Re: Remove stale XXX comment in logical launcher

On Thu, Sep 3, 2026 at 9:12 AM Zhijie Hou (Fujitsu)
<houzj.fnst@fujitsu.com> wrote:

Hi,

I noticed one comment in the launcher that can be removed:

if (!retain_dead_tuples)
/* XXX unclear why we don't request logical decoding disable */
ReplicationSlotDropAcquired(false);

Since the conflict detection slot is a physical one, there is no logical
decoding state to disable when dropping it.

I agree. However, the comments never mention that this is a physical
slot, making it easy to misconstrue it as a logical one. Do you think
we can add the keyword 'physical' in the comment above this Drop()
or/and above CreateConflictDetectionSlot or/and above macro
CONFLICT_DETECTION_SLOT?

Show quoted text

The condition it depends on is also
self-evident from the surrounding code and the block comment above, which
already explains why the slot is dropped. So here is a patch to remove the XXX
comment.

#3Amit Kapila
amit.kapila16@gmail.com
In reply to: shveta malik (#2)
Re: Remove stale XXX comment in logical launcher

On Thu, Sep 3, 2026 at 11:56 AM shveta malik <shveta.malik@gmail.com> wrote:

On Thu, Sep 3, 2026 at 9:12 AM Zhijie Hou (Fujitsu)
<houzj.fnst@fujitsu.com> wrote:

Hi,

I noticed one comment in the launcher that can be removed:

if (!retain_dead_tuples)
/* XXX unclear why we don't request logical decoding disable */
ReplicationSlotDropAcquired(false);

Since the conflict detection slot is a physical one, there is no logical
decoding state to disable when dropping it.

I agree. However, the comments never mention that this is a physical
slot, making it easy to misconstrue it as a logical one. Do you think
we can add the keyword 'physical' in the comment above this Drop()
or/and above CreateConflictDetectionSlot or/and above macro
CONFLICT_DETECTION_SLOT?

Adding such a comment at the time of creation sounds reasonable to me.
I would still like to check with Alvaro who added this comment in
commit 2af1dc89282bea681201cf66e2bb32537294e623 whether such a comment
would make it easier to follow this part of code?

--
With Regards,
Amit Kapila.

#4Alvaro Herrera
alvherre@kurilemu.de
In reply to: Amit Kapila (#3)
Re: Remove stale XXX comment in logical launcher

On 2026-Sep-03, Amit Kapila wrote:

On Thu, Sep 3, 2026 at 11:56 AM shveta malik <shveta.malik@gmail.com> wrote:

I agree. However, the comments never mention that this is a physical
slot, making it easy to misconstrue it as a logical one. Do you think
we can add the keyword 'physical' in the comment above this Drop()
or/and above CreateConflictDetectionSlot or/and above macro
CONFLICT_DETECTION_SLOT?

Adding such a comment at the time of creation sounds reasonable to me.
I would still like to check with Alvaro who added this comment in
commit 2af1dc89282bea681201cf66e2bb32537294e623 whether such a comment
would make it easier to follow this part of code?

I agree that having a comment stating that the slot we hold is
necessarily physical would be good. It wouldn't hurt to see exactly
what is being proposed though.

--
Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/
"[PostgreSQL] is a great group; in my opinion it is THE best open source
development communities in existence anywhere." (Lamar Owen)

#5Zhijie Hou (Fujitsu)
houzj.fnst@fujitsu.com
In reply to: Alvaro Herrera (#4)
RE: Remove stale XXX comment in logical launcher

Hi,

On Friday, September 4, 2026 2:12 AM Álvaro Herrera <alvherre@kurilemu.de> wrote:

On 2026-Sep-03, Amit Kapila wrote:

Adding such a comment at the time of creation sounds reasonable to me.
I would still like to check with Alvaro who added this comment in
commit 2af1dc89282bea681201cf66e2bb32537294e623 whether such a
comment would make it easier to follow this part of code?

I agree that having a comment stating that the slot we hold is necessarily
physical would be good. It wouldn't hurt to see exactly what is being
proposed though.

Thanks for confirming.

Here is the updated patch with the suggested comments.

Best Regards,
Zhijie Hou

Attachments:

t253652_5
v2-0001-Remove-stale-XXX-comment-in-logical-launcher.patchapplication/octet-stream; name=v2-0001-Remove-stale-XXX-comment-in-logical-launcher.patchDownload+5-2
#6Alvaro Herrera
alvherre@kurilemu.de
In reply to: Zhijie Hou (Fujitsu) (#5)
Re: Remove stale XXX comment in logical launcher

Hello,

On 2026-Sep-07, Zhijie Hou (Fujitsu) wrote:

Here is the updated patch with the suggested comments.

Mumble.

How about like this?

--
Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/

Attachments:

t253652_6
0001-Remove-stale-XXX-comment-in-logical-launcher.patchtext/x-diff; charset=utf-8Download+9-6
#7Amit Kapila
amit.kapila16@gmail.com
In reply to: Alvaro Herrera (#6)
Re: Remove stale XXX comment in logical launcher

On Tue, Sep 8, 2026 at 1:20 PM Álvaro Herrera <alvherre@kurilemu.de> wrote:

On 2026-Sep-07, Zhijie Hou (Fujitsu) wrote:

Here is the updated patch with the suggested comments.

Mumble.

How about like this?

LGTM. Do let me know if you would like me to push, otherwise, I would
be happy if you can take care of it.

--
With Regards,
Amit Kapila.

#8Alvaro Herrera
alvherre@kurilemu.de
In reply to: Amit Kapila (#7)
Re: Remove stale XXX comment in logical launcher

On 2026-Sep-09, Amit Kapila wrote:

LGTM. Do let me know if you would like me to push, otherwise, I would
be happy if you can take care of it.

Thanks for looking! I have pushed it. Thanks Hou for reporting.

--
Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/
Al principio era UNIX, y UNIX habló y dijo: "Hello world\n".
No dijo "Hello New Jersey\n", ni "Hello USA\n".