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 1nZbEl-0002ZU-Gs for pgsql-hackers@arkaria.postgresql.org; Wed, 30 Mar 2022 16:31:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nZbDm-000611-CQ for pgsql-hackers@arkaria.postgresql.org; Wed, 30 Mar 2022 16:30:58 +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 1nZbDm-00060j-1W for pgsql-hackers@lists.postgresql.org; Wed, 30 Mar 2022 16:30:58 +0000 Received: from mail-il1-x12d.google.com ([2607:f8b0:4864:20::12d]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nZbDj-0001V3-Mr for pgsql-hackers@lists.postgresql.org; Wed, 30 Mar 2022 16:30:56 +0000 Received: by mail-il1-x12d.google.com with SMTP id k11so6225536ilv.5 for ; Wed, 30 Mar 2022 09:30:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=BV1Raj7Xtx5g1EVyBqqTz10EDr+5jhzZle5nq+rccsg=; b=CJGrgoj4H2eMK2y7IJ2bCPLhH48ZPScB1Z/RPHkz7LOSGNS3n/KEozRTfsNFkwsFSN yZY4PEZuVEJClPNUf/LHlxMNB6RB30hhYd6TkRqDS4sRx2C+svhvkgH2JNq/dHJlJf15 zTQDTmNl8lYfMl/cJHPjZhk/oY22/5r2Dn+cYP4piA+mNad6HbcBhyWIegpvliFSMeJY FXP0fKrBq6Ro1bQqyA6matLWu+Fe6T4W3MMUq9YUEjJ1ujctrcXAtA4UDfBMC18uSKND H0aQXNlgEDYtrwbK4acCJ9AzzM+DiM1QhMXiJQn5CD59LJiMCGY18zhgFqPB6hSr7M1L A/FA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=BV1Raj7Xtx5g1EVyBqqTz10EDr+5jhzZle5nq+rccsg=; b=gslPCCuDlevT4J9/EmwT+jDsruUq3R6A259LapTZoMGNZ3CvS12FmyOGBcNhaEGcMg zVCQn9yTrxQ9VxqNVh9qbuLz87bdtGpD9Z5ZwSuDlwwbfXXQhCyz4uy4zwXTuWlEkZO3 ZziSsjZxhiat9DbbELZQ1GlwK0aTZWAxEBHvmFo336vTmOl/Mr7EEWV7NiGhYCrATiHv O8q3m6VZS5G2j4Lg/1ViwZ/G2xGYgZeSItzMYRcFAN8pAWYlU+a65VoZf9MZ0f8MIvLz /x5xC81lulkfKYFAkOXyx+UBzSFOlaYN7fm54NJgxSPGGpg3kvzxqz/pGP1G8lsA8bQr g96w== X-Gm-Message-State: AOAM533vEnzF8R2GfvYuFsSOQ49qMbkzwhP3MvjOMA7iyo2n1lcOSm8V AK6HURXxkubpA53Axocp0co= X-Google-Smtp-Source: ABdhPJwKl2+GUFLnYijNYOZZ9wjSYjjgTNhSMh56iAw5riP75M7NCL+OAKvPHssFEDAZSwspL838lA== X-Received: by 2002:a92:ca06:0:b0:2c6:250d:bc53 with SMTP id j6-20020a92ca06000000b002c6250dbc53mr11827029ils.253.1648657854881; Wed, 30 Mar 2022 09:30:54 -0700 (PDT) Received: from nathanxps13 ([2600:1700:48f8:340f:4238:8eb5:a9bd:838d]) by smtp.gmail.com with ESMTPSA id d16-20020a05660225d000b00645c8db7767sm11640696iop.35.2022.03.30.09.30.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Mar 2022 09:30:54 -0700 (PDT) Date: Wed, 30 Mar 2022 09:30:51 -0700 From: Nathan Bossart To: Robert Haas Cc: Andres Freund , Julien Rouhaud , Michael Paquier , "Bossart, Nathan" , Fujii Masao , "wangsh.fnst@fujitsu.com" , Bharath Rupireddy , Greg Sabino Mullane , Tom Lane , "pgsql-hackers@lists.postgresql.org" Subject: Re: make MaxBackends available in _PG_init Message-ID: <20220330163051.GA784643@nathanxps13> References: <20220324202050.GA1855897@nathanxps13> <20220325023951.purgu4gb5jyrtc7w@jrouhaud> <20220325031146.cd23gaak5qlzdy6l@jrouhaud> <20220325063542.n6die7fmawluqkfp@jrouhaud> <20220325222317.dftrmzuyrb3iv62o@alap3.anarazel.de> <20220326072203.asge6bua7dxczf7m@jrouhaud> <20220326172316.obspcdmjqerislri@alap3.anarazel.de> 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, Mar 29, 2022 at 12:22:21PM -0400, Robert Haas wrote: > It's not, though, because the original proposal was to change things > around so that the value of MaxBackends would have been reliable in > _PG_init(). If we'd done that, then extensions that are using it in > _PG_init() would have gone from being buggy to being not-buggy. But > since you advocated against that change, we instead committed > something that caused them to go from being buggy to failing outright. > That's pretty painful for people with such extensions. And IMHO, it's > *much* more legitimate to want to size a data structure based on the > value of MaxBackends than it is for extensions to override GUC values. > If we can make the latter use case work in a sane way, OK, although I > have my doubts about how sane it really is, but it can't be at the > expense of telling extensions that have been (incorrectly) using > MaxBackends in _PG_init() that we're throwing them under the bus. > > IMHO, the proper thing to do if certain GUC values are required for an > extension to work is to put that information in the documentation and > error out at an appropriate point if the user does not follow the > directions. Then this issue does not arise. But there's no reasonable > workaround for being unable to size data structures based on > MaxBackends. FWIW I would be on board with reverting all the GetMaxBackends() stuff if we made the value available in _PG_init() and stopped supporting GUC overrides by extensions (e.g., ERROR-ing in SetConfigOption() when process_shared_preload_libraries_in_progress is true). -- Nathan Bossart Amazon Web Services: https://aws.amazon.com