pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Allow unknown-size shmem attachments in single-user mode
2+ messages / 1 participants
[nested] [flat]

* pgsql: Allow unknown-size shmem attachments in single-user mode
@ 2026-09-30 11:43  Heikki Linnakangas <heikki.linnakangas@iki.fi>
  0 siblings, 0 replies; 2+ messages in thread

From: Heikki Linnakangas @ 2026-09-30 11:43 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Allow unknown-size shmem attachments in single-user mode

ShmemRequestInternal() rejected SHMEM_ATTACH_UNKNOWN_SIZE whenever
IsUnderPostmaster was false.  That also rejected an after-startup
attachment in a standalone backend, even if the area exists.

To fix, check whether the shared memory has been initialized
(ShmemIndex == NULL) rather than IsUnderPostmaster.

Refactor the tests, and add more test cases for after-startup
attachment, with SHMEM_ATTACH_UNKNOWN_SIZE and a mismatching size, and
for this single-user case.

Author: Ayush Tiwari <ayushtiwari.slg01@gmail.com>
Reviewed-by: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Discusssion: https://www.postgresql.org/message-id/CAJTYsWXREGXCnWdZJsXt8pT2UY_Y2GSx+HOUu2X3s8YDCLj0_A@mail.gmail...
Backpatch-through: 19

Branch
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/67c01b84788d1d58312d7d1691f160f681ec5984

Modified Files
--------------
src/backend/storage/ipc/shmem.c                    |  26 ++-
.../modules/test_shmem/t/001_late_shmem_alloc.pl   | 182 ++++++++++++++-------
src/test/modules/test_shmem/test_shmem--1.0.sql    |   4 +
src/test/modules/test_shmem/test_shmem.c           |  55 +++++++
4 files changed, 190 insertions(+), 77 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pgsql: Allow unknown-size shmem attachments in single-user mode
@ 2026-09-30 11:43  Heikki Linnakangas <heikki.linnakangas@iki.fi>
  0 siblings, 0 replies; 2+ messages in thread

From: Heikki Linnakangas @ 2026-09-30 11:43 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Allow unknown-size shmem attachments in single-user mode

ShmemRequestInternal() rejected SHMEM_ATTACH_UNKNOWN_SIZE whenever
IsUnderPostmaster was false.  That also rejected an after-startup
attachment in a standalone backend, even if the area exists.

To fix, check whether the shared memory has been initialized
(ShmemIndex == NULL) rather than IsUnderPostmaster.

Refactor the tests, and add more test cases for after-startup
attachment, with SHMEM_ATTACH_UNKNOWN_SIZE and a mismatching size, and
for this single-user case.

Author: Ayush Tiwari <ayushtiwari.slg01@gmail.com>
Reviewed-by: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Discusssion: https://www.postgresql.org/message-id/CAJTYsWXREGXCnWdZJsXt8pT2UY_Y2GSx+HOUu2X3s8YDCLj0_A@mail.gmail...
Backpatch-through: 19

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/c712b0d49b971fe7cf521c057bc7adb63b17760c

Modified Files
--------------
src/backend/storage/ipc/shmem.c                    |  26 ++-
.../modules/test_shmem/t/001_late_shmem_alloc.pl   | 182 ++++++++++++++-------
src/test/modules/test_shmem/test_shmem--1.0.sql    |   4 +
src/test/modules/test_shmem/test_shmem.c           |  55 +++++++
4 files changed, 190 insertions(+), 77 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2026-09-30 11:43 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-09-30 11:43 pgsql: Allow unknown-size shmem attachments in single-user mode Heikki Linnakangas <heikki.linnakangas@iki.fi>
2026-09-30 11:43 pgsql: Allow unknown-size shmem attachments in single-user mode Heikki Linnakangas <heikki.linnakangas@iki.fi>

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