Re: 8.1.8 autovacuum missing databases

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: 8.1.8 autovacuum missing databases
Дата
Msg-id 7391.1209746458@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: 8.1.8 autovacuum missing databases  (Ian Westmacott <ianw@intellivid.com>)
Ответы Re: 8.1.8 autovacuum missing databases  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-admin
Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
> I'm wondering if there could be a hidden bug in the age arithmetic
> somehow -- say because it's using unsigned comparison of signed
> variables, or the Max() macro is flawed, or something weird like that.

Umm ... actually, there's a bug in the hand calculations I did at the
start of this thread.  The threshold that 8.1 uses is

                         (int32) ((MaxTransactionId >> 3) * 3 - 100000)

which works out to 1610512733, which is considerably more than the 300M
or so age() values that Ian is showing.  I had somehow convinced myself
that it was less and he should be getting whole-db vacuums, but in
reality he shouldn't yet.  It's only in 8.2 and up that we have a much
smaller threshold for trying to advance datfrozenxid.

So actually, what we are looking at is the not-whole-db logic, and
it's working exactly as designed.  The only unexpected behavior was
the choice not to vacuum some of the DBs, which we now know is explained
by their having a last_autovac_time in the future.

Perhaps it is worth adding a defense to autovac to not believe last
autovac times that are in the future, since the system clock is not
under our control and could go backwards.  Other than that I don't
think there's any bug here.

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: COPY errors when trying to convert from 7.4.19 to 8.3.1
Следующее
От: Tom Lane
Дата:
Сообщение: Re: 8.1.8 autovacuum missing databases