postgresql/src
Heikki Linnakangas d9c3c94365 Wake up autovacuum launcher from postmaster when a worker exits
When an autovacuum worker exits, the launcher needs to be notified
with SIGUSR2, so that it can rebalance and possibly launch a new
worker. The launcher must be notified only after the worker has
finished ProcKill(), so that the worker slot is available for a new
worker. Before this commit, the autovacuum worker was responsible for
that, which required a slightly complicated dance to pass the
launcher's PID from FreeWorkerInfo() to ProcKill() in a global
variable.

Simplify that by moving the responsibility of the signaling to the
postmaster. The postmaster was already doing it when it failed to fork
a worker process, so it seems logical to make it responsible for
notifying the launcher on worker exit too. That's also how the
notification on background worker exit is done.

Reviewed-by: Nathan Bossart <nathandbossart@gmail.com>
Reviewed-by: Masahiko Sawada <sawada.mshk@gmail.com>
Reviewed-by: li carol <carol.li2025@outlook.com>
Discussion: https://www.postgresql.org/message-id/a5e27d25-c7e7-45d5-9bac-a17c8f462def@iki.fi
2026-01-15 18:02:25 +02:00
..
backend Wake up autovacuum launcher from postmaster when a worker exits 2026-01-15 18:02:25 +02:00
bin Revert "Replace pg_restrict by standard restrict" 2026-01-14 15:12:25 +01:00
common Revert "Replace pg_restrict by standard restrict" 2026-01-14 15:12:25 +01:00
fe_utils Add data type oid8, 64-bit unsigned identifier 2026-01-07 11:37:00 +09:00
include Wake up autovacuum launcher from postmaster when a worker exits 2026-01-15 18:02:25 +02:00
interfaces Fix misc typos, mostly in comments 2026-01-08 18:10:08 +02:00
makefiles Decouple C++ support in Meson's PGXS from LLVM enablement 2026-01-09 10:25:02 +01:00
pl plpython: Streamline initialization 2026-01-15 12:11:52 +01:00
port strnlen() is now required 2026-01-08 08:51:20 +01:00
template Remove traces of support for Sun Studio compiler 2025-09-12 07:39:05 +02:00
test Fix test_misc/010_index_concurrently_upsert for cache-clobbering builds 2026-01-13 10:03:33 +01:00
timezone Update copyright for 2026 2026-01-01 13:24:10 -05:00
tools heapam: Add batch mode mvcc check and use it in page mode 2026-01-12 13:22:04 -05:00
tutorial Update copyright for 2026 2026-01-01 13:24:10 -05:00
.gitignore
DEVELOPERS
Makefile Remove distprep 2023-11-06 15:18:04 +01:00
Makefile.global.in libpq: Refactor logic checking for exit() in shared library builds 2025-12-09 10:39:08 +09:00
Makefile.shlib Use exported symbols list on macOS for loadable modules as well 2025-06-10 07:04:43 +02:00
meson.build Update copyright for 2026 2026-01-01 13:24:10 -05:00
nls-global.mk Fix update-po for the PGXS case 2025-10-16 20:21:05 +02:00