Re: make MaxBackends available in _PG_init

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Nathan Bossart <nathandbossart@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>, Julien Rouhaud <rjuju123@gmail.com>, Andres Freund <andres@anarazel.de>, "Bossart, Nathan" <bossartn@amazon.com>, Fujii Masao <masao.fujii@oss.nttdata.com>, "wangsh.fnst@fujitsu.com" <wangsh.fnst@fujitsu.com>, Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>, Greg Sabino Mullane <htamfids@gmail.com>, "pgsql-hackers@lists.postgresql.org" <pgsql-hackers@lists.postgresql.org>
Date: 2022-05-10T08:55:12Z
Lists: pgsql-hackers
On Fri, May 06, 2022 at 07:51:43PM -0400, Robert Haas wrote:
> On Fri, May 6, 2022 at 5:15 PM Nathan Bossart <nathandbossart@gmail.com> wrote:
>> On Fri, May 06, 2022 at 08:27:11AM -0700, Nathan Bossart wrote:
>> > +1, I'll put together a new patch set.
>>
>> As promised...
> 
> Looks reasonable to me.

0001 looks sensible seen from here with this approach.

> Anyone else have thoughts?

I agree that removing support for the unloading part would be nice to
clean up now on HEAD.  Note that 0002 is missing the removal of one
reference to _PG_fini in xfunc.sgml (<primary> markup).
--
Michael

Commits

  1. Add a new shmem_request_hook hook.

  2. Remove non-functional code for unloading loadable modules.

  3. Fix misleading comments about background worker registration.

  4. Revert the addition of GetMaxBackends() and related stuff.

  5. Fix typo in multixact.c

  6. Reduce more the number of calls to GetMaxBackends()

  7. Remove MaxBackends variable in favor of GetMaxBackends() function.

  8. Fix comments about bgworker registration before MaxBackends initialization

  9. Fix bogus assertion in BootstrapModeMain().

  10. Make sure MaxBackends is always set