Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nXcBQ-0007da-SG for pgsql-hackers@arkaria.postgresql.org; Fri, 25 Mar 2022 05:08:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nXcBP-0006wt-O7 for pgsql-hackers@arkaria.postgresql.org; Fri, 25 Mar 2022 05:08:19 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nXcBP-0006rb-EV for pgsql-hackers@lists.postgresql.org; Fri, 25 Mar 2022 05:08:19 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nXcBN-00050m-2M for pgsql-hackers@lists.postgresql.org; Fri, 25 Mar 2022 05:08:18 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 4AF225C0183; Fri, 25 Mar 2022 01:08:16 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Fri, 25 Mar 2022 01:08:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm1; bh=/0JxLjNjQpTuwR2nECz8VG7cTFACwIIcz854Yi u5gcw=; b=nvReJKcieRlIaqqTdSQVPmBFzGUhPLBNn/pkyt5eXoeS/T82u/xrPI Ycimf08e5gSlbBWdcpYgkUgolpyNYOy05QM3SDDNOtdXx4Js57obFL/cP0/C/v5i O05fX9hvYGEeGknbQZyC01nnpmFtMUyHKp1vwJMODDObTd90HoIiR4kV71bTAwAp xxJz5y3gbCqnCZ3PQKyW0QUbwk9qT+8bkmCZJ7GXpPSDRurDzUfaRffynBtH5Kdp 1rFfbkdS1Wd5ieKBP7B+Ggh3phNSsyh2dtn/MfhVSYpvzUDVt8KIM5B4Ie649IPx 8LOOIIMcusxFFi/kPrjduAzJ/4ysx65g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=/0JxLjNjQpTuwR2nE Cz8VG7cTFACwIIcz854Yiu5gcw=; b=DaCngsAYqLoq+d25iD5Y2uhmJ7H1F11Q1 rnzVw0juJbI3GWRawUxfAhiQ3JDOECaz5pdgPCm4R5vLuGzOPFrD0NEzm5b4Mbsp mOnhrvqLgZy+oPWBgCyVnlR54xQJ/dvSBfUDn9MUPPHIiQIhmCNYfe3xXuc1GNAN 3mX0E9bHaFc7vVmUPmujYK3XBM9thTFUCaQTqdZnTSmuWTCO+RyD9WDN4hEMUHii 8ibHgm9eUPZhSdPgGgTaeFgO5fMZqjlNCS9z2PakvY2X5RwIGPGPWI7mCEjacr1z 4+w5u8vimlg00UjsTNAX7Z+boTuov1rQq/qZ79CERgJD2Ebv2ABWw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudehtddgjeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvuffkfhggtggujgesghdtreertddt vdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprg hquhhivghrrdighiiiqeenucggtffrrghtthgvrhhnpedvgeduuefhtdeuleettdevjeeh heeiveeuieegleetgeeljeelieeuieehgeevhfenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiii X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 25 Mar 2022 01:08:12 -0400 (EDT) Date: Fri, 25 Mar 2022 14:08:09 +0900 From: Michael Paquier To: Julien Rouhaud Cc: Robert Haas , Nathan Bossart , "Bossart, Nathan" , Fujii Masao , "wangsh.fnst@fujitsu.com" , Andres Freund , Bharath Rupireddy , Greg Sabino Mullane , Tom Lane , "pgsql-hackers@lists.postgresql.org" Subject: Re: make MaxBackends available in _PG_init Message-ID: References: <20220209175338.GB1627503@nathanxps13> <20220210192612.GA1684442@nathanxps13> <20220323045229.i23skfscdbvrsuxa@jrouhaud> <20220323130318.hazuzotfcb6zadcc@jrouhaud> <20220324202050.GA1855897@nathanxps13> <20220325023951.purgu4gb5jyrtc7w@jrouhaud> <20220325031146.cd23gaak5qlzdy6l@jrouhaud> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="93NnUHxGJvK3L7Xt" Content-Disposition: inline In-Reply-To: <20220325031146.cd23gaak5qlzdy6l@jrouhaud> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --93NnUHxGJvK3L7Xt Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Mar 25, 2022 at 11:11:46AM +0800, Julien Rouhaud wrote: > As an example, here's a POC for a new shmem_request_hook hook after _PG_init(). > With it I could easily fix pg_wait_sampling shmem allocation (and checked that > it's indeed requesting the correct size). Are you sure that the end of a release cycle is the good moment to begin designing new hooks? Anything added is something we are going to need supporting moving forward. My brain is telling me that we ought to revisit the business with GetMaxBackends() properly instead, and perhaps revert that. This solution makes me uneasy from the start (already stated upthread), because it is not a solution to the original problem, just a safeguard that handles one small-ish portion of the whole parameter calculation cycle. -- Michael --93NnUHxGJvK3L7Xt Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmI9TjkACgkQnvQgOdby QH2uCA//dxsOg6LdRj7DP6DQ83u/A3jL98FzrjwSfiTd2HZuiIOSb6UUIgBSK31W UfpbSdPHY8fVYqgQkxmMMjAiCth4SH/DKp7sUi/i7yj2K3XceRVWY0jZMuwaJzTY qaPq/5VPGYM8dqE8E4RUaf8TGAYk1yh+H9UgBL5hE/ktRfnS95y+6IK0wftuCPzt X8GN68kN8lEinQf/1+iWyGQwmCWBcGoI2gd5wKnDDNjk24ZuJQoceKyXWMNiZpb1 GapbGPT4ypbK5ZhusP0pcIT/Cv5kzuzynCSuFWkQMjcgdWQSxC9XPsA3uHVnyXK3 eXQxFLXYH6hk3U+2uevKJ1eLXrxycq+ND3K5GJ7AGp1xF38NsFPMIj6fPjRilfS4 M5zVtlfYE/UOY2jzWwU6Aa8JxSfgCcvhzPG2CdVdrG10VV4Yx9SpBbx/zRxusP62 O55ytEZ/BZfkEXUmfjD+Yy7Di62oPk1fhCrFV11ABQEHt3Ls8dmI/lEMr7ffs+ll MPUq75+wjTH267K8zADsvsnxWIbDkx+GiQW21gf28B/l8GEtm4STGOonJ9exKnZB 7J1LXpI6vVWG2oanpYRhFUWkP8aBm/D0oZ7wAlYGooQy2R61GR12BEsnEmgaSmnc gNu2wmcMRX05QPB0ZSm6roZSQHnOcPorALX6BM0xOOhcY2swhhU= =PulD -----END PGP SIGNATURE----- --93NnUHxGJvK3L7Xt--