From: Nathan Bossart <nathan@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Revert recent change to RequestNamedLWLockTranche().
Date: Thu, 04 Sep 2025 20:35:37 +0000
Message-ID: <E1uuGgD-000WGv-37@gemulon.postgresql.org> (raw)
Revert recent change to RequestNamedLWLockTranche().
Commit 38b602b028 modified this function to allocate enough space
for MAX_NAMED_TRANCHES (256) requests, which is likely far more
than most clusters need. This commit reverts that change so that
it first allocates enough space for only 16 requests and resizes
the array when necessary. While at it, remove the check for too
many tranches from this function. We can now rely on
InitializeLWLocks() to do that check via its calls to
LWLockNewTrancheId() for the named tranches.
Reviewed-by: Sami Imseih <samimseih@gmail.com>
Discussion: https://postgr.es/m/aLmzwC2dRbqk14y6%40nathan
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/d814d7fc3d5257ae258b502229fc7ca97c97270a
Modified Files
--------------
src/backend/storage/lmgr/lwlock.c | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
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: nathan@postgresql.org, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Revert recent change to RequestNamedLWLockTranche().
In-Reply-To: <E1uuGgD-000WGv-37@gemulon.postgresql.org>
* 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