Re: Marking shared buffer lookup table as HASH_FIXED_SIZE
От | Ashutosh Bapat |
---|---|
Тема | Re: Marking shared buffer lookup table as HASH_FIXED_SIZE |
Дата | |
Msg-id | CAExHW5vx_kzJxzg2e0FdCZq3HBxd9p_hjhsgHv4u8_z944gFwA@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Marking shared buffer lookup table as HASH_FIXED_SIZE (Andres Freund <andres@anarazel.de>) |
Список | pgsql-hackers |
On Thu, Sep 18, 2025 at 6:14 AM Andres Freund <andres@anarazel.de> wrote: > > Hi, > > On 2025-08-26 19:55:21 +0530, Ashutosh Bapat wrote: > > StrategyInitialize() calls InitBufTable() passing the maximum number > > of possible entries in the shared buffer lookup table. The table can > > not have more entries than the number of available shared buffers + > > number of partitions as explained in the comment in > > StrategyInitialize(). If there are more than those entries something > > is wrong with the hash table like mapping two different pages to the > > same buffer. InitBufTable() invokes ShmemInitHash() with the same init > > and max size. This means that the maximum number of entries are > > allocated right from the beginning. So there should not be any need to > > allocate more entries after initial setup. Thus the hash table > > qualifies to be marked as HASH_FIXED_SIZE, so that we don't end up > > with a corrupted hash table in case of a bug. > > > > Here's a patch to do so. > > Makes sense to me. Applied. Thanks. -- Best Wishes, Ashutosh Bapat
В списке pgsql-hackers по дате отправления: