Re: Spurious pgstat_drop_replslot() call

2024-03-12 Thread Michael Paquier
On Tue, Mar 12, 2024 at 12:00:00PM +0300, Alexander Lakhin wrote: > Sorry for a bit off-topic, but I've remembered an anomaly with a similar > assert: > https://www.postgresql.org/message-id/17947-b9554521ad963c9c%40postgresql.org Thanks for the reminder. The invalidation path with the stats

Re: Spurious pgstat_drop_replslot() call

2024-03-12 Thread Alexander Lakhin
Hello Bertrand and Michael, 12.03.2024 09:17, Bertrand Drouvot wrote: May I suggest the attached additions with LWLockHeldByMeInMode to make sure that the stats are dropped and created while we hold ReplicationSlotAllocationLock? Yeah, makes fully sense and looks good to me. Sorry for a

Re: Spurious pgstat_drop_replslot() call

2024-03-12 Thread Bertrand Drouvot
Hi, On Tue, Mar 12, 2024 at 02:36:58PM +0900, Michael Paquier wrote: > On Mon, Mar 11, 2024 at 04:15:40PM +0900, Michael Paquier wrote: > > That's a slight change in behavior, unfortunately, and it cannot be > > called a bug as this improves the visibility of the stats after an > > invalidation,

Re: Spurious pgstat_drop_replslot() call

2024-03-11 Thread Michael Paquier
On Mon, Mar 11, 2024 at 04:15:40PM +0900, Michael Paquier wrote: > That's a slight change in behavior, unfortunately, and it cannot be > called a bug as this improves the visibility of the stats after an > invalidation, so this is not something that can be backpatched. I've looked again at that

Re: Spurious pgstat_drop_replslot() call

2024-03-11 Thread Bertrand Drouvot
Hi, On Mon, Mar 11, 2024 at 04:15:40PM +0900, Michael Paquier wrote: > That's a slight change in behavior, unfortunately, and it cannot be > called a bug as this improves the visibility of the stats after an > invalidation, so this is not something that can be backpatched. Yeah, makes sense to

Re: Spurious pgstat_drop_replslot() call

2024-03-11 Thread Michael Paquier
On Fri, Mar 08, 2024 at 03:04:10PM +, Bertrand Drouvot wrote: > The switch in the patch from "drop" to "invalidation" is in [1], see: > > " > Given the precedent of max_slot_wal_keep_size, I think it's wrong to
just drop > the logical slots. Instead we should just mark them as
invalid, >

Re: Spurious pgstat_drop_replslot() call

2024-03-08 Thread Bertrand Drouvot
Hi, On Fri, Mar 08, 2024 at 07:55:39PM +0900, Michael Paquier wrote: > On Fri, Mar 08, 2024 at 10:19:11AM +, Bertrand Drouvot wrote: > > Indeed, it does not seem appropriate to remove stats during slot > > invalidation as > > one could still be interested to look at them. > > Yeah, my take

Re: Spurious pgstat_drop_replslot() call

2024-03-08 Thread Michael Paquier
On Fri, Mar 08, 2024 at 10:19:11AM +, Bertrand Drouvot wrote: > Indeed, it does not seem appropriate to remove stats during slot invalidation > as > one could still be interested to look at them. Yeah, my take is that this can still be interesting to know, at least for debugging. This would