Re: Proposal: Add a callback data parameter to GetNamedDSMSegment
Nathan Bossart <nathandbossart@gmail.com>
From: Nathan Bossart <nathandbossart@gmail.com>
To: Sami Imseih <samimseih@gmail.com>
Cc: Zsolt Parragi <zsolt.parragi@percona.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-12-12T21:07:22Z
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
On Fri, Dec 12, 2025 at 02:56:39PM -0600, Sami Imseih wrote:
> fair point. In that case why don't we just keep:
>
> [...]
> - LWLockInitialize(&dsm->lck, LWLockNewTrancheId("test_dsm_registry"));
> + LWLockInitialize(&dsm->lck, LWLockNewTrancheId((char *) arg));
> dsm->val = 0;
> [...]
>
> instead of creating a new test? For the other GetNamedDSMSegment calls,
> I'll pass NULL to the void * and hard code the tranche name in the init
> callback.
I think we should verify the pointer value more directly. For example, we
could pass something like (uintptr_t) 0x12345 via the callback argument and
then verify it's the same in the callback.
--
nathan