Hi, On Sat, Jul 04, 2026 at 01:30:08PM +0530, Dilip Kumar wrote: > On Fri, Jul 3, 2026 at 9:09 PM Bertrand Drouvot > <[email protected]> wrote: > > > > But while doing this and looking closely, I'm not sure AlterPublication() > > does > > it right. Indeed, in theory, the OID could have been re-used too (between > > the > > time we did the name resolution and the time we lock the publication). I > > think > > what is needed is something similar to RangeVarGetRelidExtended(), means do > > the > > name resolution, acl check (ownership) and lock acquisition, all in unison. > > > > That's what 0003 is trying to achieve for the subscription and 0004 for the > > publication. > > > > What do you think? > > > 0003: > > It looks like the implementation of DROP SUBSCRIPTION IF EXISTS has a > concurrent drop race condition in DropSubscription(). Currently, if > stmt->missing_ok is true, the initial lookup safely handles a missing > subscription. However, once a subscription is found and the code > enters the drop loop, a second internal lookup/refetch happens. If a > concurrent transaction drops the subscription after our initial check > but before this internal refetch, the code throws an error. > Essentially, the loop completely ignores the missing_ok flag during > the refetch phase.
Good catch, will fix, thanks! Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com
