Re: bug? autovacuum is not launched even if autovacuum_freeze_max_age is reached

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: bug? autovacuum is not launched even if autovacuum_freeze_max_age is reached
Дата
Msg-id 20100216140551.GA5330@alvh.no-ip.org
обсуждение исходный текст
Ответ на bug? autovacuum is not launched even if autovacuum_freeze_max_age is reached  (Fujii Masao <masao.fujii@gmail.com>)
Ответы Re: bug? autovacuum is not launched even if autovacuum_freeze_max_age is reached  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: bug? autovacuum is not launched even if autovacuum_freeze_max_age is reached  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Fujii Masao escribió:
> Hi,
> 
> In HEAD, when autovacuum is disabled, autovacuum process is not
> launched forcibly to prevent XID wraparound even if we go through
> autovacuum_freeze_max_age. This seems to be because
> ShmemVariableCache->xidVacLimit is not initialized (i.e.,
> SetTransactionIdLimit() is not called) until VACUUM is performed.
> 
> OTOH, in older version, ShmemVariableCache->xidVacLimit is always
> initialized when backend updates the flat database file, and then
> autovacuum process seems to be launched forcibly as expected.

Hmm.  Yeah, this is a serious problem.  The only caller of
SetTransactionIdLimit is now vac_truncate_clog.  We need another one,
but where?  For a moment I thought about adding one to autovacuum
launcher's initialization, but what if it's disabled?

Maybe check at backend startup whether the limit is valid, and call
SetTransactionIdLimit if not?

Related commit history: the call to update the xid limit was removed
here:
http://git.postgresql.org/gitweb?p=postgresql.git;a=commitdiff;h=186b10c1f0a61f90d320a4ccce2ff8b31fa55210

which introduced a function TransactionIdLimitIsValid which could
presumably have been used as I propose above.  However, it was taken out
in
http://git.postgresql.org/gitweb?p=postgresql.git;a=commitdiff;h=1a7bbfe645b8379e368ec9969f99fee455e3ecf3

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


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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Re: [COMMITTERS] pgsql: Remove old-style VACUUM FULL (which was known for a little while
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: Problem with 8.4 stats collector high load