Re: [HACKERS] Buildfarm failure and dubious coding in predicate.c

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [HACKERS] Buildfarm failure and dubious coding in predicate.c
Дата
Msg-id 21591.1500755559@sss.pgh.pa.us
обсуждение исходный текст
Ответ на [HACKERS] Buildfarm failure and dubious coding in predicate.c  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: [HACKERS] Buildfarm failure and dubious coding in predicate.c  (Thomas Munro <thomas.munro@enterprisedb.com>)
Список pgsql-hackers
I wrote:
> And, while I'm looking at this ... isn't this "scratch target" logic
> just an ineffective attempt at waving a dead chicken?  It's assuming
> that freeing an entry in a shared hash table guarantees that it can
> insert another entry.  But that hash table is partitioned, meaning it has
> a separate freelist per partition.  So the extra entry only provides a
> guarantee that you can insert something into the same partition it's in,
> making it useless for this purpose AFAICS.

After further study I found the bit in get_hash_entry() about "borrowing"
entries from other freelists.  That makes all of this safe after all,
which is a good thing because I'd also found other assumptions that would
have been broken by the behavior I posited above.  But I think that that
code is desperately undercommented -- the reader could be forgiven for
thinking that it was an optional optimization, and not something that
is critical for correctness of several different callers.  I'm going to
go improve the comments.

Meanwhile, it's still pretty unclear what happened yesterday on
culicidae.
        regards, tom lane



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] Syncing sql extension versions with shared library versions
Следующее
От: Mark Rofail
Дата:
Сообщение: Re: [HACKERS] GSoC 2017: Foreign Key Arrays