pg.ddx.io pgsql-hackers@postgresql.org mailing list archive
help / color / mirror / Atom feed From: Nathan Bossart <nathandbossart@gmail.com>
To: Andres Freund <andres@anarazel.de>
Cc: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Cc: Sami Imseih <samimseih@gmail.com>
Cc: Rahila Syed <rahilasyed90@gmail.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: Improve LWLock tranche name visibility across backends
Date: Tue, 19 Aug 2025 13:44:39 -0500
Message-ID: <aKTGF9Fv1ioXa9P5@nathan> (raw )
In-Reply-To: <5to6tftuml6nkas4jaaljfzecasvslxq3mumeslh74wsol4mzw@rgxpxxlqqwtf >
References: <aKL1w6tczBqsqLiJ@ip-10-97-1-34.eu-west-3.compute.internal >
<CAA5RZ0uuWWL5z80KEs95Evy9CrQqnR6vY91BmFor5YmEf06j=w@mail.gmail.com >
<CAA5RZ0vPcUb68h16ueg=A1R4ps=qU74jvG8N2xaX97DAK-E7_A@mail.gmail.com >
<aKOeMUjcv9Gozyyg@nathan >
<CAA5RZ0viNsKqjSuJ8fo74SJrf0uMi=igOn5WrtNYmVqYVh5h-w@mail.gmail.com >
<aKQxUS6rtMzCkEia@ip-10-97-1-34.eu-west-3.compute.internal >
<aKS0auEl4UUlt7XO@nathan >
<34drxi6kshtzu5aerftjflrm6wfxxw54emyvy4gqemdpxxuhvm@gymw6its72o7 >
<aKTDB5mvSowmC0Lf@nathan >
<5to6tftuml6nkas4jaaljfzecasvslxq3mumeslh74wsol4mzw@rgxpxxlqqwtf >
On Tue, Aug 19, 2025 at 02:37:19PM -0400, Andres Freund wrote:
> On 2025-08-19 13:31:35 -0500, Nathan Bossart wrote:
>> On Tue, Aug 19, 2025 at 02:06:50PM -0400, Andres Freund wrote:
>> > Possibly stupid question - is it really worth having a dynamic structure here?
>> > The number of tranches is strictly bound, it seems like it'd be simpler to
>> > have an array of tranch nmes in shared memory.
>>
>> Tranches can be allocated post-startup with LWLockNewTrancheId() (e.g.,
>> autoprewarm).
>
> Sure, but we don't need to support a large number of tranches. Just make it,
> idk, 128 entries long. Adding a dynamically allocated dsm to every server
> seems like a waste - ever shared mapping makes fork / exit slower...
The other issue is that there's presently no limit on the length of a
tranche name registered via LWLockRegisterTranche(). Life would become
much simpler if we're willing to put a limit on both that and the number of
tranches, but thus far we've been trying to avoid it.
--
nathan
view thread (107+ messages) latest in thread
Message-ID: <aKTGF9Fv1ioXa9P5@nathan>
Permalink: ../aKTGF9Fv1ioXa9P5@nathan/
Also on: postgresql.org/message-id/aKTGF9Fv1ioXa9P5@nathan
copy link · copy postgr.es
reply 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-hackers@postgresql.org
Cc: nathandbossart@gmail.com, andres@anarazel.de, bertranddrouvot.pg@gmail.com, samimseih@gmail.com, rahilasyed90@gmail.com
Subject: Re: Improve LWLock tranche name visibility across backends
In-Reply-To: <aKTGF9Fv1ioXa9P5@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