mirror of
https://github.com/postgres/postgres.git
synced 2025-11-13 16:22:44 +03:00
Tweak startup sequence so that running out of PROC array slots is
detected sooner in backend startup, and is treated as an expected error (it gives 'Sorry, too many clients already' now). This allows us not to have to enforce the MaxBackends limit exactly in the postmaster. Also, remove ProcRemove() and fold its functionality into ProcKill(). There's no good reason for a backend not to be responsible for removing its PROC entry, and there are lots of good reasons for the postmaster not to be touching shared-memory data structures.
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/sinval.c,v 1.32 2001/06/01 20:07:16 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/sinval.c,v 1.33 2001/06/16 22:58:13 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -43,13 +43,15 @@ CreateSharedInvalidationState(int maxBackends)
|
||||
void
|
||||
InitBackendSharedInvalidationState(void)
|
||||
{
|
||||
int flag;
|
||||
|
||||
SpinAcquire(SInvalLock);
|
||||
if (!SIBackendInit(shmInvalBuffer))
|
||||
{
|
||||
SpinRelease(SInvalLock);
|
||||
elog(FATAL, "Backend cache invalidation initialization failed");
|
||||
}
|
||||
flag = SIBackendInit(shmInvalBuffer);
|
||||
SpinRelease(SInvalLock);
|
||||
if (flag < 0) /* unexpected problem */
|
||||
elog(FATAL, "Backend cache invalidation initialization failed");
|
||||
if (flag == 0) /* expected problem: MaxBackends exceeded */
|
||||
elog(FATAL, "Sorry, too many clients already");
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user