Re: pgsql: Teach DSM registry to ERROR if attaching to an uninitialized ent
Nathan Bossart <nathandbossart@gmail.com>
From: Nathan Bossart <nathandbossart@gmail.com>
To: Robert Haas <robertmhaas@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-11-24T21:25:51Z
Lists: pgsql-hackers
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
Commits
-
Teach DSM registry to retry entry initialization if needed.
- dbdc717ac674 19 (unreleased) landed
- b83bcc0df180 18.2 landed
- 2fc5c5062207 17.8 landed
-
Revert "Teach DSM registry to ERROR if attaching to an uninitialized entry."
- c7e0f263d67f 17.8 landed
- 8551a289201c 18.2 landed
- 2dd506b859cf 19 (unreleased) landed
-
Teach DSM registry to ERROR if attaching to an uninitialized entry.
- 1165a933aab1 19 (unreleased) cited