autovacuum: multiple workers

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема autovacuum: multiple workers
Дата
Msg-id 20070327214122.GA6126@alvh.no-ip.org
обсуждение исходный текст
Ответы Re: autovacuum: multiple workers  ("Simon Riggs" <simon@2ndquadrant.com>)
Список pgsql-patches
Hi,

This is the patch to put multiple workers into autovacuum.  This patch
applies after the recheck patch I just posted.

The main change is to have an array of Worker structs in shared memory;
each worker checks the current table of all other Workers, and skips a
table that's being vacuumed by any of them.  It also rechecks the table
before vacuuming, which removes the problem of redundant vacuuming.

It also introduces the business of SIGUSR1 between workers and launcher.
The launcher keeps a database list in memory and schedules workers to
vacuum databases depending on that list.  The actual database selected
may differ from what was in the schedule; in that case, the list is
reconstructed.

There are two main FIXMEs in this code:

1. have the list reconstruction and scheduling be smarter so that
databases are not ganged together in the schedule.  The only difficulty
is keeping the sort order that the databases had.

2. have a way to clean up after failed workers filling up the Worker
array and thus starving other databases from vacuuming.  I don't really
know a way to do this that works in all cases.  The only idea I have so
far is that workers that started more than autovacuum_naptime seconds
ago are considered failed to start.


Neither of these is really minor, but I think they are solvable.

--
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

Вложения

В списке pgsql-patches по дате отправления:

Предыдущее
От: Gregory Stark
Дата:
Сообщение: Re: [PATCH] add CLUSTER table ORDER BY index
Следующее
От: "Simon Riggs"
Дата:
Сообщение: Re: Patch for circular buffer in tuplestore to optimizemerge joins (v1)