Move elog(DEBUG4) call outside the locked area, per suggestion from Tom Lane.

This commit is contained in:
Alvaro Herrera 2008-03-18 12:36:43 +00:00
parent 7e2be4e513
commit d54bb24cdd
1 changed files with 5 additions and 6 deletions

View File

@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/storage/ipc/sinvaladt.c,v 1.68 2008/03/17 11:50:27 alvherre Exp $ * $PostgreSQL: pgsql/src/backend/storage/ipc/sinvaladt.c,v 1.69 2008/03/18 12:36:43 alvherre Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -330,12 +330,8 @@ SIInsertDataEntry(SharedInvalidationMessage *data)
* queries, but if a backend is sitting idle then it won't be starting * queries, but if a backend is sitting idle then it won't be starting
* transactions and so won't be reading SI entries. * transactions and so won't be reading SI entries.
*/ */
if (numMsgs == (MAXNUMMESSAGES * 70 / 100) && if (numMsgs == (MAXNUMMESSAGES * 70 / 100) && IsUnderPostmaster)
IsUnderPostmaster)
{
elog(DEBUG4, "SI table is 70%% full, signaling postmaster");
signal_postmaster = true; signal_postmaster = true;
}
/* /*
* Insert new message into proper slot of circular buffer * Insert new message into proper slot of circular buffer
@ -346,7 +342,10 @@ SIInsertDataEntry(SharedInvalidationMessage *data)
LWLockRelease(SInvalLock); LWLockRelease(SInvalLock);
if (signal_postmaster) if (signal_postmaster)
{
elog(DEBUG4, "SI table is 70%% full, signaling postmaster");
SendPostmasterSignal(PMSIGNAL_WAKEN_CHILDREN); SendPostmasterSignal(PMSIGNAL_WAKEN_CHILDREN);
}
return true; return true;
} }