Re: Allow non-superuser to cancel superuser tasks.

From: "Andrey M(dot) Borodin" <x4mmm(at)yandex-team(dot)ru>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Nathan Bossart <nathandbossart(at)gmail(dot)com>, Kirill Reshke <reshkekirill(at)gmail(dot)com>, "Leung, Anthony" <antholeu(at)amazon(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Allow non-superuser to cancel superuser tasks.
Date: 2024-06-21 05:31:30
Message-ID: 9AF5C938-515C-44E4-A5C2-BF0C829E11AA@yandex-team.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On 21 Jun 2024, at 09:01, Michael Paquier <michael(at)paquier(dot)xyz> wrote:
>
> On Fri, Jun 14, 2024 at 12:06:36PM +0500, Andrey M. Borodin wrote:
>> I’ve tried to dig into the test.
>> The problem is CV is allocated in
>>
>> inj_state = GetNamedDSMSegment("injection_points”,
>>
>> which seems to be destroyed in
>>
>> shmem_exit() calling dsm_backend_shutdown()
>>
>> This happens before we broadcast that sleep is over.
>> I think this might happen with any wait on injection point if it is
>> pg_terminate_backend()ed.
>
> Except if I am missing something, this is not a problem for a normal
> backend, for example with one using a `SELECT injection_points_run()`.

Yes, i’ve tried to get similar error in other CV-sleeps and in injection points of normal backend - everything works just fine. The error is specific to just this test.

>> Is there way to wake up from CV sleep before processing actual termination?
>
> I am honestly not sure if this is worth complicating the sigjmp path
> of the autovacuum worker just for the sake of this test. It seems to
> me that it would be simple enough to move the injection point
> autovacuum-worker-start within the transaction block a few lines down
> in do_autovacuum(), no?

Thanks for the pointer, I’ll try this approach!

Best regards, Andrey Borodin,

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2024-06-21 05:36:17 Re: Allow non-superuser to cancel superuser tasks.
Previous Message Markus Winand 2024-06-21 05:28:22 Re: ON ERROR in json_query and the like