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 1neNqd-0003fA-RS for pgsql-hackers@arkaria.postgresql.org; Tue, 12 Apr 2022 21:14:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1neNqc-000297-Ms for pgsql-hackers@arkaria.postgresql.org; Tue, 12 Apr 2022 21:14:50 +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 1neNqc-00027b-Bf for pgsql-hackers@lists.postgresql.org; Tue, 12 Apr 2022 21:14:50 +0000 Received: from mail-lf1-x129.google.com ([2a00:1450:4864:20::129]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1neNqa-0000cO-1A for pgsql-hackers@lists.postgresql.org; Tue, 12 Apr 2022 21:14:49 +0000 Received: by mail-lf1-x129.google.com with SMTP id t25so75872lfg.7 for ; Tue, 12 Apr 2022 14:14:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Atg1cnmvfqpwQoZuBejEEzZauZDUon9D2vX8m4uKc0E=; b=WwxoPbQZtcxjFBpyq6liOyAXq9LMEIk4Qnx9UjJYaU6JrC2qGvnUZimbs9aX88wuzy jnhqr9bJtw68zICxg2ocrDspT3/Xm4VxbbZZW8BRPEt5w1JS2qv4W9LEiHCN1ThBf4/f HlKYXrBQaaohRMMwlx5bofb8kcNE73w9xFZP/+21q5me6eLCCoUBhpCKyF7cN8ANmXoY Umo3XL2DhQKNDw6IBRApYClYzmVAyMEy6+V830Fn14QkY1uNs5InVdYTH6XGFQFGzIjH REHsAtHVFvbXWexoP8CMTNb3r4rLONEnQmbu4ihmj1ox7LaddizOIhR3jNQjWpCTOigo AMlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Atg1cnmvfqpwQoZuBejEEzZauZDUon9D2vX8m4uKc0E=; b=gMlTzhnRk1qIAb/Z8hewBk4X2l8RsAZazhWYnfT5y5cuj0Uda4A2WXCTMo8cDqQTlK dmVWxDCaAe19P3Ye/mi4fS7v6VFq6D5jYpRB1gdu6x/dx8hJbQQs5H9T08wSWVNqHlxn DwB5cTqioskPaQgLGNbS73zEZpKlTjf86mH1GiVltpZFIZbCnVVtIZgO5ZZ4i54IQ64Y f3L2KANuCpRIfWhTVanNTagbDNOoYHJ0Fjlq8OBaSrKJnNlF5c9KVSIQ0rQTnz80WTAo xi6t4dNLbJbz/T3acnDsbH2dtZ1SoT7YfMxQwKe10nMdodGkoqM9cKP+KQJWzgpFEpFb g2xA== X-Gm-Message-State: AOAM530SzkiR1afZ9TGow0d3bi1ROeqC5a4QJetfCV6/amIyCe16XO9g 3xaw48aFfl61X3afMBStJZi1tedMhtL8aCOqvwY= X-Google-Smtp-Source: ABdhPJwPdNLrC7Rl1F9pC3TTuMPtANPOBrCK5Ml6H0TNCO0CcMC9n4XVg84zlbzm/vdIqWWqUVAcjiEeG3xnGVwQVU8= X-Received: by 2002:a05:6512:3e0c:b0:46b:af5d:c09f with SMTP id i12-20020a0565123e0c00b0046baf5dc09fmr6109602lfv.268.1649798085804; Tue, 12 Apr 2022 14:14:45 -0700 (PDT) MIME-Version: 1.0 References: <20220411164408.GA1915258@nathanxps13> <20220411204442.GA2004824@nathanxps13> <20220411211435.GA2057981@nathanxps13> <20220412174427.sngj2uexzsttazs2@alap3.anarazel.de> <20220412180306.GA2063516@nathanxps13> <908945.1649791317@sss.pgh.pa.us> <20220412195908.GA2064996@nathanxps13> <918045.1649797122@sss.pgh.pa.us> In-Reply-To: <918045.1649797122@sss.pgh.pa.us> From: Robert Haas Date: Tue, 12 Apr 2022 17:14:34 -0400 Message-ID: Subject: Re: make MaxBackends available in _PG_init To: Tom Lane Cc: Nathan Bossart , Andres Freund , Julien Rouhaud , Michael Paquier , "Bossart, Nathan" , Fujii Masao , "wangsh.fnst@fujitsu.com" , Bharath Rupireddy , Greg Sabino Mullane , "pgsql-hackers@lists.postgresql.org" Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Apr 12, 2022 at 4:58 PM Tom Lane wrote: > It's reasonable to allow changing *most* GUCs in _PG_init(); let us > please not break cases that work fine today. > > It seems after a bit of reflection that what we ought to do is identify > the subset of PGC_POSTMASTER GUCs that feed into shared memory sizing, > mark those with a new GUC flag, and not allow them to be changed after > shared memory is set up. (An alternative to a new flag bit is to > subdivide the PGC_POSTMASTER context into two values, but that seems > like it'd be far more invasive. A flag bit needn't be user-visible.) > Then, what we'd need to do is arrange for shared-preload modules to > receive their _PG_init call before shared memory creation (when they > can still twiddle such GUCs) and then another callback later. I dunno, I feel like this is over-engineered. An extra hook wouldn't really affect anyone who doesn't need to use it, and I doubt that adapting to it would create much pain for anyone who is knowledgeable enough to be writing these kinds of extensions in the first place. This design is something everyone who adds a GUC from now until the end of the project needs to know about for the benefit of a tiny number of extension authors who weren't really going to have a big problem anyway. -- Robert Haas EDB: http://www.enterprisedb.com