]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Add missing shmem size estimate for fast-path locking struct
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Sat, 4 Apr 2026 08:46:11 +0000 (11:46 +0300)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Sat, 4 Apr 2026 08:46:11 +0000 (11:46 +0300)
It's been missing ever since fast-path locking was introduced. It's a
small discrepancy, about 4 kB, but let's be tidy. This doesn't seem
worth backpatching, however; in stable branches we were less precise
about the estimates and e.g. added a 10% margin to the hash table
estimates, which is usually much bigger than this discrepancy.

src/backend/storage/lmgr/lock.c

index 9dae407981f65007f42a6620a41f57bec7011497..798c453ab38d70bb699bde36f0342189dc7adc70 100644 (file)
@@ -3775,6 +3775,9 @@ LockManagerShmemSize(void)
        max_table_size *= 2;
        size = add_size(size, hash_estimate_size(max_table_size, sizeof(PROCLOCK)));
 
+       /* fast-path structures */
+       size = add_size(size, sizeof(FastPathStrongRelationLockData));
+
        return size;
 }