Re: [HACKERS] Autovacuum improvements

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: [HACKERS] Autovacuum improvements
Дата
Msg-id 20070115221509.GC24671@alvh.no-ip.org
обсуждение исходный текст
Ответ на Re: [HACKERS] Autovacuum improvements  (Alvaro Herrera <alvherre@commandprompt.com>)
Ответы Re: [HACKERS] Autovacuum improvements  ("Matthew T. O'Connor" <matthew@zeut.net>)
Список pgsql-patches
Alvaro Herrera wrote:
> Tom Lane wrote:
> > Alvaro Herrera <alvherre@commandprompt.com> writes:
> > > Here it is.
> >
> > I'd drop the InitProcess API change, which touches many more places than
> > you really need, and just have InitProcess check IsAutoVacuumProcess(),
> > which should be valid by the time control gets to it.  This is more like
> > the way that InitPostgres handles it, anyway.
>
> Hmm, the problem is SubPostmasterMain, which is in the EXEC_BACKEND
> path.  It hasn't reached the autovacuum.c code yet, so it hasn't had the
> chance to set the am_autovacuum static variable (in autovacuum.c).  I
> guess the answer here is to allow that variable to be set from the
> outside.

New version of the patch attached.

I'll probably apply this tomorrow morning unless there are objections.

An important difference from the previous patch is that
DatabaseHasActiveBackends (now renamed to
DatabaseCancelAutovacuumActivity) cycles through the whole ProcArray
instead of stopping at the first occurence of a backend in that
database.  This is to be able to fulfill its mission of cancelling *any*
autovacuum activity that may be taking place on the database (not just
the one that happens to be below the first process in the ProcArray).


I also tried the EXEC_BACKEND case (albeit less extensively) and it
seems to work -- it cancels running autovacuums at least.

--
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

Вложения

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

Предыдущее
От: Magnus Hagander
Дата:
Сообщение: Re: vcbuild updates
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: TODO improvements