Re: Proposal: Add a callback data parameter to GetNamedDSMSegment
Sami Imseih <samimseih@gmail.com>
From: Sami Imseih <samimseih@gmail.com>
To: Zsolt Parragi <zsolt.parragi@percona.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-12-03T18:47:46Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Allow passing a pointer to GetNamedDSMSegment()'s init callback.
- 48d4a1423d2e 19 (unreleased) landed
-
Move dynamically-allocated LWLock tranche names to shared memory.
- 38b602b0289f 19 (unreleased) cited
Hi, Can you provide more details on the use-case? > For example, the documentation for creating LWLocks after startup [1] > suggests creating locks in this callback. That works fine as long as > the callback only needs to create a hardcoded lock. The callback is called on the first invocation of GetNamedDSMSegment for a particular segment name. Subsequent calls just attach an existing segment. > But if the lock name is a parameter to the function calling GetNamedDSMSegment, and > not fixed, I do not see a clean way to pass it through to the callback Keep in mind that the tranche name shows up in wait events, so you will end up with different wait event names. Also, commit 38b602b capped the number of lwlock tranches to 256, so you may hit this limit if you are creating many lwlocks. #define MAX_NAMED_TRANCHES 256 -- Sami Imseih Amazon Web services (AWS)