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 1uluzT-007IIO-Pz for pgsql-hackers@arkaria.postgresql.org; Tue, 12 Aug 2025 19:48:59 +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 1uluzR-009Vv7-Rj for pgsql-hackers@arkaria.postgresql.org; Tue, 12 Aug 2025 19:48:58 +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 1uluzR-009Vuy-I6 for pgsql-hackers@lists.postgresql.org; Tue, 12 Aug 2025 19:48:57 +0000 Received: from mail-io1-xd2f.google.com ([2607:f8b0:4864:20::d2f]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uluzP-000HFU-1K for pgsql-hackers@postgresql.org; Tue, 12 Aug 2025 19:48:57 +0000 Received: by mail-io1-xd2f.google.com with SMTP id ca18e2360f4ac-88428b19ea9so8257839f.0 for ; Tue, 12 Aug 2025 12:48:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1755028133; x=1755632933; 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=oIIRpfMs9t4m83EseWKMI9c76ky2CX9zraZJwE5y8WM=; b=Ze3XWzI1os8AqPd1248pz4tgnYP8qMG1pnbWQkcwBSHwyqCtGCv0ZUtovQ0lDJ5Pld Yvz6eo5Y61T57Pm79LpPKJNs5QR9ImbbElUHc9B3OWgITeBwXgIpecxQeiE1GHoRaVmS C9JXgvrry/LvNEZBBXNgn2ILnRPF7b00oI43Z3jpb0ylerrmc94Iaaje26oDSk0MlGMN moL7acwsVQzzPggHb8B0LYceolXRn1P3JJrMDCSoWFVbHDVeoTziShpWlYJDsBdcWp+c X1cFR3U3j2sv9Dh5C6LaAXHe11W5aRlyOfhDaCo7XF9QRCT6t+UjPiGWD4dOz1cERzv4 UP7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755028133; x=1755632933; 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=oIIRpfMs9t4m83EseWKMI9c76ky2CX9zraZJwE5y8WM=; b=te7PPrioXetLBWsgD38sNiA/6r1poapgKYhkq8fdkUx9xpkRUnsiN2g4E7XMAMBDOk ZVNDwd41RKB9jpBipWwHZjrtRxKKEtxoA42P7FzBq5CliGFf68F/q0kkELXdwxlWc2J2 I+n9ZXLsgoGVuxFVgqPHQqL08hWZtQPlMduPvRcdTnmYxWzUjOf/dhn9m/VdPJ8sPiAJ 5bBo/fnLxojKOb4GdNsPysx9EeMTIZIt5LUAGTSLcnZJ+/jKGeN2BbGKGEHvhJkDARZM APztWcNUQHorbzkq4U9Npu8zgUM6htHSC9eKeh+FGg1vcA9MWvzi4kozkkO/GtoZh3rf iKdQ== X-Forwarded-Encrypted: i=1; AJvYcCVDCL0lT8rtkFSJC6k+9SLU06mA+Cf8DSH0OLGe7RW/K+GQzutitMqwm7rcVyt2ZFS9T7fZDZhxC+rlYyU3@postgresql.org X-Gm-Message-State: AOJu0YyvSHtqCmZhIBjWdV4J6qGg6ms8UjGdencuIf7MAQCmdde7lOS3 Qklz7MMB8Yvz+rTavg0U075lVvvQ72oC4ydFZ4sUV1aRod8JGS3xiCmvX189zA== X-Gm-Gg: ASbGncuUuoCYlxqBT5AIkY4D81hVmNcaQxZ26WQxraZPCsU2dpkJ95r2q9TOZVXOrPz VW8r9orfYTMku/aMAEW4plOqFpQFCw6BLRBeUWywQLmw1BJQZP03ocvU5x3FavGipZah5TLt+Y3 G3RLldRAuUtnNJvZm550nWGEt+4T/Nll98t5EosCGqNTR7UMRVd67c0jcZu9/9ZQwH/G7GnQWXn x3hjMOxMLdhMCiA+58zoid3nPNfcjA5OsfdzqEZ/S02xgaMylI5q9xLbFZzGLxq1wQrZUneD4el T1Fmx0r1zZYbxJ4PriYLXAuFidV5Ub3G3E8im+FR2rQyLbmFA+X6J/foz+cWBPxLkwptg/Fjg+A QAAdxNnQrtE4FVbElPAe8F7ByJH3EJxQ+lTZeqgPm/0xIC0HJUK40tnIrSpJdRsfTIrvlQ8BBl/ kRUenwsAb98TB4 X-Google-Smtp-Source: AGHT+IFP158a/IWCb3+AU7P76i52yyyXkouinKPem8hRLiKVrJmfT05TrjEVs2iahzfR7hViAhzIDw== X-Received: by 2002:a92:dd09:0:b0:3e5:65c5:75c7 with SMTP id e9e14a558f8ab-3e5666404a8mr10443415ab.9.1755028132669; Tue, 12 Aug 2025 12:48:52 -0700 (PDT) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-50b2cb76116sm567050173.42.2025.08.12.12.48.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Aug 2025 12:48:52 -0700 (PDT) Date: Tue, 12 Aug 2025 14:48:50 -0500 From: Nathan Bossart To: Sami Imseih Cc: Rahila Syed , Bertrand Drouvot , 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 I haven't followed the latest discussion, but I took a look at the patch. + It is possible to use a tranche_id that was not retrieved + using LWLockNewTrancheId, but this is not recommended. + The ID may clash with an already registered tranche name, or the specified + name may not be found. In such cases, looking up the name will return a generic + "extension" tranche name. Is there any reason to continue allowing this? For example, maybe we could ERROR if LWLockInitialize()/GetLWTrancheName() are given a tranche_id greater than the number allocated. I guess I'm not following why we should gracefully handle these kinds of coding errors, especially when they result in unhelpful behavior like an "extension" tranche. +#else +elog(ERROR, "injection points not supported"); +#endif This causes compilation to fail when injection points are not enabled. I haven't combed through the patch character-by-character, but upon a read-through, the general shape looks reasonable to me. As a general note, I'd suggest adding more commentary throughout and finding opportunities to simplify and/or clean up the code as much as possible. -- nathan