List:Commits« Previous MessageNext Message »
From:jonas oreland Date:November 22 2011 11:14am
Subject:bzr push into mysql-5.1-telco-7.0 branch (jonas.oreland:4687 to 4688)
View as plain text  
 4688 jonas oreland	2011-11-22
      ndb - move some initialization from Qmgr::execSTART_ORD
        into Qmgr-constructor, as when moving Cmvmi to different thread
        (which might happen in a future commit), the execSTART_ORD
        races with execCONNECT_REP

    modified:
      storage/ndb/src/kernel/blocks/qmgr/QmgrInit.cpp
      storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp
 4687 jonas oreland	2011-11-22
      ndb - fix bug found by compiler warning

    modified:
      storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp
=== modified file 'storage/ndb/src/kernel/blocks/qmgr/QmgrInit.cpp'
--- a/storage/ndb/src/kernel/blocks/qmgr/QmgrInit.cpp	2011-06-30 15:59:25 +0000
+++ b/storage/ndb/src/kernel/blocks/qmgr/QmgrInit.cpp	2011-11-22 11:13:05 +0000
@@ -53,6 +53,7 @@ void Qmgr::initData()
   nodePtr.i = getOwnNodeId();
   ptrAss(nodePtr, nodeRec);
   nodePtr.p->blockRef = reference();
+  ndbrequire(getNodeInfo(getOwnNodeId()).m_type == NodeInfo::DB);
 
   c_connectedNodes.set(getOwnNodeId());
   setNodeInfo(getOwnNodeId()).m_version = NDB_VERSION;
@@ -91,9 +92,45 @@ void Qmgr::initData()
   c_allow_api_connect = 0;
   ctoStatus = Q_NOT_ACTIVE;
   clatestTransactionCheck = 0;
+
+  for (nodePtr.i = 1; nodePtr.i < MAX_NODES; nodePtr.i++)
+  {
+    ptrAss(nodePtr, nodeRec);
+    nodePtr.p->ndynamicId = 0;
+    nodePtr.p->hbOrder = 0;
+    Uint32 cnt = 0;
+    Uint32 type = getNodeInfo(nodePtr.i).m_type;
+    switch(type){
+    case NodeInfo::DB:
+      jam();
+      nodePtr.p->phase = ZINIT;
+      c_definedNodes.set(nodePtr.i);
+      break;
+    case NodeInfo::API:
+      jam();
+      nodePtr.p->phase = ZAPI_INACTIVE;
+      break;
+    case NodeInfo::MGM:
+      jam();
+      /**
+       * cmvmi allows ndb_mgmd to connect directly
+       */
+      nodePtr.p->phase = ZAPI_INACTIVE;
+      break;
+    default:
+      jam();
+      nodePtr.p->phase = ZAPI_INACTIVE;
+    }
+
+    setNodeInfo(nodePtr.i).m_heartbeat_cnt = cnt;
+    nodePtr.p->sendPrepFailReqStatus = Q_NOT_ACTIVE;
+    nodePtr.p->sendCommitFailReqStatus = Q_NOT_ACTIVE;
+    nodePtr.p->sendPresToStatus = Q_NOT_ACTIVE;
+    nodePtr.p->failState = NORMAL;
+  }//for
 }//Qmgr::initData()
 
-void Qmgr::initRecords() 
+void Qmgr::initRecords()
 {
   // Records with dynamic sizes
 }//Qmgr::initRecords()

=== modified file 'storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp'
--- a/storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp	2011-11-22 07:39:16 +0000
+++ b/storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp	2011-11-22 11:13:05 +0000
@@ -259,43 +259,6 @@ Qmgr::execSTART_ORD(Signal* signal)
   signal->theData[1] = Uint32(now >> 32);
   signal->theData[2] = Uint32(now);
   sendSignal(QMGR_REF, GSN_CONTINUEB, signal, 3, JBB);
-
-  NodeRecPtr nodePtr;
-  for (nodePtr.i = 1; nodePtr.i < MAX_NODES; nodePtr.i++) 
-  {
-    ptrAss(nodePtr, nodeRec);
-    nodePtr.p->ndynamicId = 0;	
-    nodePtr.p->hbOrder = 0;
-    Uint32 cnt = 0;
-    Uint32 type = getNodeInfo(nodePtr.i).m_type;
-    switch(type){
-    case NodeInfo::DB:
-      jam();
-      nodePtr.p->phase = ZINIT;
-      c_definedNodes.set(nodePtr.i);
-      break;
-    case NodeInfo::API:
-      jam();
-      nodePtr.p->phase = ZAPI_INACTIVE;
-      break;
-    case NodeInfo::MGM:
-      jam();
-      /**
-       * cmvmi allows ndb_mgmd to connect directly
-       */
-      nodePtr.p->phase = ZAPI_INACTIVE;
-      break;
-    default:
-      jam();
-      nodePtr.p->phase = ZAPI_INACTIVE;
-    }
-    
-    setNodeInfo(nodePtr.i).m_heartbeat_cnt = cnt;
-    nodePtr.p->sendPrepFailReqStatus = Q_NOT_ACTIVE;
-    nodePtr.p->sendCommitFailReqStatus = Q_NOT_ACTIVE;
-    nodePtr.p->sendPresToStatus = Q_NOT_ACTIVE;
-    nodePtr.p->failState = NORMAL;
-  }//for
 }
 
 /*

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.1-telco-7.0 branch (jonas.oreland:4687 to 4688) jonas oreland22 Nov