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 1uytEv-00E8hB-0l for pgsql-committers@arkaria.postgresql.org; Wed, 17 Sep 2025 14:34:33 +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 1uytEs-0085Zj-Fm for pgsql-committers@arkaria.postgresql.org; Wed, 17 Sep 2025 14:34:31 +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 1uytEs-0085Zb-7a for pgsql-committers@lists.postgresql.org; Wed, 17 Sep 2025 14:34:31 +0000 Received: from mail-il1-x131.google.com ([2607:f8b0:4864:20::131]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uytEp-001Kkp-0R for pgsql-committers@lists.postgresql.org; Wed, 17 Sep 2025 14:34:30 +0000 Received: by mail-il1-x131.google.com with SMTP id e9e14a558f8ab-421eecb573dso30384715ab.2 for ; Wed, 17 Sep 2025 07:34:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1758119666; x=1758724466; darn=lists.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=U+gY0Q9LkzMZqdyr37/0aRK6qFDvQXLRTnza84EyLXI=; b=fkSdj4AGJnAwC0dDxhPVjSIgRQZeoIpbh+I6LM2RltjQnVOp+W3Khg/pfaD5ijl6oG soZxhBMJtrRW4hiuf5rMWteMdm4m7tOa2wcnZVOBAjcG72Mz4plGpgEZblV+QclS/2iM rAOCMYbO6sTYFMyerjRb+PJDxKG/GBfFI45Vy2JFYRbp3oKyoJO7gjFzzymPzUEpK5TE A0aFVqPGgcO+v8CK8KVl92REzbv1f1qUrBiFfyMY9YdwX43raMtO7vjfne2Tt6dAPVfa uo3WwkqDmMPiW3VBZJ8m41MmuKFHQJNYrnjkOv0l5fXGD5xEdxkNknWznb0QydjwFZrH X3NA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1758119666; x=1758724466; 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=U+gY0Q9LkzMZqdyr37/0aRK6qFDvQXLRTnza84EyLXI=; b=PoTWfSDL5CtSfeUdlw2CQ44A4Tx87Qp4PExOi3eFui9vhw6sIFKyNqKxH5Mj041zgS tUhieEsCc1oGUk9xraSYCPru4WF1JH2GCAWZh8jrznJKFsITZ3LND2V40YfAPMqa2Yge 4TgC2bCbhWQRXGMdsJ/U5du7KrOxQn3A7Ssh9WabrznNfIShcHxsEBWUiE8+FMcR9BnT RBw7lH8NK9rfGE4+5hNZsfpV3xX52hiECR1wAr7HC+9Basn3iGsTz6t8o3Qdz4s8AasA isBU/TLBBn3mRjESEnyShIxhhrEtqdwGrda9lu7AmAF3Ymq5oB6J9P6fxDAYAxOQ9NW/ xypA== X-Forwarded-Encrypted: i=1; AJvYcCUmrBB58JISsi7HiAoG7jUxCFy/uUWQYlGZffhFbBxreZE0sQIOFiJ7nfUEwkrSSoPqfvYqHcgyLaJpc2nEXk99@lists.postgresql.org X-Gm-Message-State: AOJu0YwTstpoYTMKkfk2+tmuaeQKcrNX0P8KV0uQap5cxWECawas08ll mO8tYGrz7u9Ieo8qCfLS9qyWBjuMI5ZiMtfQHYAHPdIOmwrs8CC9Kf81F8YIzQ== X-Gm-Gg: ASbGnctmIPS7lcYLuODU5bxsM11yM3KGrG3eY+DCt8ESThTAU7QphuATIGnOes65UOD fzSxHjq0UpcP4twpp4kj7iFrNtMgPeB1skXYyU/Gpxs5FM+68O67S2pDIkh5tTauQeAndVuVQpt GBJCNvaL2Prv681HAhqYVEDCoD8BhCjdLDi3pvoAO+nD3tc6b7bsZwkBcNMpUYc9Yrz/odlnGI3 Ve9AYFhjwtaTp4SylHG+vyMM5hQ/FVsrvBvfgYO+7misyNG6WZfDAqHcVfyRNBEOF7d1MZNsLPh LmU6OK1vv2engt1QbXdUyLFsGhWSKWu8yDFnvNos7qs6fJH3l011HsDdbiHHbXtZf2U/5p+C6yC muTfMLCapZUYKbW4GTzq5QcnbC8otMslJ0YroKLPYbYNwTn6LRUylPHm11fewsiCPVJuJFbRdPg zfp2Cpsd809rDx X-Google-Smtp-Source: AGHT+IF3+GS21Z2OxgQUGz3ITFVGWZvz3vZqhl6/xBEcQ0I4hellh7efhCL77ZuxZSLWs5mPdAlKwA== X-Received: by 2002:a05:6e02:164b:b0:3f0:7ad2:2bf5 with SMTP id e9e14a558f8ab-4241a4e1040mr33202055ab.12.1758119666373; Wed, 17 Sep 2025 07:34:26 -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-511f30ccc33sm6924662173.77.2025.09.17.07.34.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Sep 2025 07:34:25 -0700 (PDT) Date: Wed, 17 Sep 2025 09:34:24 -0500 From: Nathan Bossart To: Michael Paquier Cc: Nathan Bossart , pgsql-committers@lists.postgresql.org Subject: Re: pgsql: Move named LWLock tranche requests to shared memory. Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="Zv6Yd4rOwBfBuepf" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Zv6Yd4rOwBfBuepf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Sep 17, 2025 at 01:47:19PM +0900, Michael Paquier wrote: > Perhaps LocalNamedLWLockTrancheRequestArray should be initialized to > NULL when declared, and I'd rather document the reasons behind what > this patch is doing in LWLockShmemSize() and when the state is > initialized in CreateLWLocks(), than have the reader assume why the > local pointer is needed (aka reinitialized with restart_after_crash). I've added some commentary to this effect in v3. > Note: I forgot for a second if shared_preload_libraries was reloaded > when the postmaster reinitializes a cluster, and the answer is that > we only go into process_shared_preload_libraries() once at startup.. > I was wondering for a second about a potential case where s_p_l is > updated with more lwlocks added in-between, where a reinitialization > would mess up things. Yeah, this stuff is rather precarious, and I'm a bit surprised there haven't been more problems in this area. -- nathan --Zv6Yd4rOwBfBuepf Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0001-Fix-re-initialization-of-LWLock-related-shared-me.patch