Re: Test of a partition with an incomplete detach has a timing issue - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Test of a partition with an incomplete detach has a timing issue
Date
Msg-id YKxJAvXUr7uWXRHw@paquier.xyz
Whole thread Raw
In response to Re: Test of a partition with an incomplete detach has a timing issue  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Responses Re: Test of a partition with an incomplete detach has a timing issue
List pgsql-hackers
On Mon, May 24, 2021 at 02:07:12PM -0400, Alvaro Herrera wrote:
> I suppose a fix would imply that the error report waits until after the
> "cancel" step is over, but I'm not sure how to do that.
>
> Maybe we can change the "cancel" query to something like
>
> SELECT pg_cancel_backend(pid), somehow_wait_for_detach_to_terminate() FROM d3_pid;
>
> ... where maybe that function can check the "state" column in s3's
> pg_stat_activity row?  I'll give that a try.

Couldn't you achieve that with a small PL function in a way similar to
what 32a9c0b did, except that you track a different state in
pg_stat_activity for this PID?
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: "osumi.takamichi@fujitsu.com"
Date:
Subject: RE: Test of a partition with an incomplete detach has a timing issue
Next
From: Yura Sokolov
Date:
Subject: Re: Add PortalDrop in exec_execute_message