Re: BUG #18988: DROP SUBSCRIPTION locks not-yet-accessed database
Dilip Kumar <dilipbalaut@gmail.com>
From: Dilip Kumar <dilipbalaut@gmail.com>
To: Amit Kapila <amit.kapila16@gmail.com>
Cc: vignesh C <vignesh21@gmail.com>, Álvaro Herrera <alvherre@kurilemu.de>, "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>, "exclusion@gmail.com" <exclusion@gmail.com>, "pgsql-bugs@lists.postgresql.org" <pgsql-bugs@lists.postgresql.org>
Date: 2025-08-14T08:35:32Z
Lists: pgsql-bugs
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Fix self-deadlock during DROP SUBSCRIPTION.
- aa21e49225a1 19 (unreleased) landed
- a5d4c04150d4 18.0 landed
- 288a817bcb04 17.7 landed
- 7ece7612906e 16.11 landed
- e41137155869 15.15 landed
- ef77502746fe 14.20 landed
- 0a98f24a65cd 13.23 landed
Attachments
- v4-0001-Fix-DROP-SUBSCRIPTION-deadlock-with-new-database-V13.patch (application/octet-stream) patch v4-0001
- v4-0001-Fix-DROP-SUBSCRIPTION-deadlock-with-new-database-master.patch (application/octet-stream) patch v4-0001
- v4-0001-Fix-DROP-SUBSCRIPTION-deadlock-with-new-database-V16.patch (application/octet-stream) patch v4-0001
- v4-0001-Fix-DROP-SUBSCRIPTION-deadlock-with-new-database-V14_15.patch (application/octet-stream) patch v4-0001
- v4-0001-Fix-DROP-SUBSCRIPTION-deadlock-with-new-database-V17_18.patch (application/octet-stream) patch v4-0001
On Thu, Aug 14, 2025 at 11:39 AM Amit Kapila <amit.kapila16@gmail.com> wrote: > > On Wed, Aug 13, 2025 at 3:00 PM Dilip Kumar <dilipbalaut@gmail.com> wrote: > > > > I have prepared back branch patches. > > > > @@ -1802,11 +1802,7 @@ DropSubscription(DropSubscriptionStmt *stmt, > bool isTopLevel) > ... > - /* > - * Lock pg_subscription with AccessExclusiveLock to ensure that the > - * launcher doesn't restart new worker during dropping the subscription > - */ > - rel = table_open(SubscriptionRelationId, AccessExclusiveLock); > + rel = table_open(SubscriptionRelationId, AccessShareLock); > > We need to acquire RowExclusiveLock here as we are deleting the > subscription row during this operation. See docs [1] and > AlterSubscription() code for reference. Yeah that's right Attached is a top-up patch to > fix this for HEAD. Additionally, I have edited a few comments. If you > agree with these changes then please prepare backbranch patches > accordingly. Yeah this looks fine to me. PFA patches for back branches. -- Regards, Dilip Kumar Google