Move elog(DEBUG4) call outside the locked area, per suggestion from Tom Lane.
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Tue, 18 Mar 2008 12:36:43 +0000 (12:36 +0000)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Tue, 18 Mar 2008 12:36:43 +0000 (12:36 +0000)
src/backend/storage/ipc/sinvaladt.c

index 0ed5927150c77dcf14672217b99b32368d0a0260..8aabe7ebc41b63647dd1de4ef9f852f3d863b1e8 100644 (file)
@@ -330,12 +330,8 @@ SIInsertDataEntry(SharedInvalidationMessage *data)
         * queries, but if a backend is sitting idle then it won't be starting
         * transactions and so won't be reading SI entries.
         */
-       if (numMsgs == (MAXNUMMESSAGES * 70 / 100) &&
-               IsUnderPostmaster)
-       {
-               elog(DEBUG4, "SI table is 70%% full, signaling postmaster");
+       if (numMsgs == (MAXNUMMESSAGES * 70 / 100) && IsUnderPostmaster)
                signal_postmaster = true;
-       }
 
        /*
         * Insert new message into proper slot of circular buffer
@@ -346,7 +342,10 @@ SIInsertDataEntry(SharedInvalidationMessage *data)
        LWLockRelease(SInvalLock);
 
        if (signal_postmaster)
+       {
+               elog(DEBUG4, "SI table is 70%% full, signaling postmaster");
                SendPostmasterSignal(PMSIGNAL_WAKEN_CHILDREN);
+       }
 
        return true;
 }