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: Alexander Lakhin <exclusion@gmail.com>
Cc: Rahila Syed <rahilasyed90@gmail.com>
Cc: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Andres Freund <andres@anarazel.de>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: Improve LWLock tranche name visibility across backends
Date: Mon, 10 Nov 2025 10:26:17 -0600
Message-ID: <aRISKd2MEeIqRcOh@nathan> (raw)
In-Reply-To: <CAA5RZ0va93+wk3_6UYi52=b=xqbKtXvaM-Cj5moTir7nM-LA=Q@mail.gmail.com>
References: <CAH2L28sz2NcLCS2v1MNkBNUiTiO=-CegFGdAvO24nE+hbjzgjQ@mail.gmail.com>
	<aLcPbyWLawp5_rdt@nathan>
	<aLiQeizOQKbKF-ae@nathan>
	<aLmzwC2dRbqk14y6@nathan>
	<CAA5RZ0t6s2Z38oRq883Ocq7J4xjn1FJF17Q4YR6++vrw5KYCtQ@mail.gmail.com>
	<aLn4n-5UFzKHFdR5@nathan>
	<dd36d384-55df-4fc2-825c-5bc56c950fa9@gmail.com>
	<CAA5RZ0u8+sC_FBwoaUeLhTi5bmjba9Yk3N-TbdsTm7c1no0zcg@mail.gmail.com>
	<CAA5RZ0v4kwF06o4a+Xybd++ipC7TYkn879Wz_2BZK412+ULXgg@mail.gmail.com>
	<CAA5RZ0va93+wk3_6UYi52=b=xqbKtXvaM-Cj5moTir7nM-LA=Q@mail.gmail.com>

On Mon, Nov 03, 2025 at 11:50:48AM -0600, Sami Imseih wrote:
>>> I am not sure we need to do anything about this.
>>
>> Or maybe we just avoid the tranche_id from leaking
>> in test_dsa_resowners() by making it a static variable
>> and checking if we have a valid tranche id before calling
>> LWLockNewTrancheId()? That is the proper pattern.
> 
> Like the attached.

It's probably a good idea to avoid tranche leaks, but IMHO there's room for
improvement in the DSM registry, too.  IIUC the problem is that the DSM
segment is still being added to the registry and found by other backends
despite the initialization callback failing.  My first instinct is that we
should keep track of whether the DSM segments/DSAs/dshash tables in the
registry have been fully initialized and to just ERROR in other backends
when attaching if they aren't.  That shouldn't really happen in practice,
but it'd be good to avoid the strange errors, anyway.

-- 
nathan





view thread (107+ messages)  latest in thread

Message-ID: <aRISKd2MEeIqRcOh@nathan>
Permalink:  ../aRISKd2MEeIqRcOh@nathan/
Also on:    postgresql.org/message-id/aRISKd2MEeIqRcOh@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, exclusion@gmail.com, rahilasyed90@gmail.com, bertranddrouvot.pg@gmail.com, tgl@sss.pgh.pa.us, andres@anarazel.de
  Subject: Re: Improve LWLock tranche name visibility across backends
  In-Reply-To: <aRISKd2MEeIqRcOh@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