Wake up autovacuum launcher from postmaster when a worker exits

From: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
To: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Wake up autovacuum launcher from postmaster when a worker exits
Date: 2026-01-08 19:57:38
Message-ID: a5e27d25-c7e7-45d5-9bac-a17c8f462def@iki.fi
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

When an autovacuum worker exits, ProcKill() sends SIGUSR2 to the
launcher. I propose moving that responsibility to the postmaster, because:

* It's simpler IMHO

* The postmaster is already responsible for sending the signal if fork()
fails

* It makes it consistent with background workers. When a background
worker exits, the postmaster sends the signal to the launching process
(if requested).

* Postmaster doesn't need to worry about sending the signal to the wrong
process if the launcher's PID is reused, because it always has
up-to-date PID information, because the launcher is postmaster's child
process. That risk was negligible to begin with, but this eliminates
completely, so we don't need the comment excusing it it anymore.

I'm a little surprised it wasn't done this way to begin with, so I
wonder if I'm missing something?

- Heikki

Attachment Content-Type Size
v1-0001-Wake-up-autovacuum-launcher-from-postmaster-when-.patch text/x-patch 4.9 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2026-01-08 19:59:45 Re: Docs: make source file path references consistent
Previous Message Tom Lane 2026-01-08 19:54:53 Re: improve performance of pg_dump with many sequences