On Thu, Dec 3, 2026 at 3:40 PM Adesh Thakare <[email protected]> wrote:
>
> Hi,
>
> In v19, a role with privileges of pg_signal_autovacuum_worker can cancel
> or terminate an autovacuum worker, but not the parallel workers it
> launches for parallel autovacuum; it gets the superuser error instead.
> The autovacuum worker advertises no role, while its parallel workers
> advertise the bootstrap superuser, so they are treated as superuser
> backends. This has the same cause as the DROP DATABASE ... FORCE failure
> fixed in a39e53a700c [1], but that commit fixed only that path.

We discussed this point in that thread[1]. Bharath asked whether
pg_signal_autovacuum_worker should also cover the parallel workers
launched by autovacuum workers, and I answered that it would be a
separate topic for v20. Parallel workers are bgworkers, not autovacuum
workers, so the current behavior doesn't contradict the docs, and
users can stop them by terminating the autovacuum worker. So I don't
think it's something a39e53a700c missed.

> One place
> it shows up is the common query that terminates all other sessions in a
> database: run by such a role, it now fails with the superuser error when
> it reaches a parallel worker's row.

But I hadn't considered this case. IIUC a role with both
pg_signal_backend and pg_signal_autovacuum_worker could run such a
query on v18, and on v19 it fails if a parallel autovacuum happens to
be running in the database. Although such a query already fails if the
database has a superuser session or a bgworker connected without a
user name, I don't think it's good that v19 breaks existing queries
like this. So I think I need to change my mind; it seems better to fix
it in v19 rather than waiting for v20.

I'll review the patches.

Regards,

[1] 
https://postgr.es/m/CAD21AoDbRMS8QMPKnZiu+0hKNSW_x52jdRho=VbUP4=_=4U=-g...@mail.gmail.com

-- 
Masahiko Sawada
Amazon Web Services: https://aws.amazon.com


Reply via email to