Commit 84f6fb81 authored by Alvaro Herrera's avatar Alvaro Herrera

Fix IsUnderPostmaster/EXEC_BACKEND confusion

parent 15658911
......@@ -359,6 +359,10 @@ AuxiliaryProcessMain(int argc, char *argv[])
SetProcessingMode(BootstrapProcessing);
IgnoreSystemIndexes = true;
/* Initialize MaxBackends (if under postmaster, was done already) */
if (!IsUnderPostmaster)
InitializeMaxBackends();
BaseInit();
/*
......
......@@ -3654,10 +3654,8 @@ PostgresMain(int argc, char *argv[], const char *username)
*/
CreateDataDirLockFile(false);
/* In EXEC_BACKEND, this was set via BackendParameters */
#ifndef EXEC_BACKEND
/* Initialize MaxBackends (if under postmaster, was done already) */
InitializeMaxBackends();
#endif
}
/* 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
* workers in shared_preload_libraries, and before shared memory size is
* 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
InitializeMaxBackends(void)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment