Re: dshash_find_or_insert vs. OOM - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: dshash_find_or_insert vs. OOM
Date
Msg-id adWpsq8d0GSq6Ao-@paquier.xyz
Whole thread Raw
In response to Re: dshash_find_or_insert vs. OOM  (Sami Imseih <samimseih@gmail.com>)
List pgsql-hackers
On Tue, Apr 07, 2026 at 12:00:14PM -0500, Sami Imseih wrote:
> My apologies for the late response here. I spent some time looking at
> this yesterday and came to the conclusion that we can add dshash tests
> to test_dsm_registry, which already allocates a dshash via
> GetNamedDSHash(). However, I also realized that the API has a gap: callers
> cannot set a size limit on the dshash. I need this for the test, but
> more importantly it's a limitation of the API itself.

As in dsa_set_size_limit() cannot be set for a dshash currently.
Indeed that could be independently useful for some use cases.

> So I plan to
> target v20 for the tests, as it's likely too late for v19. To start, I've
> submitted a patch for allowing callers to set a size limit on a
> GetNamedDSHash()-allocated dshash [1].
>
> [1] https://commitfest.postgresql.org/patch/6655/

That's too late for v19, at least here.  Thanks for pursuing this
work.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Chao Li
Date:
Subject: Re: Add errdetail() with PID and UID about source of termination signal
Next
From: Michael Paquier
Date:
Subject: Re: Return DSA area for hash table from GetNamedDSHash()