Re: Missing LWLock protection in pgstat_reset_replslot() - Mailing list pgsql-hackers

From shveta malik
Subject Re: Missing LWLock protection in pgstat_reset_replslot()
Date
Msg-id CAJpy0uD0L1g2_aZdWYg9T4QKbeewUBOWHFS0ARhbwAck82GrZg@mail.gmail.com
Whole thread Raw
In response to Re: Missing LWLock protection in pgstat_reset_replslot()  (Heikki Linnakangas <hlinnaka@iki.fi>)
Responses Re: Missing LWLock protection in pgstat_reset_replslot()
List pgsql-hackers
On Tue, Mar 5, 2024 at 1:25 PM Heikki Linnakangas <hlinnaka@iki.fi> wrote:

> SearchNamedReplicationSlot() will also acquire the lock in LW_SHARED
> mode, when you pass need_lock=true. So that at least should be changed
> to false.
>

Also don't we need to release the lock when we return here:

/*
* Nothing to do for physical slots as we collect stats only for logical
* slots.
*/
if (SlotIsPhysical(slot))
return;

thanks
Shveta



pgsql-hackers by date:

Previous
From: Jelte Fennema-Nio
Date:
Subject: Re: Injection points: some tools to wait and wake
Next
From: Nikita Malakhov
Date:
Subject: Re: Shared detoast Datum proposal