List:Commits« Previous MessageNext Message »
From:tomas Date:November 23 2007 9:25am
Subject:bk commit into 5.1 tree (tomas:1.2583) BUG#29621
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of tomas. When tomas does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2007-11-23 10:25:19+01:00, tomas@stripped +1 -0
  Bug#29621 - ndb_mgmd can timeout logevent request, making it to fail

  storage/ndb/src/mgmsrv/MgmtSrvr.cpp@stripped, 2007-11-23 10:25:16+01:00, tomas@stripped +52 -30
    Bug#29621 - ndb_mgmd can timeout logevent request, making it to fail

diff -Nrup a/storage/ndb/src/mgmsrv/MgmtSrvr.cpp b/storage/ndb/src/mgmsrv/MgmtSrvr.cpp
--- a/storage/ndb/src/mgmsrv/MgmtSrvr.cpp	2007-10-03 08:40:54 +02:00
+++ b/storage/ndb/src/mgmsrv/MgmtSrvr.cpp	2007-11-23 10:25:16 +01:00
@@ -119,7 +119,11 @@ operator<<(NdbOut& out, const LogLevel &
 void
 MgmtSrvr::logLevelThreadRun() 
 {
-  while (!_isStopThread) {
+  while (!_isStopThread) 
+  {
+    Vector<NodeId> failed_started_nodes;
+    Vector<EventSubscribeReq> failed_log_level_requests;
+
     /**
      * Handle started nodes
      */
@@ -144,14 +148,15 @@ MgmtSrvr::logLevelThreadRun() 
         m_started_nodes.unlock();
 
         if (setEventReportingLevelImpl(node, req))
-	{
-	  ndbout_c("setEventReportingLevelImpl(%d): failed", node);
-	}
-	
-        SetLogLevelOrd ord;
-        ord = m_nodeLogLevel[node];
-        setNodeLogLevelImpl(node, ord);
-
+        {
+          failed_started_nodes.push_back(node);
+        }
+        else
+        {
+          SetLogLevelOrd ord;
+          ord = m_nodeLogLevel[node];
+          setNodeLogLevelImpl(node, ord);
+        }
         m_started_nodes.lock();
       }
     }
@@ -166,17 +171,20 @@ MgmtSrvr::logLevelThreadRun() 
 
       if(req.blockRef == 0)
       {
-	req.blockRef = _ownReference;
-	if (setEventReportingLevelImpl(0, req))
-	{
-	  ndbout_c("setEventReportingLevelImpl: failed 2!");
-	}
+        req.blockRef = _ownReference;
+        if (setEventReportingLevelImpl(0, req))
+        {
+          failed_log_level_requests.push_back(req);
+        }
       } 
       else 
       {
         SetLogLevelOrd ord;
         ord = req;
-	setNodeLogLevelImpl(req.blockRef, ord);
+        if (setNodeLogLevelImpl(req.blockRef, ord))
+        {
+          failed_log_level_requests.push_back(req);
+        }
       }
       m_log_level_requests.lock();
     }      
@@ -185,7 +193,28 @@ MgmtSrvr::logLevelThreadRun() 
     if(!ERROR_INSERTED(10000))
       m_event_listner.check_listeners();
 
-    NdbSleep_MilliSleep(_logLevelThreadSleep);  
+    Uint32 sleeptime = _logLevelThreadSleep;
+    if (failed_started_nodes.size())
+    {
+      m_started_nodes.lock();
+      for (Uint32 i = 0; i<failed_started_nodes.size(); i++)
+        m_started_nodes.push_back(failed_started_nodes[i], false);
+      m_started_nodes.unlock();
+      failed_started_nodes.clear();
+      sleeptime = 100;
+    }
+
+    if (failed_log_level_requests.size())
+    {
+      m_log_level_requests.lock();
+      for (Uint32 i = 0; i<failed_log_level_requests.size(); i++)
+        m_log_level_requests.push_back(failed_log_level_requests[i], false);
+      m_log_level_requests.unlock();
+      failed_log_level_requests.clear();
+      sleeptime = 100;
+    }
+
+    NdbSleep_MilliSleep(sleeptime);
   }
 }
 
@@ -1535,7 +1564,6 @@ MgmtSrvr::setEventReportingLevelImpl(int
 {
   SignalSender ss(theFacade);
   NdbNodeBitmask nodes;
-  int retries = 30;
   nodes.clear();
   while (1)
   {
@@ -1572,18 +1600,8 @@ MgmtSrvr::setEventReportingLevelImpl(int
           continue;
         }
         // api_reg_conf not recevied yet, need to retry
-        break;
-      }
-    }
-    if (nodeId <= max)
-    {
-      if (--retries)
-      {
-        ss.unlock();
-        NdbSleep_MilliSleep(100);  
-        continue;
+        return SEND_OR_RECEIVE_FAILED;
       }
-      return SEND_OR_RECEIVE_FAILED;
     }
 
     if (nodeId_arg == 0)
@@ -1607,6 +1625,10 @@ MgmtSrvr::setEventReportingLevelImpl(int
         continue; // node is not connected, skip
       if (ss.sendSignal(nodeId, &ssig) == SEND_OK)
         nodes.set(nodeId);
+      else if (max == nodeId)
+      {
+        return SEND_OR_RECEIVE_FAILED;
+      }
     }
     break;
   }
@@ -2988,8 +3010,8 @@ int MgmtSrvr::connect_to_self(void)
   return 0;
 }
 
-
-
+template class Vector<unsigned short>;
 template class MutexVector<unsigned short>;
 template class MutexVector<Ndb_mgmd_event_service::Event_listener>;
+template class Vector<EventSubscribeReq>;
 template class MutexVector<EventSubscribeReq>;
Thread
bk commit into 5.1 tree (tomas:1.2583) BUG#29621tomas23 Nov