Skip site navigation (1) Skip section navigation (2)

Autovacuum launcher patch

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Autovacuum launcher patch
Date: 2007-01-26 23:43:53
Message-ID: 20070126234353.GZ13036@alvh.no-ip.org (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-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: autovac-launcher.patch
Description: text/x-diff (60.8 KB)

Responses

pgsql-hackers by date

Next:From: Andrew DunstanDate: 2007-01-26 23:46:49
Subject: Re: PostgreSQL Data Loss
Previous:From: Alvaro HerreraDate: 2007-01-26 23:32:21
Subject: How does EXEC_BACKEND process signals?

pgsql-patches by date

Next:From: Jeremy DrakeDate: 2007-01-27 00:56:07
Subject: Re: [HACKERS] less privileged pl install
Previous:From: Bruce MomjianDate: 2007-01-26 22:30:53
Subject: Change draft gmake control

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group