hash_search and out of memory

Поиск
Список
Период
Сортировка
От Hitoshi Harada
Тема hash_search and out of memory
Дата
Msg-id CAP7QgmkonmeOGz=OUb1B1Ukv=oZhL3n2y3h7ibVAst+zdTUd5Q@mail.gmail.com
обсуждение исходный текст
Ответы Re: hash_search and out of memory
Список pgsql-hackers
If OOM happens during expand_table() in hash_search_with_hash_value()
for RelationCacheInsert, the hash table entry is allocated and stored
in the hash table, but idhentry->reldesc remains NULL.  Since OOM
causes AbortTransaction(), in AtEOXact_RelationCache() this NULL
pointer is referenced and we hit SIGSEGV.

The fix would be either catch OOM error with PG_TRY() and undo the
hash entry, or do the expansion first and put the entry later.  The
latter is a bit ugly because we have to re-calculate hash bucket after
we decided to expand, so the former looks better.  Do you think of
other solutions?

Thanks,
-- 
Hitoshi Harada



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

Предыдущее
От: Neil Tiffin
Дата:
Сообщение: Re: Deprecating RULES
Следующее
От: Simon Riggs
Дата:
Сообщение: Re: Bugs in planner's equivalence-class processing