Fix IsUnderPostmaster/EXEC_BACKEND confusion

pull/3/head
Alvaro Herrera 13 years ago
parent 15658911d9
commit 84f6fb81b8
  1. 4
      src/backend/bootstrap/bootstrap.c
  2. 4
      src/backend/tcop/postgres.c
  3. 5
      src/backend/utils/init/postinit.c

@ -359,6 +359,10 @@ AuxiliaryProcessMain(int argc, char *argv[])
SetProcessingMode(BootstrapProcessing); SetProcessingMode(BootstrapProcessing);
IgnoreSystemIndexes = true; IgnoreSystemIndexes = true;
/* Initialize MaxBackends (if under postmaster, was done already) */
if (!IsUnderPostmaster)
InitializeMaxBackends();
BaseInit(); BaseInit();
/* /*

@ -3654,10 +3654,8 @@ PostgresMain(int argc, char *argv[], const char *username)
*/ */
CreateDataDirLockFile(false); CreateDataDirLockFile(false);
/* In EXEC_BACKEND, this was set via BackendParameters */ /* Initialize MaxBackends (if under postmaster, was done already) */
#ifndef EXEC_BACKEND
InitializeMaxBackends(); InitializeMaxBackends();
#endif
} }
/* Early initialization */ /* Early initialization */

@ -427,6 +427,11 @@ pg_split_opts(char **argv, int *argcp, char *optstr)
* This must be called after modules have had the chance to register background * This must be called after modules have had the chance to register background
* workers in shared_preload_libraries, and before shared memory size is * workers in shared_preload_libraries, and before shared memory size is
* determined. * determined.
*
* Note that in EXEC_BACKEND environment, the value is passed down from
* postmaster to subprocesses via BackendParameters in SubPostmasterMain; only
* postmaster itself and processes not under postmaster control should call
* this.
*/ */
void void
InitializeMaxBackends(void) InitializeMaxBackends(void)

Loading…
Cancel
Save