Re: BUG #18988: DROP SUBSCRIPTION locks not-yet-accessed database

From: Dilip Kumar <dilipbalaut(at)gmail(dot)com>
To: vignesh C <vignesh21(at)gmail(dot)com>
Cc: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Álvaro Herrera <alvherre(at)kurilemu(dot)de>, "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>, "exclusion(at)gmail(dot)com" <exclusion(at)gmail(dot)com>, "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #18988: DROP SUBSCRIPTION locks not-yet-accessed database
Date: 2025-08-19 02:54:12
Message-ID: CAFiTN-uTfggWqBXSLne+-VcYES9p46AxuVzyb1pzFR6FmNvybw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Mon, Aug 18, 2025 at 10:11 PM vignesh C <vignesh21(at)gmail(dot)com> wrote:
>
> On Mon, 18 Aug 2025 at 19:52, Dilip Kumar <dilipbalaut(at)gmail(dot)com> wrote:
> >
> > On Mon, Aug 18, 2025 at 2:56 PM Amit Kapila <amit(dot)kapila16(at)gmail(dot)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

Attachment Content-Type Size
v8-0001-Fix-DROP-SUBSCRIPTION-deadlock-with-walsender-pro_head.patch application/octet-stream 4.9 KB
v8-0001-Fix-DROP-SUBSCRIPTION-deadlock-with-walsender-pro_v14.patch application/octet-stream 5.0 KB
v8-0001-Fix-DROP-SUBSCRIPTION-deadlock-with-walsender-pro_v16_17_18.patch application/octet-stream 4.9 KB
v8-0001-Fix-DROP-SUBSCRIPTION-deadlock-with-walsender-pro_v13.patch application/octet-stream 5.0 KB
v8-0001-Fix-DROP-SUBSCRIPTION-deadlock-with-walsender-pro_v15.patch application/octet-stream 4.9 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2025-08-19 07:45:50 BUG #19024: Error when trying to use pg_dump of new server on old server
Previous Message Michael Paquier 2025-08-19 00:08:29 Re: TRAP: failed Assert("outerPlan != NULL") in postgres_fdw.c