pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Masahiko Sawada <msawada@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix DSA allocation to honor DSA_ALLOC_NO_OOM when out of DSM seg
Date: Wed, 18 Nov 2026 18:59:08 +0000
Message-ID: <E1xTks7-00000000HcQ-07mz@gemulon.postgresql.org> (raw)

Fix DSA allocation to honor DSA_ALLOC_NO_OOM when out of DSM segments.

Callers allocating DSA memory with DSA_ALLOC_NO_OOM expect to get
InvalidDsaPointer on allocation failure so that they can clean up and
handle the failure themselves. However, since commit 13df76a537c, a
new DSM segment for a DSA area has been created without
DSM_CREATE_NULL_IF_MAXSEGMENTS, so running out of DSM segments raised
an ERROR instead of returning InvalidDsaPointer.

Fix by passing DSM_CREATE_NULL_IF_MAXSEGMENTS.

Backpatch to all supported versions.

Author: Baji Shaik <baji.pgdev@gmail.com>
Reviewed-by: Zhijie Hou <houzhijie22@gmail.com>
Reviewed-by: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Reviewed-by: Masahiko Sawada <sawada.mshk@gmail.com>
Discussion: https://postgr.es/m/CA+fm-RMyb6EoMuk+a4_hZou9cdTHfB6mj1UV-7yb_YuTWLug1g@mail.gmail.com
Backpatch-through: 15

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/597d5c1fef84855254bdc93ebfa612beff889006

Modified Files
--------------
src/backend/utils/mmgr/dsa.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



view thread (6+ messages)

Message-ID: <E1xTks7-00000000HcQ-07mz@gemulon.postgresql.org>
Permalink:  ../E1xTks7-00000000HcQ-07mz@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1xTks7-00000000HcQ-07mz@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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: msawada@postgresql.org
  Subject: Re: pgsql: Fix DSA allocation to honor DSA_ALLOC_NO_OOM when out of DSM seg
  In-Reply-To: <E1xTks7-00000000HcQ-07mz@gemulon.postgresql.org>
  References: <E1xTks7-00000000HcQ-07mz@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 DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox