pgsql: Fix documentation for shmem_startup_hook.

2025-09-09 Thread Nathan Bossart
Fix documentation for shmem_startup_hook. This section claims that each backend executes the shmem_startup_hook shortly after attaching to shared memory, which is true for EXEC_BACKEND builds, but not for others. This commit adds this important detail. Oversight in commit 964152c476. Reported-b

pgsql: Fix documentation for shmem_startup_hook.

2025-09-09 Thread Nathan Bossart
Fix documentation for shmem_startup_hook. This section claims that each backend executes the shmem_startup_hook shortly after attaching to shared memory, which is true for EXEC_BACKEND builds, but not for others. This commit adds this important detail. Oversight in commit 964152c476. Reported-b

pgsql: Fix documentation for shmem_startup_hook.

2025-09-09 Thread Nathan Bossart
Fix documentation for shmem_startup_hook. This section claims that each backend executes the shmem_startup_hook shortly after attaching to shared memory, which is true for EXEC_BACKEND builds, but not for others. This commit adds this important detail. Oversight in commit 964152c476. Reported-b

pgsql: test_slru: Fix LWLock tranche allocation in EXEC_BACKEND builds.

2025-09-09 Thread Nathan Bossart
test_slru: Fix LWLock tranche allocation in EXEC_BACKEND builds. Currently, test_slru's shmem_startup_hook unconditionally generates new LWLock tranche IDs. This is fine on non-EXEC_BACKEND builds, where only the postmaster executes this hook, but on EXEC_BACKEND builds, every backend executes it

pgsql: Fix leak with SMgrRelations in startup process

2025-09-09 Thread Michael Paquier
Fix leak with SMgrRelations in startup process The startup process does not process shared invalidation messages, only sending them, and never calls AtEOXact_SMgr() which clean up any unpinned SMgrRelations. Hence, it is never able to free SMgrRelations on a periodic basis, bloating its hashtable

pgsql: Fix leak with SMgrRelations in startup process

2025-09-09 Thread Michael Paquier
Fix leak with SMgrRelations in startup process The startup process does not process shared invalidation messages, only sending them, and never calls AtEOXact_SMgr() which clean up any unpinned SMgrRelations. Hence, it is never able to free SMgrRelations on a periodic basis, bloating its hashtable

pgsql: meson: build checksums with extra optimization flags.

2025-09-09 Thread Jeff Davis
meson: build checksums with extra optimization flags. Use -funroll-loops and -ftree-vectorize when building checksum.c to match what autoconf does. Missed backport of 9af672bcb2, noticed by Nathan Bossart. Reported-by: Nathan Bossart Discussion: https://postgr.es/m/a81f2f7ef34afc24a89c613671ea

pgsql: Remove dynahash.h

2025-09-09 Thread Michael Paquier
Remove dynahash.h All the callers of my_log2() are now limited inside dynahash.c, so let's remove this header. The same capability is provided by pg_bitutils.h already. Discussion: https://postgr.es/m/CAEZATCUJPQD_7sC-wErak2CQGNa6bj2hY-mr8wsBki=kx7f...@mail.gmail.com Branch -- master Deta

pgsql: Replace callers of dynahash.h's my_log() by equivalent in pg_bit

2025-09-09 Thread Michael Paquier
Replace callers of dynahash.h's my_log() by equivalent in pg_bitutils.h All the calls replaced by this commit use 4-byte integers for their variables used in input of my_log2(). Hence, the limit against too-large inputs does not really apply. Thresholds are also applied, as of: - In nodeAgg.c, t

pgsql: meson: build checksums with extra optimization flags.

2025-09-09 Thread Jeff Davis
meson: build checksums with extra optimization flags. Use -funroll-loops and -ftree-vectorize when building checksum.c to match what autoconf does. Missed backport of 9af672bcb2, noticed by Nathan Bossart. Reported-by: Nathan Bossart Discussion: https://postgr.es/m/a81f2f7ef34afc24a89c613671ea

pgsql: meson: build checksums with extra optimization flags.

2025-09-09 Thread Jeff Davis
meson: build checksums with extra optimization flags. Use -funroll-loops and -ftree-vectorize when building checksum.c to match what autoconf does. Missed backport of 9af672bcb2, noticed by Nathan Bossart. Reported-by: Nathan Bossart Discussion: https://postgr.es/m/a81f2f7ef34afc24a89c613671ea