File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change 7
7
*
8
8
*
9
9
* IDENTIFICATION
10
- * $Header: /cvsroot/pgsql/src/backend/storage/ipc/sinvaladt.c,v 1.25 1999/09/06 19:37:38 tgl Exp $
10
+ * $Header: /cvsroot/pgsql/src/backend/storage/ipc/sinvaladt.c,v 1.26 1999/09/09 14:56:06 tgl Exp $
11
11
*
12
12
*-------------------------------------------------------------------------
13
13
*/
@@ -228,9 +228,19 @@ SIInsertDataEntry(SISeg *segP, SharedInvalidData *data)
228
228
/* Is the buffer full? */
229
229
if (numMsgs >= MAXNUMMESSAGES )
230
230
{
231
- /* Yes, so force reset */
232
- SISetProcStateInvalid (segP );
233
- return false;
231
+ /*
232
+ * Don't panic just yet: slowest backend might have consumed some
233
+ * messages but not yet have done SIDelExpiredDataEntries() to
234
+ * advance minMsgNum. So, make sure minMsgNum is up-to-date.
235
+ */
236
+ SIDelExpiredDataEntries (segP );
237
+ numMsgs = segP -> maxMsgNum - segP -> minMsgNum ;
238
+ if (numMsgs >= MAXNUMMESSAGES )
239
+ {
240
+ /* Yup, it's definitely full, no choice but to reset */
241
+ SISetProcStateInvalid (segP );
242
+ return false;
243
+ }
234
244
}
235
245
236
246
/*
You can’t perform that action at this time.
0 commit comments