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: Nathan Bossart <nathan@postgresql.org>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-11-22T19:41:21Z
Lists: pgsql-hackers
On Sat, Nov 22, 2025 at 10:25:48AM -0500, Robert Haas wrote: > On Thu, Nov 20, 2025 at 6:09 PM Nathan Bossart <nathandbossart@gmail.com> wrote: >> Unpinning/detaching the segment/DSA/dshash table and deleting the DSM >> registry entry in a PG_CATCH block scares me a little, but it might be >> doable. > > It seems a bit weird to be doing explicit unpinning in a PG_CATCH > block. Ideally you'd want to postpone the pinning until initialization > has succeeded, so that if you fail before that, transaction cleanup > takes care of it automatically. Alternatively, destroying what existed > before could be deferred until later, when an as-yet-unfailed > transaction stumbles across the tombstone. Oh, yeah, good idea. > Am I worrying too much? Possibly! But as I said to David on another > thread this morning, it's better to worry on pgsql-hackers before any > problem happens than to start worrying after something bad happens in > a customer situation. I'll give what you suggested a try. It seems reasonable enough. -- 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