agora inbox for pgsql-committers@postgresql.org  
help / color / mirror / Atom feed
From: Heikki Linnakangas <heikki.linnakangas@iki.fi>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add a test module to test after-startup shmem allocations
Date: Sun, 05 Apr 2026 23:27:43 +0000
Message-ID: <E1w9WsZ-00399u-0A@gemulon.postgresql.org> (raw)

Add a test module to test after-startup shmem allocations

The old ShmemInit{Struct/Hash}() functions could be used after
postmaster statup, as long as the allocation is small enough to fit in
spare shmem reserved at startup. I believe some extensions do that,
although we hadn't really documented it and had not coverage for it.
The new test module covers that after-startup usage with the new
ShmemRequestStruct() functions.

Reviewed-by: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Reviewed-by: Matthias van de Meent <boekewurm+postgres@gmail.com>
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
Discussion: https://www.postgresql.org/message-id/CAExHW5vM1bneLYfg0wGeAa=52UiJ3z4vKd3AJ72X8Fw6k3KKrg@mail.gmail...

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/6409994c7dd8cc8c06c00882880e04cc895c28bd

Modified Files
--------------
src/test/modules/Makefile                          |   1 +
src/test/modules/meson.build                       |   1 +
src/test/modules/test_shmem/Makefile               |  24 +++++
src/test/modules/test_shmem/meson.build            |  33 +++++++
.../modules/test_shmem/t/001_late_shmem_alloc.pl   |  49 ++++++++++
src/test/modules/test_shmem/test_shmem--1.0.sql    |   9 ++
src/test/modules/test_shmem/test_shmem.c           | 101 +++++++++++++++++++++
src/test/modules/test_shmem/test_shmem.control     |   3 +
src/tools/pgindent/typedefs.list                   |   1 +
9 files changed, 222 insertions(+)



Message-ID: <E1w9WsZ-00399u-0A@gemulon.postgresql.org>
Permalink:  ../E1w9WsZ-00399u-0A@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1w9WsZ-00399u-0A@gemulon.postgresql.org

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: heikki.linnakangas@iki.fi, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Add a test module to test after-startup shmem allocations
  In-Reply-To: <E1w9WsZ-00399u-0A@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox