pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Nathan Bossart <nathandbossart@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: Julien Rouhaud <rjuju123@gmail.com>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: Bossart, Nathan <bossartn@amazon.com>
Cc: Fujii Masao <masao.fujii@oss.nttdata.com>
Cc: wangsh.fnst@fujitsu.com <wangsh.fnst@fujitsu.com>
Cc: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Cc: Greg Sabino Mullane <htamfids@gmail.com>
Cc: pgsql-hackers@lists.postgresql.org <pgsql-hackers@lists.postgresql.org>
Subject: Re: make MaxBackends available in _PG_init
Date: Tue, 12 Apr 2022 14:07:45 -0700
Message-ID: <20220412210745.GB2065815@nathanxps13> (raw)
In-Reply-To: <918045.1649797122@sss.pgh.pa.us>
References: <CA+TgmoZVQznhWpUr-bjC9U=Won8ZnfozSkiXrW2HU80r6QyASQ@mail.gmail.com>
	<20220411204442.GA2004824@nathanxps13>
	<20220411211435.GA2057981@nathanxps13>
	<20220412174427.sngj2uexzsttazs2@alap3.anarazel.de>
	<20220412180306.GA2063516@nathanxps13>
	<CA+TgmoY4og1VADa78VySwsTjtTQbtXbnRPSq9x=e6ogS_wWfaw@mail.gmail.com>
	<908945.1649791317@sss.pgh.pa.us>
	<CA+TgmoZM7=VoAey4rf+sZEKFpGDWhqEqk_MHoBPXkYbAONGcyQ@mail.gmail.com>
	<20220412195908.GA2064996@nathanxps13>
	<918045.1649797122@sss.pgh.pa.us>

On Tue, Apr 12, 2022 at 04:58:42PM -0400, Tom Lane wrote:
> Nathan Bossart <nathandbossart@gmail.com> writes:
>> I think it'd be reasonable to allow changing custom GUCs in _PG_init().
>> Those aren't going to impact things like MaxBackends.
> 
> It's reasonable to allow changing *most* GUCs in _PG_init(); let us
> please not break cases that work fine today.

Right, this is a fair point.

> 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.

If we allow changing GUCs in _PG_init() and provide another hook where
MaxBackends will be initialized, do we need to introduce another GUC flag,
or can we get away with just blocking all GUC changes when the new hook is
called?  I'm slightly hesitant to add a GUC flag that will need to manually
maintained.  Wouldn't it be easily forgotten?

-- 
Nathan Bossart
Amazon Web Services: https://aws.amazon.com





view thread (132+ messages)  latest in thread

Message-ID: <20220412210745.GB2065815@nathanxps13>
Permalink:  ../20220412210745.GB2065815@nathanxps13/
Also on:    postgresql.org/message-id/20220412210745.GB2065815@nathanxps13

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: nathandbossart@gmail.com, tgl@sss.pgh.pa.us, robertmhaas@gmail.com, andres@anarazel.de, rjuju123@gmail.com, michael@paquier.xyz, bossartn@amazon.com, masao.fujii@oss.nttdata.com, wangsh.fnst@fujitsu.com, bharath.rupireddyforpostgres@gmail.com, htamfids@gmail.com
  Subject: Re: make MaxBackends available in _PG_init
  In-Reply-To: <20220412210745.GB2065815@nathanxps13>
  References: <CA+TgmoZVQznhWpUr-bjC9U=Won8ZnfozSkiXrW2HU80r6QyASQ@mail.gmail.com> <20220411204442.GA2004824@nathanxps13> <20220411211435.GA2057981@nathanxps13> <20220412174427.sngj2uexzsttazs2@alap3.anarazel.de> <20220412180306.GA2063516@nathanxps13> <CA+TgmoY4og1VADa78VySwsTjtTQbtXbnRPSq9x=e6ogS_wWfaw@mail.gmail.com> <908945.1649791317@sss.pgh.pa.us> <CA+TgmoZM7=VoAey4rf+sZEKFpGDWhqEqk_MHoBPXkYbAONGcyQ@mail.gmail.com> <20220412195908.GA2064996@nathanxps13> <918045.1649797122@sss.pgh.pa.us> <20220412210745.GB2065815@nathanxps13>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox