1
0
mirror of https://github.com/postgres/postgres.git synced 2025-10-25 13:17:41 +03:00

Fix background workers for EXEC_BACKEND

Commit da07a1e8 was broken for EXEC_BACKEND because I failed to realize
that the MaxBackends recomputation needed to be duplicated by
subprocesses in SubPostmasterMain.  However, instead of having the value
be recomputed at all, it's better to assign the correct value at
postmaster initialization time, and have it be propagated to exec'ed
backends via BackendParameters.

MaxBackends stays as zero until after modules in
shared_preload_libraries have had a chance to register bgworkers, since
the value is going to be untrustworthy till that's finished.

Heikki Linnakangas and Álvaro Herrera
This commit is contained in:
Alvaro Herrera
2013-01-02 12:01:14 -03:00
parent d194d7a526
commit cdbc0ca48c
4 changed files with 52 additions and 40 deletions

View File

@@ -103,13 +103,14 @@ int work_mem = 1024;
int maintenance_work_mem = 16384;
/*
* Primary determinants of sizes of shared-memory structures. MaxBackends is
* MaxConnections + autovacuum_max_workers + 1 (it is computed by the GUC
* assign hooks for those variables):
* Primary determinants of sizes of shared-memory structures.
*
* MaxBackends is computed by PostmasterMain after modules have had a chance to
* register background workers.
*/
int NBuffers = 1000;
int MaxBackends = 100;
int MaxConnections = 90;
int MaxBackends = 0;
int VacuumCostPageHit = 1; /* GUC parameters for vacuum */
int VacuumCostPageMiss = 10;