Re: pgsql: Teach DSM registry to ERROR if attaching to an uninitialized ent

From: Nathan Bossart <nathandbossart(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Nathan Bossart <nathan(at)postgresql(dot)org>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: pgsql: Teach DSM registry to ERROR if attaching to an uninitialized ent
Date: 2025-11-22 19:41:21
Message-ID: aSIR4Z4U887f_KcQ@nathan
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers 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(at)gmail(dot)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

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2025-11-23 00:44:33 pgsql: Add SupportRequestInlineInFrom planner support request.
Previous Message Bruce Momjian 2025-11-22 17:02:17 pgsql: tools: remove src/tools/codelines

Browse pgsql-hackers by date

  From Date Subject
Next Message Bernice Southey 2025-11-22 19:44:19 Re: Add notification on BEGIN ATOMIC SQL functions using temp relations
Previous Message Bruce Momjian 2025-11-22 19:00:05 Re: [PATCH] Allow complex data for GUC extra.