Allow changing autovacuum_max_workers without restarting.
Nathan Bossart <nathan@postgresql.org>
Allow changing autovacuum_max_workers without restarting. This commit introduces a new parameter named autovacuum_worker_slots that controls how many autovacuum worker slots to reserve during server startup. Modifying this new parameter's value does require a server restart, but it should typically be set to the upper bound of what you might realistically need to set autovacuum_max_workers. With that new parameter in place, autovacuum_max_workers can now be changed with a SIGHUP (e.g., pg_ctl reload). If autovacuum_max_workers is set higher than autovacuum_worker_slots, a WARNING is emitted, and the server will only start up to autovacuum_worker_slots workers at a given time. If autovacuum_max_workers is set to a value less than the number of currently-running autovacuum workers, the existing workers will continue running, but no new workers will be started until the number of running autovacuum workers drops below autovacuum_max_workers. Reviewed-by: Sami Imseih, Justin Pryzby, Robert Haas, Andres Freund, Yogesh Sharma Discussion: https://postgr.es/m/20240410212344.GA1824549%40nathanxps13
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/config.sgml | modified | +27 −1 |
| doc/src/sgml/runtime.sgml | modified | +2 −2 |
| src/backend/access/transam/xlog.c | modified | +1 −1 |
| src/backend/postmaster/autovacuum.c | modified | +65 −17 |
| src/backend/postmaster/pmchild.c | modified | +2 −2 |
| src/backend/storage/lmgr/proc.c | modified | +3 −3 |
| src/backend/utils/init/postinit.c | modified | +3 −3 |
| src/backend/utils/misc/guc_tables.c | modified | +10 −1 |
| src/backend/utils/misc/postgresql.conf.sample | modified | +2 −1 |
| src/include/postmaster/autovacuum.h | modified | +1 −0 |
| src/test/perl/PostgreSQL/Test/Cluster.pm | modified | +1 −0 |
Documentation touched
Discussion
- allow changing autovacuum_max_workers without restarting 71 messages · 2024-04-10 → 2025-04-29