Prevent shared memory hash tables from growing beyond initial size

Set HASH_FIXED_SIZE on all shared memory hash tables, to prevent them
from growing after the initial allocation. It was always weirdly
indeterministic that if one hash table used up all the unused shared
memory, you could not use that space for other things anymore until
restart. We just got rid of that behavior for the LOCK and PROCLOCK
tables, but it's similarly weird for all other hash tables.

Increase SHMEM_INDEX_SIZE because we were already above the max size,
on that one, and it's now a hard limit.

Some callers of ShmemInitHash() still pass HASH_FIXED_SIZE, but that's
now unnecessary. They should perhaps now be removed, but it doesn't do
any harm either to pass it.

Reviewed-by: Tomas Vondra <[email protected]>
Discussion: 
https://www.postgresql.org/message-id/[email protected]

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/999e9ebb51c920de270e23a5fe929441f073ad55

Modified Files
--------------
src/backend/storage/ipc/shmem.c | 20 ++++++++------------
src/include/storage/shmem.h     |  4 ++--
2 files changed, 10 insertions(+), 14 deletions(-)

Reply via email to