Fix a wrong comment in UpdateDeadTupleRetentionStatus()
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
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
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