summaryrefslogtreecommitdiff
path: root/src/backend/storage/ipc/sinvaladt.c
diff options
context:
space:
mode:
authorTom Lane2001-06-16 22:58:17 +0000
committerTom Lane2001-06-16 22:58:17 +0000
commit2917f0a5dd041295bd7e19f6bf868827640d44b0 (patch)
tree64cb1e90420a629884642c6df9df7e22cbc87a5d /src/backend/storage/ipc/sinvaladt.c
parent668db147d5d20291a67749ee0102d70b81a108e7 (diff)
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.
Diffstat (limited to 'src/backend/storage/ipc/sinvaladt.c')
-rw-r--r--src/backend/storage/ipc/sinvaladt.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/backend/storage/ipc/sinvaladt.c b/src/backend/storage/ipc/sinvaladt.c
index 06ba354d94a..63bc037bc9a 100644
--- a/src/backend/storage/ipc/sinvaladt.c
+++ b/src/backend/storage/ipc/sinvaladt.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/ipc/sinvaladt.c,v 1.38 2001/03/22 03:59:45 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/ipc/sinvaladt.c,v 1.39 2001/06/16 22:58:15 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -79,6 +79,11 @@ SIBufferInit(int maxBackends)
* SIBackendInit
* Initialize a new backend to operate on the sinval buffer
*
+ * Returns:
+ * >0 A-OK
+ * 0 Failed to find a free procState slot (ie, MaxBackends exceeded)
+ * <0 Some other failure (not currently used)
+ *
* NB: this routine, and all following ones, must be executed with the
* SInvalLock spinlock held, since there may be multiple backends trying
* to access the buffer.
@@ -109,12 +114,7 @@ SIBackendInit(SISeg *segP)
}
else
{
-
- /*
- * elog() with spinlock held is probably not too cool, but
- * this condition should never happen anyway.
- */
- elog(NOTICE, "SIBackendInit: no free procState slot available");
+ /* out of procState slots */
MyBackendId = InvalidBackendId;
return 0;
}