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 1uoTQn-004VJe-9w for pgsql-hackers@arkaria.postgresql.org; Tue, 19 Aug 2025 20:59:46 +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 1uoTQl-00H1yU-Vq for pgsql-hackers@arkaria.postgresql.org; Tue, 19 Aug 2025 20:59:44 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uoTQl-00H1yG-KM for pgsql-hackers@lists.postgresql.org; Tue, 19 Aug 2025 20:59:44 +0000 Received: from mail-io1-xd2d.google.com ([2607:f8b0:4864:20::d2d]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uoTQj-000jAD-2x for pgsql-hackers@postgresql.org; Tue, 19 Aug 2025 20:59:43 +0000 Received: by mail-io1-xd2d.google.com with SMTP id ca18e2360f4ac-8844ee2cb61so90033939f.2 for ; Tue, 19 Aug 2025 13:59:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1755637182; x=1756241982; 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=+GUedvHOGyVT13MkTdOUACAakHo0l+aL/EyNb4tFxgs=; b=IMJc8OvaOt7yh9BEmb0qpN9TO8+Dn3uedmBLgdjKOm230s2uCS5j9398dWGEvrZyny 6BlFEIFP/s1+2AwThoXEpAjENG1waOKOMngPSmPvTurXK2ZkvIJDB4m4e61oGI+CKNBv 4A4pKhb9rrCnimvkWv1a2YtW+HhKZROl7jWcUV78ZytB7PUUYVFeNoASA8ajLzbZhYoO u0/KtT5mrh7XrKW7BzrpcHzQe3UvL+6FNLrJ4lIX7dXvIu8H04YYBWPN9wSQy0fBBnTN Ab38GnHj2zoY6sqdDg/BJw2Hj0X5jgSpTg0S9ZJaYnptqMKXQyR6APFO6yx90uwxZhWH meew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755637182; x=1756241982; 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=+GUedvHOGyVT13MkTdOUACAakHo0l+aL/EyNb4tFxgs=; b=m6pD4RyJNBQtwLzR30oJfKBZaIjOquUh0oPpn+HIDEoPCW5To05h+2v+43KOCTLOUU Zk7meiYzIlusD3gKw+wvRVPv30Hgx6nP9z1HpzHTbykvX7VqkKW52+HreG7rirmfNJGE 0UnPX4vjqNnth+GTAvqQz7wEYKX0WCUS9ZpjCirMA/7PvCaeRLmhJ8z4i0b3ujRfN9Lt W7oKbJX9vWzMz15i+ha+vQmiPCRuop+dRinnKrc6/6XTYEmrxc+tVv+lww8FyDp1I93t MtZanWnYW9vOA3/w574+wd4+FH76bGWDmhCoymLM3TmcHP2myBuSkGPNUvbDJi0Ocaxb Yukg== X-Forwarded-Encrypted: i=1; AJvYcCV+rjVTMtHOPh9xWkLGuqyIS9XzW0c4g9XtjBMYN85/gAABXL45j9TTffRfh4slr5XQ4QOGd3bOh4EiVtzX@postgresql.org X-Gm-Message-State: AOJu0YyQXsTe0GB3Xe2hYctMUOe7Ba2L9q4m+YSsiiPvsNE7R4Scx28D iTbzGls9BJwNShIvVArzsfIpqKD0sB5q1ERCqsJ44X+7Ye754m2nqwDo X-Gm-Gg: ASbGncvW4An3aoNhmFbiJLUs+O3R70fJV4K/veKhtV0cCzuUhwHWTJlQEhATmT6j/4M CTPwtCWGLBFioDs+yjnwOHrFz6oMgIdFdVXaWAaIkiaIv6Jk8S/8zgqT6fp8nwd1DQJmKNpdsRg pPyjifKsdyebypQF96p+gwxyrNTFQexieEqV0TualL+M5dvKsNn14UuaC3GZgU7Ft94QvFgGQQk dsLXUnfsCEX3glGIn/JjO3bcDf2jZaqUS9Rr6J9gTXR3UUW/CEkyXyjsU3S1vfKnVdw1iWZTDES b2i1Kz6RysgYYep5m2Zg55tKEu0BEVxqhmUlPTD4q9HI4PpiqJPtarduUZ9Fbsw0pLU/3W+XnY2 7FbZPCj9rFBidLI4/vsFkncC8IgpPR7hiSr4YPqGenQbyyxgeq4sAp3hzAX6sMCVQSqY9TOUYGP LoRP0oLTimRtIgN7Q6UQETo6Y= X-Google-Smtp-Source: AGHT+IEwgVtmCnmseHGwc2g7OH3EwNu6IkPSUWtwHk1/w3IqK74963Qs8amTXctN2mvYQNgW45yQuA== X-Received: by 2002:a05:6602:6d16:b0:881:7627:b0a3 with SMTP id ca18e2360f4ac-88471b0a2damr178041339f.14.1755637181721; Tue, 19 Aug 2025 13:59:41 -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-8843f7fca7bsm442688639f.6.2025.08.19.13.59.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Aug 2025 13:59:41 -0700 (PDT) Date: Tue, 19 Aug 2025 15:59:39 -0500 From: Nathan Bossart To: Sami Imseih Cc: Tom Lane , Andres Freund , Bertrand Drouvot , Rahila Syed , pgsql-hackers Subject: Re: Improve LWLock tranche name visibility across backends Message-ID: References: <34drxi6kshtzu5aerftjflrm6wfxxw54emyvy4gqemdpxxuhvm@gymw6its72o7> <5to6tftuml6nkas4jaaljfzecasvslxq3mumeslh74wsol4mzw@rgxpxxlqqwtf> <876523.1755635201@sss.pgh.pa.us> 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 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