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

From: Rahila Syed <rahilasyed90(at)gmail(dot)com>
To: Nathan Bossart <nathandbossart(at)gmail(dot)com>
Cc: Florents Tselai <florents(dot)tselai(at)gmail(dot)com>, Sami Imseih <samimseih(at)gmail(dot)com>, Dagfinn Ilmari Mannsåker <ilmari(at)ilmari(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: add function for creating/attaching hash table in DSM registry
Date: 2025-06-13 15:01:22
Message-ID: CAH2L28uPtxo1z_0ZP6yjNkVdgBPB7QnTA+ydn3qWAq20W-sF-A@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

> * 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.

I am considering whether it would be better to avoid creating another DSM
segment to
track the DSA handle.
Would it make more sense to track the DSAs in a separate dshash registry
similar
to DSM segments?

+ /* Attach to existing DSA. */
+ dsa = dsa_attach(state->dsah);
+ dsa_pin_mapping(dsa);
+
+ *found = true;
+ }

Should this also consider the case where dsa is already mapped,
to avoid the error on attaching to the DSA twice? IIUC,
that would require calling dsa equivalent of dsm_find_mapping().

Thank you,
Rahila Syed

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Yugo Nagata 2025-06-13 15:24:53 Re: Suggestion to add --continue-client-on-abort option to pgbench
Previous Message Andrew Dunstan 2025-06-13 14:53:50 Re: Cluster.pm psql() undefined $$stderr