Hi hackers, Please find attached a tiny patch to remove a $SUBJECT.
Indeed, it does not seem appropriate to remove stats during slot invalidation as one could still be interested to look at them. This spurious call has been introduced in be87200efd. I think that initially we designed to drop slots when a recovery conflict occurred during logical decoding on a standby. But we changed our mind to invalidate such a slot instead. The spurious call is probably due to the initial design but has not been removed. I don't think it's worth to add a test but can do if one feel the need. Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com
>From 56ade7f561c180ee0120cb8c33d1c39e32ab7863 Mon Sep 17 00:00:00 2001 From: Bertrand Drouvot <bertranddrouvot...@gmail.com> Date: Fri, 8 Mar 2024 09:29:29 +0000 Subject: [PATCH v1] Remove spurious pgstat_drop_replslot() call There is no need to remove stats for an invalidated slot as one could still be interested to look at them. --- src/backend/replication/slot.c | 1 - 1 file changed, 1 deletion(-) 100.0% src/backend/replication/ diff --git a/src/backend/replication/slot.c b/src/backend/replication/slot.c index b8bf98b182..91ca397857 100644 --- a/src/backend/replication/slot.c +++ b/src/backend/replication/slot.c @@ -1726,7 +1726,6 @@ InvalidatePossiblyObsoleteSlot(ReplicationSlotInvalidationCause cause, ReplicationSlotMarkDirty(); ReplicationSlotSave(); ReplicationSlotRelease(); - pgstat_drop_replslot(s); ReportSlotInvalidation(conflict, false, active_pid, slotname, restart_lsn, -- 2.34.1