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

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Nathan Bossart <nathandbossart(at)gmail(dot)com>
Cc: 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-26 00:13:03
Message-ID: CA+TgmoaSpDa8dqWBwjRAittp+XTKN698Tpg3CEMpi=08sKc4Sw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On Tue, Nov 25, 2025 at 4:16 PM Nathan Bossart <nathandbossart(at)gmail(dot)com> wrote:
> My tests seem happy, so I will plan on committing these patches tomorrow.
> The only difference in v4 is that pg_get_dsm_registry_allocations() will no
> longer show partially-initialized entries. I thought that was the best
> option in this case because such entries shouldn't have any allocated
> memory, and retrying GetNamed*() would set *found to false.

Without actually opening the new patch files, that seems OK to me. I
think the important thing about such a view is that it shouldn't make
any state changes; it should just show how things are. In my ideal
world, it would probably show partially-initialized entires in some
distinguishable way, like with a null size. But leaving them out is
also defensible. The thing that I think really matters for failure
cases is the ability to retry whatever's gone wrong, either to get it
fixed or to see the error, and the other changes already accomplish
that goal, so I'm happy.

--
Robert Haas
EDB: http://www.enterprisedb.com

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Paquier 2025-11-26 01:16:15 pgsql: Add input function for data type pg_ndistinct
Previous Message Melanie Plageman 2025-11-25 21:42:41 pgsql: Assert that cutoffs are provided if freezing will be attempted

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2025-11-26 00:29:05 Re: POC: enable logical decoding when wal_level = 'replica' without a server restart
Previous Message Manni Wood 2025-11-26 00:09:42 Re: Speed up COPY FROM text/CSV parsing using SIMD