pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Nathan Bossart <nathandbossart@gmail.com>
To: Sami Imseih <samimseih@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Andres Freund <andres@anarazel.de>
Cc: Bertrand Drouvot <bertranddrouvot.pg@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 15:59:39 -0500
Message-ID: <aKTlu7mHhx4owx6r@nathan> (raw)
In-Reply-To: <CAA5RZ0sbo-HAOrTGVoqP3giXKDV_LXL0UGaYs8mfjcS33mn3FQ@mail.gmail.com>
References: <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>
	<aKTGF9Fv1ioXa9P5@nathan>
	<876523.1755635201@sss.pgh.pa.us>
	<CAA5RZ0sbo-HAOrTGVoqP3giXKDV_LXL0UGaYs8mfjcS33mn3FQ@mail.gmail.com>

On Tue, Aug 19, 2025 at 03:52:33PM -0500, Sami Imseih wrote:
> If we limit the tranche name to NAMEDATALEN and also limit the
> number of tranches an extension can register, we can put this
> all in static shared memory (We would still need to have a backend local
> cache to allow lookups to avoid going to shared memory).

I bet we could avoid the local cache by keeping a backend-local copy of
LWLockCounter that gets updated as needed.

> However, I am not sure what the limit would be for the number of tranches,
> and if we do impose something, will it break anything that is out there?

I can think of contrived scenarios where these limits would present
problems, but I'm not aware of anything that folks are actually doing that
would be affected.  In general, the examples I've seen involve allocating a
small number of tranches for an extension, so my assumption is that the
most likely cause of breakage would be someone installing many, many
extensions.

-- 
nathan





view thread (107+ messages)  latest in thread

Message-ID: <aKTlu7mHhx4owx6r@nathan>
Permalink:  ../aKTlu7mHhx4owx6r@nathan/
Also on:    postgresql.org/message-id/aKTlu7mHhx4owx6r@nathan

 · 

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, samimseih@gmail.com, tgl@sss.pgh.pa.us, andres@anarazel.de, bertranddrouvot.pg@gmail.com, rahilasyed90@gmail.com
  Subject: Re: Improve LWLock tranche name visibility across backends
  In-Reply-To: <aKTlu7mHhx4owx6r@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