Re: Re-read subscription state after lock in AlterSubscription - Mailing list pgsql-hackers

From Bertrand Drouvot
Subject Re: Re-read subscription state after lock in AlterSubscription
Date
Msg-id aks2jHJeKW8Ay2N5@bdtpg
Whole thread
In response to RE: Re-read subscription state after lock in AlterSubscription  ("Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>)
List pgsql-hackers
Hi Kuroda-san,

On Mon, Jul 06, 2026 at 02:43:20AM +0000, Hayato Kuroda (Fujitsu) wrote:
> Dear Bertrand,
> 
> Thanks for updating the patch. I found one issue:
> 
> ```
>     /* DROP hook for the subscription being removed */
>     InvokeObjectDropHook(SubscriptionRelationId, subid, 0);
> 
> ```
> 
> I think the reporting should be after the loop, otherwise the wrong subid can be
> reported.

Yeah, and I think this is an existing behavior not related to the patch. Currently,
InvokeObjectDropHook() is called before we lock the subscription. I think that
makes more sense to do it after the lock is acquired, so this is now changed in
0002.

Also addressing Dilip's comment in the attached.

Regards,

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

Attachment

pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: Re-read subscription state after lock in AlterSubscription
Next
From: Srinath Reddy Sadipiralla
Date:
Subject: Re: hang during shutdown