Re: add function for creating/attaching hash table in DSM registry

Nathan Bossart <nathandbossart@gmail.com>

From: Nathan Bossart <nathandbossart@gmail.com>
To: Florents Tselai <florents.tselai@gmail.com>
Cc: Rahila Syed <rahilasyed90@gmail.com>, Sami Imseih <samimseih@gmail.com>, Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>, pgsql-hackers@postgresql.org
Date: 2025-06-11T19:53:35Z
Lists: pgsql-hackers

Attachments

Here is a new patch with GetNamedDSA() added.  A couple notes:

* I originally wanted to use GetNamedDSA() within GetNamedDSMHash(), but
  that would probably lead to two registry entries per dshash table, and it
  didn't really save all that much code, anyway.  So, I didn't do that.

* Using a DSA from the registry is cumbersome.  You essentially need
  another batch of shared memory to keep track of the pointers and do
  locking, so it might not be tremendously useful on its own.  AFAICT the
  easiest thing to do is to store the DSA pointers in a dshash table, which
  is what I've done in the test.

-- 
nathan

Commits

  1. Fix cross-version upgrade test breakage from commit fe07100e82.

  2. Add GetNamedDSA() and GetNamedDSHash().

  3. Remove dynamic_shared_memory_type=none

  4. Introduce dynamic shared memory areas.

  5. Relax the requirement that all lwlocks be stored in a single array.