Autovacuum launcher patch - Mailing list pgsql-patches

From Alvaro Herrera
Subject Autovacuum launcher patch
Date
Msg-id 20070126234353.GZ13036@alvh.no-ip.org
Whole thread Raw
Responses Re: Autovacuum launcher patch  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches
Hello,

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
work on.

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.

Attachment

pgsql-patches by date:

Previous
From: Bruce Momjian
Date:
Subject: Change draft gmake control
Next
From: Jeremy Drake
Date:
Subject: Re: [HACKERS] less privileged pl install