pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Nathan Bossart <nathandbossart@gmail.com>
To: Robert Haas <robertmhaas@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: pgsql: Teach DSM registry to ERROR if attaching to an uninitialized ent
Date: Mon, 24 Nov 2025 15:25:51 -0600
Message-ID: <aSTNXyXnr9HYsLo6@nathan> (raw)
In-Reply-To: <CA+TgmoYq7U0hHgOEOqQgf=6cFXz_7Ab8QTRMFqFpLNfav0G4Ug@mail.gmail.com>
References: <E1vJHUk-006I7r-37@gemulon.postgresql.org>
	<CA+TgmoZGFzLJpYANBG9yDyoakVm-P2Acdker-Y+DHvPWfvBE5w@mail.gmail.com>
	<aR89_9oYFHNtUTFa@nathan>
	<CA+TgmoZCHER55cGmnL_svMjH=k-S0w29ih+ym_+=t032TSsOFA@mail.gmail.com>
	<aR-fqzfZYSd3TVKa@nathan>
	<CA+TgmoZsxbVhoxNGTWSd6=vHvyoqOSDNXJZabBZx+St8uPduLQ@mail.gmail.com>
	<aSIR4Z4U887f_KcQ@nathan>
	<aSSlqWwLVuXMmN-o@nathan>
	<aSSr6j3JzeLcqOWo@nathan>
	<CA+TgmoYq7U0hHgOEOqQgf=6cFXz_7Ab8QTRMFqFpLNfav0G4Ug@mail.gmail.com>

On Mon, Nov 24, 2025 at 04:02:18PM -0500, Robert Haas wrote:
> I haven't done a full review of this and I'm not sure whether you want
> me to spend more time on it...

I'd appreciate an eyeball check if you have the time.

> I'm guessing that the reason why that doesn't easily work is
> because you're relying on those locks to prevent multiple backends
> from doing the same initialization?

For GetNamedDSMSegment(), I bet we could avoid needing a PG_CATCH by taking
the DSMRegistryLock exclusively when accessing the registry.  But for
GetNamedDSA() and GetNamedDSHash(), we want to keep the half-initialized
entry so that we don't leak LWLock tranche IDs.  I initially thought that
might be okay, but if every backend is retrying, you could quickly run out
of tranche IDs.

-- 
nathan





view thread (21+ messages)  latest in thread

Message-ID: <aSTNXyXnr9HYsLo6@nathan>
Permalink:  ../aSTNXyXnr9HYsLo6@nathan/
Also on:    postgresql.org/message-id/aSTNXyXnr9HYsLo6@nathan

 · 

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: nathandbossart@gmail.com, robertmhaas@gmail.com, pgsql-hackers@lists.postgresql.org
  Subject: Re: pgsql: Teach DSM registry to ERROR if attaching to an uninitialized ent
  In-Reply-To: <aSTNXyXnr9HYsLo6@nathan>

* 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