List:Commits« Previous MessageNext Message »
From:Jonas Oreland Date:November 21 2011 8:03am
Subject:bzr push into mysql-5.1-telco-7.0-trpman branch (jonas.oreland:4679 to 4680)
View as plain text  
 4680 Jonas Oreland	2011-11-21
      ndb - 70-trpman - this time I think I got it...i debugged on n3 last-night

    modified:
      storage/ndb/src/kernel/blocks/qmgr/QmgrInit.cpp
      storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp
      storage/ndb/src/kernel/blocks/trpman.cpp
      storage/ndb/src/kernel/blocks/trpman.hpp
      storage/ndb/src/kernel/vm/TransporterCallback.cpp
      storage/ndb/src/kernel/vm/mt.cpp
 4679 jonas oreland	2011-11-18
      ndb - trial and terror...

    modified:
      storage/ndb/src/kernel/vm/SimulatedBlock.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-21 08:02: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-18 09:20:34 +0000
+++ b/storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp	2011-11-21 08:02: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
 }
 
 /*

=== modified file 'storage/ndb/src/kernel/blocks/trpman.cpp'
--- a/storage/ndb/src/kernel/blocks/trpman.cpp	2011-11-17 11:58:33 +0000
+++ b/storage/ndb/src/kernel/blocks/trpman.cpp	2011-11-21 08:02:05 +0000
@@ -571,8 +571,6 @@ TrpmanProxy::TrpmanProxy(Block_context &
   addRecSignal(GSN_CLOSE_COMREQ, &TrpmanProxy::execCLOSE_COMREQ);
   addRecSignal(GSN_OPEN_COMREQ, &TrpmanProxy::execOPEN_COMREQ);
   addRecSignal(GSN_ENABLE_COMREQ, &TrpmanProxy::execENABLE_COMREQ);
-  addRecSignal(GSN_DISCONNECT_REP, &TrpmanProxy::execDISCONNECT_REP);
-  addRecSignal(GSN_CONNECT_REP, &TrpmanProxy::execCONNECT_REP);
   addRecSignal(GSN_ROUTE_ORD, &TrpmanProxy::execROUTE_ORD);
 }
 
@@ -603,15 +601,6 @@ TrpmanProxy::execOPEN_COMREQ(Signal* sig
 }
 
 void
-TrpmanProxy::execCONNECT_REP(Signal *signal)
-{
-  jamEntry();
-  SectionHandle handle(this, signal);
-  sendSignal(workerRef(0), GSN_CONNECT_REP, signal,
-             signal->getLength(), JBB, &handle);
-}
-
-void
 TrpmanProxy::execCLOSE_COMREQ(Signal* signal)
 {
   jamEntry();
@@ -629,15 +618,6 @@ TrpmanProxy::execENABLE_COMREQ(Signal* s
              signal->getLength(), JBB, &handle);
 }
 
-void
-TrpmanProxy::execDISCONNECT_REP(Signal *signal)
-{
-  jamEntry();
-  SectionHandle handle(this, signal);
-  sendSignal(workerRef(0), GSN_DISCONNECT_REP, signal,
-             signal->getLength(), JBB, &handle);
-}
-
 void
 TrpmanProxy::execROUTE_ORD(Signal* signal)
 {

=== modified file 'storage/ndb/src/kernel/blocks/trpman.hpp'
--- a/storage/ndb/src/kernel/blocks/trpman.hpp	2011-11-16 15:38:25 +0000
+++ b/storage/ndb/src/kernel/blocks/trpman.hpp	2011-11-21 08:02:05 +0000
@@ -54,8 +54,6 @@ public:
   void execCLOSE_COMREQ(Signal *signal);
   void execOPEN_COMREQ(Signal *signal);
   void execENABLE_COMREQ(Signal *signal);
-  void execDISCONNECT_REP(Signal *signal);
-  void execCONNECT_REP(Signal *signal);
   void execROUTE_ORD(Signal* signal);
 
   void execNDB_TAMPER(Signal*);

=== modified file 'storage/ndb/src/kernel/vm/TransporterCallback.cpp'
--- a/storage/ndb/src/kernel/vm/TransporterCallback.cpp	2011-11-18 09:20:34 +0000
+++ b/storage/ndb/src/kernel/vm/TransporterCallback.cpp	2011-11-21 08:02:05 +0000
@@ -371,10 +371,11 @@ TransporterCallbackKernel::reportConnect
   SignalT<1> signal;
   memset(&signal.header, 0, sizeof(signal.header));
 
-  signal.header.theLength = 1; 
+  Uint32 trpman_instance = 1;
+  signal.header.theLength = 1;
   signal.header.theSendersSignalId = 0;
   signal.header.theSendersBlockRef = numberToRef(0, globalData.ownId);
-  signal.header.theReceiversBlockNumber = TRPMAN;
+  signal.header.theReceiversBlockNumber = numberToBlock(TRPMAN,trpman_instance);
   signal.header.theVerId_signalNumber = GSN_CONNECT_REP;
 
   signal.theData[0] = nodeId;
@@ -400,12 +401,13 @@ TransporterCallbackKernel::reportDisconn
   SignalT<sizeof(DisconnectRep)/4> signal;
   memset(&signal.header, 0, sizeof(signal.header));
 
-  signal.header.theLength = DisconnectRep::SignalLength; 
+  Uint32 trpman_instance = 1;
+  signal.header.theLength = DisconnectRep::SignalLength;
   signal.header.theSendersSignalId = 0;
   signal.header.theSendersBlockRef = numberToRef(0, globalData.ownId);
   signal.header.theTrace = TestOrd::TraceDisconnect;
   signal.header.theVerId_signalNumber = GSN_DISCONNECT_REP;
-  signal.header.theReceiversBlockNumber = TRPMAN;
+  signal.header.theReceiversBlockNumber = numberToBlock(TRPMAN,trpman_instance);
 
   DisconnectRep * rep = CAST_PTR(DisconnectRep, &signal.theData[0]);
   rep->nodeId = nodeId;

=== modified file 'storage/ndb/src/kernel/vm/mt.cpp'
--- a/storage/ndb/src/kernel/vm/mt.cpp	2011-11-17 11:58:33 +0000
+++ b/storage/ndb/src/kernel/vm/mt.cpp	2011-11-21 08:02:05 +0000
@@ -2603,7 +2603,7 @@ mt_init_thr_map()
   /* Keep mt-classic assignments in MT LQH. */
   const Uint32 thr_GLOBAL = 0;
   const Uint32 thr_LOCAL = 1;
-  const Uint32 thr_RECEIVER = receiver_thread_no;
+  //const Uint32 thr_RECEIVER = receiver_thread_no;
 
   add_thr_map(BACKUP, 0, thr_LOCAL);
   add_thr_map(DBTC, 0, thr_GLOBAL);
@@ -2615,7 +2615,7 @@ mt_init_thr_map()
   add_thr_map(NDBCNTR, 0, thr_GLOBAL);
   add_thr_map(QMGR, 0, thr_GLOBAL);
   add_thr_map(NDBFS, 0, thr_GLOBAL);
-  add_thr_map(CMVMI, 0, thr_RECEIVER);
+  add_thr_map(CMVMI, 0, thr_GLOBAL);
   add_thr_map(TRIX, 0, thr_GLOBAL);
   add_thr_map(DBUTIL, 0, thr_GLOBAL);
   add_thr_map(SUMA, 0, thr_LOCAL);
@@ -2649,10 +2649,10 @@ mt_get_instance_count(Uint32 block)
   case DBSPJ:
     return globalData.ndbMtTcThreads;
     break;
-  case THRMAN:
-    return num_threads;
   case TRPMAN:
     return 1;
+  case THRMAN:
+    return num_threads;
   default:
     require(false);
   }
@@ -2821,14 +2821,9 @@ Uint32 receiverThreadId;
  * As part of the receive loop, we also periodically call update_connections()
  * (this way we are similar to single-threaded ndbd).
  *
- * The CMVMI block (and no other blocks) run in the same thread as this
+ * The TRPMAN block (and no other blocks) run in the same thread as this
  * receive loop; this way we avoid races between update_connections() and
- * CMVMI calls into the transporters.
- *
- * Note that with this setup, local signals to CMVMI cannot wake up the thread
- * if it is sleeping on the receive sockets. Thus CMVMI local signal processing
- * can be (slightly) delayed, however CMVMI is not really performance critical
- * (hopefully).
+ * TRPMAN calls into the transporters.
  */
 extern "C"
 void *

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.1-telco-7.0-trpman branch (jonas.oreland:4679 to 4680)Jonas Oreland21 Nov