This patch separates autovacuum in two families of processes: one is the
"launcher", in charge of examining statistics and deciding when to start
a worker. The other is the worker, which is started by the postmaster
under command of the launcher, and processes what the launcher tells it
to process (by way of setting info up in shared memory).
The postmaster treats workers as regular backends; they are listed in
the backend list, so when it wants to shut down, it'll send a SIGTERM
signal just like everyone else, meaning it'll Just Work(tm).
The launcher is a dummy process; it never connects to any database.
Right now, the scheduling is more or less the same as before: it'll only
start a single worker, which will process a whole database. Or rather,
all tables in it that are determined to need vacuuming, per the old
rules. Currently, the launcher first examines the last autovacuum time
to determine which database to vacuum; the worker then examines the
stats to determine which tables to vacuum. Eventually this will need to
be changed so that the launcher tells the worker exactly what table to
I've been wondering how to make the scheduling work in the future, when
we need to have the launcher read stuff from catalogs to configure the
scheduling ... Maybe the solution will be to store flatfiles based on
the catalogs, like we do for pg_database and pg_authid.
Comments are welcome.
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.
pgsql-hackers by date
|Next:||From: Andrew Dunstan||Date: 2007-01-26 23:46:49|
|Subject: Re: PostgreSQL Data Loss|
|Previous:||From: Alvaro Herrera||Date: 2007-01-26 23:32:21|
|Subject: How does EXEC_BACKEND process signals?|
pgsql-patches by date
|Next:||From: Jeremy Drake||Date: 2007-01-27 00:56:07|
|Subject: Re: [HACKERS] less privileged pl install|
|Previous:||From: Bruce Momjian||Date: 2007-01-26 22:30:53|
|Subject: Change draft gmake control|