Revert "Improve accounting for memory used by shared hash tables"

Tomas Vondra <tomas.vondra@postgresql.org>

Commit: 1aff1dc8dfa7584ddbc695e1aae0f767db66326f
Author: Tomas Vondra <tomas.vondra@postgresql.org>
Date: 2025-04-04T02:43:50Z
Releases: 18.0
Revert "Improve accounting for memory used by shared hash tables"

This reverts commit f5930f9a98ea65d659d41600a138e608988ad122.

This broke the expansion of private hash tables, which reallocates the
directory. But that's impossible when it's allocated together with the
other fields, and dir_realloc() failed with BogusFree. Clearly, this
needs rethinking.

Discussion: https://postgr.es/m/CAApHDvriCiNkm=v521AP6PKPfyWkJ++jqZ9eqX4cXnhxLv8w-A@mail.gmail.com

Files

PathChange+/−
src/backend/storage/ipc/shmem.c modified +1 −3
src/backend/utils/hash/dynahash.c modified +64 −217
src/include/utils/hsearch.h modified +1 −2

Discussion

Cited messages not in the archive: CAApHDvriCiNkm=v521AP6PKPfyWkJ++jqZ9eqX4cXnhxLv8w-A@mail.gmail.com