Re: DROP DATABASE deadlocks with logical replication worker in PG 15.1 - Mailing list pgsql-bugs

From Amit Kapila
Subject Re: DROP DATABASE deadlocks with logical replication worker in PG 15.1
Date
Msg-id CAA4eK1+vzee2_QtxYA5ciBB_Vqj188_1Tf1rme=Shy=dTWhdrA@mail.gmail.com
Whole thread Raw
In response to Re: DROP DATABASE deadlocks with logical replication worker in PG 15.1  (Andres Freund <andres@anarazel.de>)
List pgsql-bugs
On Sat, Jan 14, 2023 at 10:50 PM Andres Freund <andres@anarazel.de> wrote:
> On 2023-01-14 08:02:01 -0800, Andres Freund wrote:
>
> I wonder if we ought to put a
>     Assert(InterruptHoldoffCount == 0 && CritSectionCount == 0)
>
> in some of the routines in libpqwalreceiver to protect against issues like
> this. It'd be easy enough to introduce one accidentally, due to holding an
> lwlock.
>

This makes sense to me. How about adding this assert in all routines
in libpqwalreceiver that communicate over the network? That means to
add assert except for routines libpqrcv_get_senderinfo,
libpqrcv_get_conninfo, libpqrcv_check_conninfo,
libpqrcv_server_version, libpqrcv_get_backend_pid where we don't
communicate over the network.

There would be one exception to the above which is that we can't add
this assert in libpqrcv_disconnect as that will be called at the time
of proc exit and we set InterruptHoldoffCount as  1 in
proc_exit_prepare. I think that should be fine.

-- 
With Regards,
Amit Kapila.



pgsql-bugs by date:

Previous
From: "Xiong He"
Date:
Subject: Re: Possible wrong result with some "in" subquery with non-existing columns
Next
From: "David G. Johnston"
Date:
Subject: Re: Possible wrong result with some "in" subquery with non-existing columns