From: Nathan Bossart <nathandbossart@gmail.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: Nathan Bossart <nathan@postgresql.org>
Cc: pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Move named LWLock tranche requests to shared memory.
Date: Wed, 17 Sep 2025 09:34:24 -0500
Message-ID: <aMrG8F-NkiedEugc@nathan> (raw)
In-Reply-To: <aMo9V5A7S30mwCcR@paquier.xyz>
References: <E1uwodL-000EuJ-2j@gemulon.postgresql.org>
<aMoejB3iTWy1SxfF@paquier.xyz>
<aMoqphZNkFJ_iy_K@nathan>
<aMo0uqvCDEYmYMQD@nathan>
<aMo9V5A7S30mwCcR@paquier.xyz>
On Wed, Sep 17, 2025 at 01:47:19PM +0900, Michael Paquier wrote:
> Perhaps LocalNamedLWLockTrancheRequestArray should be initialized to
> NULL when declared, and I'd rather document the reasons behind what
> this patch is doing in LWLockShmemSize() and when the state is
> initialized in CreateLWLocks(), than have the reader assume why the
> local pointer is needed (aka reinitialized with restart_after_crash).
I've added some commentary to this effect in v3.
> Note: I forgot for a second if shared_preload_libraries was reloaded
> when the postmaster reinitializes a cluster, and the answer is that
> we only go into process_shared_preload_libraries() once at startup..
> I was wondering for a second about a potential case where s_p_l is
> updated with more lwlocks added in-between, where a reinitialization
> would mess up things.
Yeah, this stuff is rather precarious, and I'm a bit surprised there
haven't been more problems in this area.
--
nathan
Attachments:
v3-0001-Fix-re-initialization-of-LWLock-related-shared-me.patch (text/plain, 0B) download
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: nathandbossart@gmail.com, michael@paquier.xyz, nathan@postgresql.org, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Move named LWLock tranche requests to shared memory.
In-Reply-To: <aMrG8F-NkiedEugc@nathan>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox