Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit53d7d47

Browse files
committed
From: Massimo Dal Zotto <dz@cs.unitn.it>> sinval.patch>> fixes a problem in SI cache which causes table overflow if some> backend is idle for a long time while other backends keep adding> entries.> It uses the new signal handling implemented in tprintf.patch.> I have also increacasesed the max number of backends from 32 to 64> and the table size from 1000 to 5000.> I don't know if anybody is working on SI, but until another> solution is found this patch fixes the problem. I have received> messages from other people reporting the same problem which I> fixed many months ago.
1 parent8255537 commit53d7d47

File tree

3 files changed

+23
-8
lines changed

3 files changed

+23
-8
lines changed

‎src/backend/storage/ipc/sinval.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/sinval.c,v 1.10 1998/06/15 19:29:15 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/sinval.c,v 1.11 1998/08/25 21:31:17 scrappy Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -157,8 +157,7 @@ RegisterSharedInvalid(int cacheId,/* XXX */
157157
/*should be called by a backend*/
158158
/****************************************************************************/
159159
void
160-
InvalidateSharedInvalid(void (*invalFunction) (),
161-
void (*resetFunction) ())
160+
InvalidateSharedInvalid(void (*invalFunction) (),void (*resetFunction) ())
162161
{
163162
SpinAcquire(SInvalLock);
164163
SIReadEntryData(shmInvalBuffer,MyBackendId,

‎src/backend/storage/ipc/sinvaladt.c

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/sinvaladt.c,v 1.12 1998/07/13 16:34:49 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/sinvaladt.c,v 1.13 1998/08/25 21:31:18 scrappy Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
1414
#include<stdio.h>
15+
#include<signal.h>
16+
#include<unistd.h>
1517

1618
#include"postgres.h"
1719

@@ -20,6 +22,7 @@
2022
#include"storage/sinvaladt.h"
2123
#include"storage/lmgr.h"
2224
#include"utils/palloc.h"
25+
#include"utils/trace.h"
2326

2427
/* ----------------
2528
*global variable notes
@@ -357,6 +360,19 @@ SIGetProcStateLimit(SISeg *segP, int i)
357360
staticbool
358361
SIIncNumEntries(SISeg*segP,intnum)
359362
{
363+
/*
364+
* Try to prevent table overflow. When the table is 70% full send
365+
* a SIGUSR2 to the postmaster which will send it back to all the
366+
* backends. This will be handled by Async_NotifyHandler() with a
367+
* StartTransactionCommand() which will flush unread SI entries for
368+
* each backend.dz - 27 Jan 1998
369+
*/
370+
if (segP->numEntries== (MAXNUMMESSAGES*70 /100)) {
371+
TPRINTF(TRACE_VERBOSE,
372+
"SIIncNumEntries: table is 70%% full, signaling postmaster");
373+
kill(getppid(),SIGUSR2);
374+
}
375+
360376
if ((segP->numEntries+num) <=MAXNUMMESSAGES)
361377
{
362378
segP->numEntries=segP->numEntries+num;
@@ -655,7 +671,7 @@ SIReadEntryData(SISeg *segP,
655671
else
656672
{
657673
/* backend must not read messages, its own state has to be reset */
658-
elog(NOTICE,"SIMarkEntryData: cache state reset");
674+
elog(NOTICE,"SIReadEntryData: cache state reset");
659675
resetFunction();/* XXXX call it here, parameters? */
660676

661677
/* new valid state--mark all messages "read" */

‎src/include/storage/sinvaladt.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
* Copyright (c) 1994, Regents of the University of California
88
*
9-
* $Id: sinvaladt.h,v 1.8 1998/02/26 04:43:35 momjian Exp $
9+
* $Id: sinvaladt.h,v 1.9 1998/08/25 21:31:20 scrappy Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -44,8 +44,8 @@ C----------------End shared segment -------
4444
*/
4545

4646
/* Parameters (configurable) *******************************************/
47-
#defineMaxBackendId32/* maximum number of backends*/
48-
#defineMAXNUMMESSAGES1000/* maximum number of messages in seg */
47+
#defineMaxBackendId64/* maximum number of backends*/
48+
#defineMAXNUMMESSAGES4000/* maximum number of messages in seg */
4949

5050

5151
#defineInvalidOffset1000000000/* a invalid offset (End of

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp