diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2002-11-21 06:36:08 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2002-11-21 06:36:08 +0000 |
commit | 8362be35e82574801113a7fe4dfdc3037010fc04 (patch) | |
tree | b5603e45b2956d5dc8b52f9adf2c02f9d42494ed /src/backend/postmaster/postmaster.c | |
parent | 02d83d7565bfa306f876c3fecc89a159e28e0e3b (diff) |
Code review for superuser_reserved_connections patch. Don't try to do
database access outside a transaction; revert bogus performance improvement
in SIBackendInit(); improve comments; add documentation (this part courtesy
Neil Conway).
Diffstat (limited to 'src/backend/postmaster/postmaster.c')
-rw-r--r-- | src/backend/postmaster/postmaster.c | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c index 187f0191c94..8f34a3fd2dc 100644 --- a/src/backend/postmaster/postmaster.c +++ b/src/backend/postmaster/postmaster.c @@ -37,7 +37,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.298 2002/11/18 00:40:46 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.299 2002/11/21 06:36:08 tgl Exp $ * * NOTES * @@ -154,12 +154,11 @@ int MaxBackends = DEF_MAXBACKENDS; /* * ReservedBackends is the number of backends reserved for superuser use. * This number is taken out of the pool size given by MaxBackends so - * number of backend slots available to none super users is - * (MaxBackends - ReservedBackends). Note, existing super user - * connections are not taken into account once this lower limit has - * been reached, i.e. superuser connections made before the lower limit - * is reached always count towards that limit and are not taken from - * ReservedBackends. + * number of backend slots available to non-superusers is + * (MaxBackends - ReservedBackends). Note what this really means is + * "if there are <= ReservedBackends connections available, only superusers + * can make new connections" --- pre-existing superuser connections don't + * count against the limit. */ int ReservedBackends = 2; @@ -568,7 +567,15 @@ PostmasterMain(int argc, char *argv[]) } /* - * Check for invalid combinations of switches + * Now we can set the data directory, and then read postgresql.conf. + */ + checkDataDir(potential_DataDir); /* issues error messages */ + SetDataDir(potential_DataDir); + + ProcessConfigFile(PGC_POSTMASTER); + + /* + * Check for invalid combinations of GUC settings. */ if (NBuffers < 2 * MaxBackends || NBuffers < 16) { @@ -581,16 +588,11 @@ PostmasterMain(int argc, char *argv[]) ExitPostmaster(1); } - checkDataDir(potential_DataDir); /* issues error messages */ - SetDataDir(potential_DataDir); - - ProcessConfigFile(PGC_POSTMASTER); - - /* - * Force an exit if ReservedBackends is not less than MaxBackends. - */ if (ReservedBackends >= MaxBackends) - elog(FATAL, "superuser_reserved_connections must be less than max_connections."); + { + postmaster_error("superuser_reserved_connections must be less than max_connections."); + ExitPostmaster(1); + } /* * Now that we are done processing the postmaster arguments, reset |