Missing LWLock protection in pgstat_reset_replslot()

From: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Missing LWLock protection in pgstat_reset_replslot()
Date: 2024-03-01 10:15:48
Message-ID: ZeGq1HDWFfLkjh4o@ip-10-97-1-34.eu-west-3.compute.internal
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi hackers,

I think that pgstat_reset_replslot() is missing LWLock protection. Indeed, we
don't have any guarantee that the slot is active (then preventing it to be
dropped/recreated) when this function is executed.

Attached a patch to add the missing protection.

Regards,

--
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com

Attachment Content-Type Size
v1-0001-Adding-LWLock-protection-in-pgstat_reset_replslot.patch text/x-diff 1.3 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bertrand Drouvot 2024-03-01 10:35:52 Re: Regardign RecentFlushPtr in WalSndWaitForWal()
Previous Message Peter Eisentraut 2024-03-01 09:26:45 Re: Improve readability by using designated initializers when possible