mirror of
https://github.com/postgres/postgres.git
synced 2025-04-24 10:47:04 +03:00
Minor improvement in SI overflow logic: try to delete
expired messages before concluding that we really have buffer overflow.
This commit is contained in:
parent
9e713ddb99
commit
8b8db01517
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/sinvaladt.c,v 1.25 1999/09/06 19:37:38 tgl Exp $
|
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/sinvaladt.c,v 1.26 1999/09/09 14:56:06 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -228,9 +228,19 @@ SIInsertDataEntry(SISeg *segP, SharedInvalidData *data)
|
|||||||
/* Is the buffer full? */
|
/* Is the buffer full? */
|
||||||
if (numMsgs >= MAXNUMMESSAGES)
|
if (numMsgs >= MAXNUMMESSAGES)
|
||||||
{
|
{
|
||||||
/* Yes, so force reset */
|
/*
|
||||||
SISetProcStateInvalid(segP);
|
* Don't panic just yet: slowest backend might have consumed some
|
||||||
return false;
|
* messages but not yet have done SIDelExpiredDataEntries() to
|
||||||
|
* advance minMsgNum. So, make sure minMsgNum is up-to-date.
|
||||||
|
*/
|
||||||
|
SIDelExpiredDataEntries(segP);
|
||||||
|
numMsgs = segP->maxMsgNum - segP->minMsgNum;
|
||||||
|
if (numMsgs >= MAXNUMMESSAGES)
|
||||||
|
{
|
||||||
|
/* Yup, it's definitely full, no choice but to reset */
|
||||||
|
SISetProcStateInvalid(segP);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user