From d54bb24cddd1fea58df76705ebfcc280cc1d1e2f Mon Sep 17 00:00:00 2001
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
Date: Tue, 18 Mar 2008 12:36:43 +0000
Subject: [PATCH] Move elog(DEBUG4) call outside the locked area, per
 suggestion from Tom Lane.

---
 src/backend/storage/ipc/sinvaladt.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/backend/storage/ipc/sinvaladt.c b/src/backend/storage/ipc/sinvaladt.c
index 485506a162d..99c5222e231 100644
--- a/src/backend/storage/ipc/sinvaladt.c
+++ b/src/backend/storage/ipc/sinvaladt.c
@@ -8,7 +8,7 @@
  *
  *
  * 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
 	 * 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;
 }
-- 
GitLab