Re: Allow non-superuser to cancel superuser tasks.
Nathan Bossart <nathandbossart@gmail.com>
From: Nathan Bossart <nathandbossart@gmail.com>
To: Andres Freund <andres@anarazel.de>
Cc: Alexander Kukushkin <cyberdemn@gmail.com>, "Andrey M. Borodin" <x4mmm@yandex-team.ru>, Michael Paquier <michael@paquier.xyz>, Kirill Reshke <reshkekirill@gmail.com>, "Leung, Anthony" <antholeu@amazon.com>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2024-11-22T19:21:53Z
Lists: pgsql-hackers
Attachments
On Fri, Nov 22, 2024 at 12:13:49PM -0500, Andres Freund wrote: > I justed ended up looking at this code for some boring reason. One thing that > has me worried a bit is that pg_signal_backend() now does > pgstat_get_beentry_by_proc_number(), triggering a pgstat_read_current_status() > further down. > > pgstat_read_current_status() can be fairly expensive, both in CPU and in > memory. It copies each proc's activity strings, which each can be 1kB by > default! Thanks for bringing this to my attention. > I think it'd be better to introduce something that fetches a live > BackendType. We have such functionality already, see > pgstat_get_backend_current_activity(). Here is a draft-grade patch for this one. It seems pretty straightforward... -- nathan
Commits
-
Look up backend type in pg_signal_backend() more cheaply.
- 61171a632d10 18.0 landed
-
Add tap test for pg_signal_autovacuum role
- d2b74882cab8 18.0 landed
-
Introduce pg_signal_autovacuum_worker.
- ccd38024bc3c 18.0 landed
-
Add a slot synchronization function.
- ddd5f4f54a02 17.0 cited
-
Ban role pg_signal_backend from more superuser backend types.
- 3a9b18b30953 17.0 cited