|
|
|
@ -421,6 +421,26 @@ pg_split_opts(char **argv, int *argcp, char *optstr) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
* Initialize MaxBackends value from config options. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* 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. |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
void |
|
|
|
|
|
|
|
InitializeMaxBackends(void) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
Assert(MaxBackends == 0); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* the extra unit accounts for the autovacuum launcher */ |
|
|
|
|
|
|
|
MaxBackends = MaxConnections + autovacuum_max_workers + 1 + |
|
|
|
|
|
|
|
GetNumShmemAttachedBgworkers(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* internal error because the values were all checked previously */ |
|
|
|
|
|
|
|
if (MaxBackends > MAX_BACKENDS) |
|
|
|
|
|
|
|
elog(ERROR, "too many backends configured"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* Early initialization of a backend (either standalone or under postmaster). |
|
|
|
* Early initialization of a backend (either standalone or under postmaster). |
|
|
|
@ -433,6 +453,8 @@ pg_split_opts(char **argv, int *argcp, char *optstr) |
|
|
|
void |
|
|
|
void |
|
|
|
BaseInit(void) |
|
|
|
BaseInit(void) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
InitializeMaxBackends(); |
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* Attach to shared memory and semaphores, and initialize our |
|
|
|
* Attach to shared memory and semaphores, and initialize our |
|
|
|
* input/output/debugging file descriptors. |
|
|
|
* input/output/debugging file descriptors. |
|
|
|
|