Re: add function for creating/attaching hash table in DSM registry
Sami Imseih <samimseih@gmail.com>
From: Sami Imseih <samimseih@gmail.com>
To: Nathan Bossart <nathandbossart@gmail.com>
Cc: Florents Tselai <florents.tselai@gmail.com>, Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>, pgsql-hackers@postgresql.org
Date: 2025-06-10T19:05:16Z
Lists: pgsql-hackers
There is also that dynamic tranche named are stored in local backend look-up table, so if you have some backends that attached some dynamic hash table and others that did not, only the ones that registered would be able to resolve the tranche id to its name. This is the case which I encountered yesterday, in which I tested 2 backends competing for a LWLock on the dshash table, but a third backend that did not attach the hashtable reported the wait_event as "extension" rather than the extension-specified tranche name. If that third backend attaches the hash table, then it's able to report the wait_event as the tranche name specified by the extension. So that could be confusing as 2 wait events could be reported for the same code path. right? One way I see around this is for extensions to be able to register tranches when they are loaded, so every backend knows about it.Then GetNamedDSMHash could optionally allow you to specify the trancheId for either DSA or Hash, or both. Otherwise, it would default to the way this patch has it now. -- Sami
Commits
-
Fix cross-version upgrade test breakage from commit fe07100e82.
- 0c2b7174c362 19 (unreleased) landed
-
Add GetNamedDSA() and GetNamedDSHash().
- fe07100e82b0 19 (unreleased) landed
-
Remove dynamic_shared_memory_type=none
- bcbd940806a2 12.0 cited
-
Introduce dynamic shared memory areas.
- 13df76a537cc 10.0 cited
-
Relax the requirement that all lwlocks be stored in a single array.
- ea9df812d850 9.4.0 cited