Fix background workers for EXEC_BACKEND
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Wed, 2 Jan 2013 15:01:14 +0000 (12:01 -0300)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Wed, 2 Jan 2013 15:01:14 +0000 (12:01 -0300)
commitcdbc0ca48ca96e5c787b1605ed2d6cf7407a5acf
treef8e0e768c9d68dc79de634e35d10beb8f569039d
parentd194d7a52630d855f43edbf0129e131099af6c14
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
src/backend/postmaster/postmaster.c
src/backend/utils/init/globals.c
src/backend/utils/misc/guc.c
src/include/postmaster/postmaster.h