Re: autovacuum crash due to null pointer

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: autovacuum crash due to null pointer
Дата
Msg-id 18663.1216310135@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: autovacuum crash due to null pointer  (Alvaro Herrera <alvherre@commandprompt.com>)
Ответы Re: autovacuum crash due to null pointer  (Alvaro Herrera <alvherre@commandprompt.com>)
Список pgsql-hackers
Alvaro Herrera <alvherre@commandprompt.com> writes:
> Tom Lane wrote:
>> What I think happened was that the table that was selected to be
>> autovacuumed got dropped during the setup steps, leading get_rel_name()
>> to return NULL at line 2167.  vacuum() itself would have fallen out
>> silently ...  however, had it errored out, the attempts at error
>> reporting in the PG_CATCH block would have crashed.

> I'm having a hard time reproducing this problem; I added a pg_usleep()
> just before get_rel_name to have the chance to drop the table, but
> strangely enough it doesn't return NULL.  It seems that the cache entry
> is not getting invalidated.  Maybe there's something else that's needed
> to reproduce the crash.

I think cache invals would get noticed at points where we had to open
some relation, so you probably need the sleep somewhere earlier than
that.  Or just throw in an AcceptInvalidationMessages() after the sleep.

> I think there's another hole here: what happens if the table exists when
> get_rel_name is called, but the schema is dropped between that point and
> calling get_namespace_name?  It is pretty unlikely but can it be
> discarded completely?  What should we do in that case?

I think you can just skip the table if any of those three calls return a
null.  That probably means the table/schema/whatever got dropped, and
if for some reason there's a transient failure, it'll get vacuumed next
time anyway.
        regards, tom lane


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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: autovacuum crash due to null pointer
Следующее
От: David Fetter
Дата:
Сообщение: Re: [PATCHES] WITH RECUSIVE patches 0717