Fix a wrong comment in UpdateDeadTupleRetentionStatus()

Started by vignesh Cabout 5 hours ago3 messageshackers
Jump to latest
#1vignesh C
vignesh21@gmail.com

Hi,

While reviewing other work, I noticed a wrong comment in
UpdateDeadTupleRetentionStatus() in pg_subscription.c, the comment
above the catalog update says:
/* Set the subscription to disabled. */

However, the code updates subretentionactive, not subenabled. This
comment appears to have been copied from DisableSubscription() when
the function was added.

The attached patch updates the comment to:
/* Set the dead tuple retention status for the subscription. */

Regards,
Vignesh

Attachments:

t259716_1
0001-Fix-comment-in-UpdateDeadTupleRetentionStatus.patchapplication/octet-stream; name=0001-Fix-comment-in-UpdateDeadTupleRetentionStatus.patchDownload+1-2
#2Daniel Gustafsson
daniel@yesql.se
In reply to: vignesh C (#1)
Re: Fix a wrong comment in UpdateDeadTupleRetentionStatus()

On 24 Nov 2026, at 10:09, vignesh C <vignesh21@gmail.com> wrote:

While reviewing other work, I noticed a wrong comment in
UpdateDeadTupleRetentionStatus() in pg_subscription.c, the comment
above the catalog update says:
/* Set the subscription to disabled. */

However, the code updates subretentionactive, not subenabled. This
comment appears to have been copied from DisableSubscription() when
the function was added.

The attached patch updates the comment to:
/* Set the dead tuple retention status for the subscription. */

Why not just remove it altogether? The existing comment is wrong, and the
replacement superfluous since it just states what the code does (which is
trivial to see by reading the line in question), not why it does it.

--
Daniel Gustafsson

#3vignesh C
vignesh21@gmail.com
In reply to: Daniel Gustafsson (#2)
Re: Fix a wrong comment in UpdateDeadTupleRetentionStatus()

On Tue, 24 Nov 2026 at 14:56, Daniel Gustafsson <daniel@yesql.se> wrote:

On 24 Nov 2026, at 10:09, vignesh C <vignesh21@gmail.com> wrote:

While reviewing other work, I noticed a wrong comment in
UpdateDeadTupleRetentionStatus() in pg_subscription.c, the comment
above the catalog update says:
/* Set the subscription to disabled. */

However, the code updates subretentionactive, not subenabled. This
comment appears to have been copied from DisableSubscription() when
the function was added.

The attached patch updates the comment to:
/* Set the dead tuple retention status for the subscription. */

Why not just remove it altogether? The existing comment is wrong, and the
replacement superfluous since it just states what the code does (which is
trivial to see by reading the line in question), not why it does it.

Yes, it is obvious and already mentioned in the function header too.
So it can be removed. Here is an updated version to handle the same.

Regards,
Vignesh

Attachments:

t259716_3
v2-0001-Remove-comment-in-UpdateDeadTupleRetentionStatus.patchapplication/octet-stream; name=v2-0001-Remove-comment-in-UpdateDeadTupleRetentionStatus.patchDownload+0-2