Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uuGiW-005yU0-HL for pgsql-hackers@arkaria.postgresql.org; Thu, 04 Sep 2025 20:38:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uuGiV-002FbU-Ki for pgsql-hackers@arkaria.postgresql.org; Thu, 04 Sep 2025 20:38:00 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uuGiV-002FbL-Bh for pgsql-hackers@lists.postgresql.org; Thu, 04 Sep 2025 20:37:59 +0000 Received: from mail-io1-xd35.google.com ([2607:f8b0:4864:20::d35]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uuGiQ-000asV-2U for pgsql-hackers@postgresql.org; Thu, 04 Sep 2025 20:37:57 +0000 Received: by mail-io1-xd35.google.com with SMTP id ca18e2360f4ac-884328c9473so45029639f.0 for ; Thu, 04 Sep 2025 13:37:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1757018274; x=1757623074; darn=postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=rWUynJkleBV/4yQ2DNMprP00hEVif0f2L2Ci4BipbaM=; b=XvVcF5J8UH6u9gNSMfeiNfHvZ3s3I5kZdQFwJ+ROIYV8QTiNkxP7Rwy0vs6B7fBT7h CizSh2+XPB3VbVCWlu+bWxpAz2ArXmKtkPV6zLQBJp8c78baz4cqTLXuVqnCmUcagtaS vth28upbltz77joDS1jmtF/0sT60OlveroKcGTuPbEcrJY4EC4yIb5AJ5kCC8AhJ4vVN Puw+MB3TT6jVJq0wdG3wZIKgquophBNrZw9KPc/dof5NOgMFnRqoeLV4d23g2FJpGH1X rL20p1nBwCY89tqgcQlW0b8AWGIHeDZSPdAgxvmgEq/c3GrcQgvItVwC2eo/2G6J8f6k EORA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757018274; x=1757623074; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=rWUynJkleBV/4yQ2DNMprP00hEVif0f2L2Ci4BipbaM=; b=cxghI0UtSGQX+WXQGoSkRfVZQBnLD2JASard9+BkJZ5Shnid8D7azPmTigmUJNp7aD W7utEEq0zbwKGdbx8ro8uWXn2NHN000qD9MGq0UaeGA3ixPJsugiipLDp5VKcxqdZiJe 0SQgv87lkqQM7mYO9dFaqOOeD4FqkP9dsrIdGR+I13KdNEvoN38P/DCF5C0rVZC2WrZX BPKh9xMmnhCeCHTzuOQdMBrUAxEudNpirUZEwYAJVjdo0Y1L/EXELfTR3Ha3WTVUIJAO aZ4+yiz7N01W+cs+/UzYcM5SGR73ZoyQN4zrp3kM6FZ1bTLrjksIHyahTnFRmyrCDhFV DZCg== X-Forwarded-Encrypted: i=1; AJvYcCWzBIBu1al9vnQ5jut2ZHGV9Y0qhtq6Z42I58Tgkr3qQu5vFbASkB955LzNj82umBNxIdb92FrqchB/FQHM@postgresql.org X-Gm-Message-State: AOJu0YzL71gSy64zhd4DwKxYl6vyVSn4O2ljukwb3tslDICm7qfLRT2l MV3siLvFRJKTK5umFMruBEb5EK0NHUpuE2e9boTfEvG6yOLZcTcyB4yB X-Gm-Gg: ASbGncv7gYjAJxNxHjcgBkjyinJbjBW2gDcER5IAjofvs47hCOlKT8sI3w+uixvgp4S 8LkIMoz8j7nTjq8wws/vnSaZ08sBaOwztoBVMaTYKkPaSMfpSPJ7KIfx9AOF8FopxjsUBcPtG5e P0rt3uri0mqmAO5a/9h6B3b7Wv3oih3lX24sWekgk6BovAXuW1iTQC0cCOFsjfOy+wPUgVFcxSx 20qYO38VmkjQz+w9qPGgOZcR4GcktRl/QOaGBkka4oVxm9fulECbJkYyXCRb5AkEGtELG0oWaaX Qo7/5p+avWjNbk7PbwRc9Jl8rDm1CQ5a4ojnV8eQn72juQIlyuCf/L3IlzGkzVN9C7x8Uzr0+nq FxDAqRC7RuaKjSVDK/RqOEYKZVfO+sH2haRW6biO7fo4Rprlm075m5CSgvt9kOTP39Cx8tyElgc saFrcuTI0LZdjM X-Google-Smtp-Source: AGHT+IEGnqxTH9ftKIyzyrQjUymYxkLOwC2annrkY3d+CbFfpMa5AoxpEtGowUgTwOjmdc7W/dArJg== X-Received: by 2002:a05:6602:1485:b0:887:690b:2594 with SMTP id ca18e2360f4ac-887690b262cmr87437739f.5.1757018273598; Thu, 04 Sep 2025 13:37:53 -0700 (PDT) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id ca18e2360f4ac-8871e32a0e5sm513176939f.7.2025.09.04.13.37.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Sep 2025 13:37:52 -0700 (PDT) Date: Thu, 4 Sep 2025 15:37:51 -0500 From: Nathan Bossart To: Sami Imseih Cc: Rahila Syed , Bertrand Drouvot , Tom Lane , Andres Freund , pgsql-hackers Subject: Re: Improve LWLock tranche name visibility across backends Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Sep 04, 2025 at 12:30:27PM -0500, Sami Imseih wrote: > I liked removing the repalloc calls inside this routine and did not think > it was worth optimizing. I am OK with reverting it back. Although v1 > is incorrect since it's still initializing > NamedLWLockTrancheRequestArray to MAX_NAMED_TRANCHES Committed with that fix. >> Furthermore, the >> MAX_NAMED_TRANCHES check isn't actually needed because InitializeLWLocks() >> will do the same check via its calls to LWLockNewTrancheId() for all the >> named tranche requests. > > I thought about that one and decided to add the error message there, since > requesting a tranche happens way before LWLockNewTrancheId is called > during CreateLWLocks, so it was more about erroring out slightly earlier. > But it may be ok to also just remove it. We needed it before because the array could only ever hold MAX_NAMED_TRANCHES requests. -- nathan