Re: Missing LWLock protection in pgstat_reset_replslot()

From: shveta malik <shveta(dot)malik(at)gmail(dot)com>
To: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
Cc: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org, shveta malik <shveta(dot)malik(at)gmail(dot)com>
Subject: Re: Missing LWLock protection in pgstat_reset_replslot()
Date: 2024-03-05 08:49:19
Message-ID: CAJpy0uD0L1g2_aZdWYg9T4QKbeewUBOWHFS0ARhbwAck82GrZg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Mar 5, 2024 at 1:25 PM Heikki Linnakangas <hlinnaka(at)iki(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Nikita Malakhov 2024-03-05 09:03:35 Re: Shared detoast Datum proposal
Previous Message Jelte Fennema-Nio 2024-03-05 08:43:03 Re: Injection points: some tools to wait and wake