aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/init/globals.c
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2013-01-02 12:01:14 -0300
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2013-01-02 12:01:14 -0300
commitcdbc0ca48ca96e5c787b1605ed2d6cf7407a5acf (patch)
treef8e0e768c9d68dc79de634e35d10beb8f569039d /src/backend/utils/init/globals.c
parentd194d7a52630d855f43edbf0129e131099af6c14 (diff)
downloadpostgresql-cdbc0ca48ca96e5c787b1605ed2d6cf7407a5acf.tar.gz
postgresql-cdbc0ca48ca96e5c787b1605ed2d6cf7407a5acf.zip
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
Diffstat (limited to 'src/backend/utils/init/globals.c')
-rw-r--r--src/backend/utils/init/globals.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/backend/utils/init/globals.c b/src/backend/utils/init/globals.c
index 00288530c07..f1f8b177f35 100644
--- a/src/backend/utils/init/globals.c
+++ b/src/backend/utils/init/globals.c
@@ -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;