1
0
mirror of https://github.com/postgres/postgres.git synced 2025-10-27 00:12:01 +03:00

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

This reverts commit f5930f9a98.

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
This commit is contained in:
Tomas Vondra
2025-04-04 04:28:59 +02:00
parent 88f55bc976
commit 1aff1dc8df
3 changed files with 69 additions and 225 deletions

View File

@@ -73,7 +73,6 @@
#include "storage/shmem.h"
#include "storage/spin.h"
#include "utils/builtins.h"
#include "utils/dynahash.h"
static void *ShmemAllocRaw(Size size, Size *allocated_size);
@@ -347,8 +346,7 @@ ShmemInitHash(const char *name, /* table string name for shmem index */
/* look it up in the shmem index */
location = ShmemInitStruct(name,
hash_get_size(infoP, hash_flags,
init_size, true),
hash_get_shared_size(infoP, hash_flags),
&found);
/*