Re: Allow non-superuser to cancel superuser tasks.

From: Nathan Bossart <nathandbossart(at)gmail(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Alexander Kukushkin <cyberdemn(at)gmail(dot)com>, "Andrey M(dot) Borodin" <x4mmm(at)yandex-team(dot)ru>, Michael Paquier <michael(at)paquier(dot)xyz>, 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-11-26 21:07:24
Message-ID: Z0Y4jLEAvI2kZphd@nathan
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Nov 26, 2024 at 12:27:33PM -0500, Andres Freund wrote:
> On 2024-11-22 20:44:34 -0600, Nathan Bossart wrote:
>> D'oh, I missed that ProcNumber could be used as an index for the
>> BackendStatusArray. Is the attached more like what you are imagining?
>
> Yes.
>
> I'd probably add two function header comments:
>
> 1) explicit caution that this is fetching information not from the snapshot
> but "live" data
> 2) the return value might be out of date, that the procnumber needs to be
> valid and that the caller is responsible for permission checking
>
> I'd also add a comment do the code saying that it's fine to bypass the
> changecount mechanism, because we're reading a single 4 byte integer.

I've attempted to add all these details in v3.

--
nathan

Attachment Content-Type Size
v3-0001-Look-up-backend-type-in-pg_signal_backend-more-ch.patch text/plain 3.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2024-11-26 21:47:07 Re: Allow non-superuser to cancel superuser tasks.
Previous Message Sergey Prokhorenko 2024-11-26 20:47:57 Re: UUID v7