Re: BUG #18988: DROP SUBSCRIPTION locks not-yet-accessed database
Dilip Kumar <dilipbalaut@gmail.com>
From: Dilip Kumar <dilipbalaut@gmail.com>
To: vignesh C <vignesh21@gmail.com>
Cc: Amit Kapila <amit.kapila16@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-19T02:54:12Z
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
- v8-0001-Fix-DROP-SUBSCRIPTION-deadlock-with-walsender-pro_head.patch (application/octet-stream) patch v8-0001
- v8-0001-Fix-DROP-SUBSCRIPTION-deadlock-with-walsender-pro_v14.patch (application/octet-stream) patch v8-0001
- v8-0001-Fix-DROP-SUBSCRIPTION-deadlock-with-walsender-pro_v16_17_18.patch (application/octet-stream) patch v8-0001
- v8-0001-Fix-DROP-SUBSCRIPTION-deadlock-with-walsender-pro_v13.patch (application/octet-stream) patch v8-0001
- v8-0001-Fix-DROP-SUBSCRIPTION-deadlock-with-walsender-pro_v15.patch (application/octet-stream) patch v8-0001
On Mon, Aug 18, 2025 at 10:11 PM vignesh C <vignesh21@gmail.com> wrote:
>
> On Mon, 18 Aug 2025 at 19:52, Dilip Kumar <dilipbalaut@gmail.com> wrote:
> >
> > On Mon, Aug 18, 2025 at 2:56 PM Amit Kapila <amit.kapila16@gmail.com> wrote:
> > >
> > > Looks mostly good. How about slightly changing the comment as in attached?
> >
> > Your suggestion LGTM, I am making back branch patches. I observed
> > another behavior change in the test in v13. The $sdterr is matching
> > with error details not with the error code, so for v13 i have to
> > modify the error comparison string as [1] whereas with other versions
> > it's like [2]. But if we execute this test from psql then I can see
> > the same error in v13 as well[3]. Not sure why perl is behaving
> > differently.
>
> The error message in PG13 and master branch is different, that is the
> reason the test was failing.
> The error in master is: could not drop replication slot whereas the
> error message in PG13 is: could not drop the replication slot.
> The test passes with the below change in PG13:
> --- a/src/test/subscription/t/100_bugs.pl
> +++ b/src/test/subscription/t/100_bugs.pl
> @@ -315,7 +315,7 @@ my ($ret, $stdout, $stderr) =
> isnt($ret, 0, "replication slot does not exist: exit code not 0");
> like(
> $stderr,
> - qr/ERROR: replication slot "regress_sub1" does not exist/,
> + qr/ERROR: could not drop the replication slot "regress_sub1"
> on publisher/,
> "could not drop replication slot: error message");
>
> $node_publisher->safe_psql('postgres', "DROP DATABASE regress_db");
Oh my bad, the error codes were so similar I didn't notice the
difference, I probably would have just done string search instead of
comparing by reading. It's a classic case where a machine's precision
beats a human's eyes :)
PFA, patches for head to v13. I have also changed the connection
string to $node_publisher->connstr . ' dbname=regress_db'; instead of
assuming it will start on the default port.
make check-world is passing on all the branches.
--
Regards,
Dilip Kumar
Google