autovacuum bootstrap

From: Alvaro Herrera <alvherre(at)surnet(dot)cl>
To: Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: autovacuum bootstrap
Date: 2005-06-25 18:23:52
Message-ID: 20050625182352.GA7410@surnet.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hackers,

There's one problem with autovacuum and it's how to bootstrap it.

My current approach is to connect to a default hardcoded database :-)
so it has to be changed to be useful.

I added two new fields to the pg_database flatfile and table, datstats
and datautovac. They respectively signal the stat collector and
autovacuum daemon to run for that database.

Additionally I need to save some state during initdb for each database,
and during database creation (and when the hypotetical ALTER DATABASE
command for turning autovacuum on is executed). I'm thinking in storing
that state in additional flat files. The reason is that we need to
examine the state of all databases before deciding which one to connect
to. I don't want to use the pg_database file, because that'd make me
check for race conditions against created or dropped databases; the new
flatfile would only need to interlock against autovac processes (which
is trivial because only one autovac process runs at any time.)

Does anyone see a problem with this approach?

PS -- it would definitely be much easier if there was one autovac
process per database :-(

--
Alvaro Herrera (<alvherre[a]surnet.cl>)
"El realista sabe lo que quiere; el idealista quiere lo que sabe" (Anónimo)

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2005-06-25 19:27:51 Fundamental error in "no WAL log" index/file creation stuff
Previous Message Martin Pitt 2005-06-25 15:42:56 Re: Add PG version number to NLS files