pgsql: Prevent shared memory hash tables from growing beyond initial si - Mailing list pgsql-committers

From Heikki Linnakangas
Subject pgsql: Prevent shared memory hash tables from growing beyond initial si
Date
Msg-id E1w8oOf-002pS3-16@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
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 <tomas@vondra.me>
Discussion: https://www.postgresql.org/message-id/01ab1d41-3eda-4705-8bbd-af898f5007f1@iki.fi

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(-)


pgsql-committers by date:

Previous
From: Jacob Champion
Date:
Subject: pgsql: oauth: Let validators provide failure DETAILs
Next
From: Thomas Munro
Date:
Subject: pgsql: More tar portability adjustments.