MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:jonas Date:June 21 2007 7:03am
Subject:bk commit into 5.1 tree (jonas:1.2153) BUG#28445
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of jonas. When jonas 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-06-21 09:03:01+02:00, jonas@stripped +2 -0
  ndb - bug#28445 - fix in fix
    Init datastructures in constructor
    as CONNECT_REP may occur before start phases

  storage/ndb/src/kernel/blocks/qmgr/QmgrInit.cpp@stripped, 2007-06-21 09:02:59+02:00, jonas@stripped +21 -4
    Init datastructures in constructor
    as CONNECT_REP may occur before start phases

  storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp@stripped, 2007-06-21 09:02:59+02:00, jonas@stripped +58 -62
    Init datastructures in constructor
    as CONNECT_REP may occur before start phases

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	jonas
# Host:	perch.ndb.mysql.com
# Root:	/home/jonas/src/drop5

--- 1.13/storage/ndb/src/kernel/blocks/qmgr/QmgrInit.cpp	2007-06-21 09:03:04 +02:00
+++ 1.14/storage/ndb/src/kernel/blocks/qmgr/QmgrInit.cpp	2007-06-21 09:03:04 +02:00
@@ -32,10 +32,6 @@
   cnoCommitFailedNodes = 0;
   c_maxDynamicId = 0;
   c_clusterNodes.clear();
-
-  Uint32 hbDBAPI = 500;
-  setHbApiDelay(hbDBAPI);
-  c_connectedNodes.set(getOwnNodeId());
   c_stopReq.senderRef = 0;
 
   /**
@@ -44,6 +40,27 @@
   ndbrequire((Uint32)NodeInfo::DB == 0);
   ndbrequire((Uint32)NodeInfo::API == 1);
   ndbrequire((Uint32)NodeInfo::MGM == 2); 
+
+  NodeRecPtr nodePtr;
+  nodePtr.i = getOwnNodeId();
+  ptrAss(nodePtr, nodeRec);
+  nodePtr.p->blockRef = reference();
+
+  c_connectedNodes.set(getOwnNodeId());
+  setNodeInfo(getOwnNodeId()).m_version = NDB_VERSION;
+
+
+  /**
+   * Timeouts
+   */
+  const ndb_mgm_configuration_iterator * p = 
+    theConfiguration.getOwnConfigIterator();
+  ndbrequire(p != 0);
+  
+  Uint32 hbDBAPI = 1500;
+  ndb_mgm_get_int_parameter(p, CFG_DB_API_HEARTBEAT_INTERVAL, &hbDBAPI);
+  
+  setHbApiDelay(hbDBAPI);
 }//Qmgr::initData()
 
 void Qmgr::initRecords() 

--- 1.41/storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp	2007-06-21 09:03:04 +02:00
+++ 1.42/storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp	2007-06-21 09:03:04 +02:00
@@ -246,6 +246,28 @@
    */
   signal->theData[0] = ZTIMER_HANDLING;
   sendSignal(QMGR_REF, GSN_CONTINUEB, signal, 1, JBB);
+
+  NodeRecPtr nodePtr;
+  for (nodePtr.i = 1; nodePtr.i < MAX_NODES; nodePtr.i++) 
+  {
+    ptrAss(nodePtr, nodeRec);
+    nodePtr.p->ndynamicId = 0;	
+    if(getNodeInfo(nodePtr.i).m_type == NodeInfo::DB)
+    {
+      nodePtr.p->phase = ZINIT;
+      c_definedNodes.set(nodePtr.i);
+    } else {
+      nodePtr.p->phase = ZAPI_INACTIVE;
+    }
+    
+    setNodeInfo(nodePtr.i).m_heartbeat_cnt= 0;
+    nodePtr.p->sendPrepFailReqStatus = Q_NOT_ACTIVE;
+    nodePtr.p->sendCommitFailReqStatus = Q_NOT_ACTIVE;
+    nodePtr.p->sendPresToStatus = Q_NOT_ACTIVE;
+    nodePtr.p->failState = NORMAL;
+    nodePtr.p->rcv[0] = 0;
+    nodePtr.p->rcv[1] = 0;
+  }//for
 }
 
 /*
@@ -308,8 +330,6 @@
   nodePtr.i = getOwnNodeId();
   ptrAss(nodePtr, nodeRec);
   nodePtr.p->phase = ZSTARTING;
-  nodePtr.p->blockRef = reference();
-  c_connectedNodes.set(nodePtr.i);
   
   signal->theData[0] = reference();
   sendSignal(DBDIH_REF, GSN_DIH_RESTARTREQ, signal, 1, JBB);
@@ -381,11 +401,14 @@
   case ZFAIL_CLOSING:
     jam();
     return;
-  case ZINIT:
-    ndbrequire(false);
   case ZAPI_ACTIVE:
   case ZAPI_INACTIVE:
     return;
+  case ZINIT:
+    ndbrequire(getNodeInfo(nodeId).m_type == NodeInfo::MGM);
+    break;
+  default:
+    ndbrequire(false);
   }
 
   if (getNodeInfo(nodeId).getType() != NodeInfo::DB)
@@ -2046,25 +2069,6 @@
 /*---------------------------------------------------------------------------*/
 void Qmgr::initData(Signal* signal) 
 {
-  NodeRecPtr nodePtr;
-  for (nodePtr.i = 1; nodePtr.i < MAX_NODES; nodePtr.i++) {
-    ptrAss(nodePtr, nodeRec);
-    nodePtr.p->ndynamicId = 0;	
-    if(getNodeInfo(nodePtr.i).m_type == NodeInfo::DB){
-      nodePtr.p->phase = ZINIT;
-      c_definedNodes.set(nodePtr.i);
-    } else {
-      nodePtr.p->phase = ZAPI_INACTIVE;
-    }
-
-    setNodeInfo(nodePtr.i).m_heartbeat_cnt= 0;
-    nodePtr.p->sendPrepFailReqStatus = Q_NOT_ACTIVE;
-    nodePtr.p->sendCommitFailReqStatus = Q_NOT_ACTIVE;
-    nodePtr.p->sendPresToStatus = Q_NOT_ACTIVE;
-    nodePtr.p->failState = NORMAL;
-    nodePtr.p->rcv[0] = 0;
-    nodePtr.p->rcv[1] = 0;
-  }//for
   cfailureNr = 1;
   ccommitFailureNr = 1;
   cprepareFailureNr = 1;
@@ -2098,13 +2102,11 @@
   ndbrequire(p != 0);
   
   Uint32 hbDBDB = 1500;
-  Uint32 hbDBAPI = 1500;
   Uint32 arbitTimeout = 1000;
   c_restartPartialTimeout = 30000;
   c_restartPartionedTimeout = 60000;
   c_restartFailureTimeout = ~0;
   ndb_mgm_get_int_parameter(p, CFG_DB_HEARTBEAT_INTERVAL, &hbDBDB);
-  ndb_mgm_get_int_parameter(p, CFG_DB_API_HEARTBEAT_INTERVAL, &hbDBAPI);
   ndb_mgm_get_int_parameter(p, CFG_DB_ARBIT_TIMEOUT, &arbitTimeout);
   ndb_mgm_get_int_parameter(p, CFG_DB_START_PARTIAL_TIMEOUT, 
 			    &c_restartPartialTimeout);
@@ -2129,7 +2131,6 @@
   }
 
   setHbDelay(hbDBDB);
-  setHbApiDelay(hbDBAPI);
   setArbitTimeout(arbitTimeout);
   
   arbitRec.state = ARBIT_NULL;          // start state for all nodes
@@ -2156,7 +2157,6 @@
     
     execARBIT_CFG(signal);
   }
-  setNodeInfo(getOwnNodeId()).m_version = NDB_VERSION;
 }//Qmgr::initData()
 
 
@@ -4946,43 +4946,39 @@
 	      c_start.m_president_candidate_gci);
     infoEvent("ctoStatus = %d\n", ctoStatus);
     for(Uint32 i = 1; i<MAX_NDB_NODES; i++){
-      if(getNodeInfo(i).getType() == NodeInfo::DB){
-	NodeRecPtr nodePtr;
-	nodePtr.i = i;
-	ptrCheckGuard(nodePtr, MAX_NDB_NODES, nodeRec);
-	char buf[100];
-	switch(nodePtr.p->phase){
-	case ZINIT:
-	  sprintf(buf, "Node %d: ZINIT(%d)", i, nodePtr.p->phase);
-	  break;
-	case ZSTARTING:
-	  sprintf(buf, "Node %d: ZSTARTING(%d)", i, nodePtr.p->phase);
-	  break;
-	case ZRUNNING:
-	  sprintf(buf, "Node %d: ZRUNNING(%d)", i, nodePtr.p->phase);
-	  break;
-	case ZPREPARE_FAIL:
-	  sprintf(buf, "Node %d: ZPREPARE_FAIL(%d)", i, nodePtr.p->phase);
-	  break;
-	case ZFAIL_CLOSING:
-	  sprintf(buf, "Node %d: ZFAIL_CLOSING(%d)", i, nodePtr.p->phase);
-	  break;
-	case ZAPI_INACTIVE:
-	  sprintf(buf, "Node %d: ZAPI_INACTIVE(%d)", i, nodePtr.p->phase);
-	  break;
-	case ZAPI_ACTIVE:
-	  sprintf(buf, "Node %d: ZAPI_ACTIVE(%d)", i, nodePtr.p->phase);
-	  break;
-	default:
-	  sprintf(buf, "Node %d: <UNKNOWN>(%d)", i, nodePtr.p->phase);
-	  break;
-	}
-	infoEvent(buf);
+      NodeRecPtr nodePtr;
+      nodePtr.i = i;
+      ptrCheckGuard(nodePtr, MAX_NDB_NODES, nodeRec);
+      char buf[100];
+      switch(nodePtr.p->phase){
+      case ZINIT:
+        sprintf(buf, "Node %d: ZINIT(%d)", i, nodePtr.p->phase);
+        break;
+      case ZSTARTING:
+        sprintf(buf, "Node %d: ZSTARTING(%d)", i, nodePtr.p->phase);
+        break;
+      case ZRUNNING:
+        sprintf(buf, "Node %d: ZRUNNING(%d)", i, nodePtr.p->phase);
+        break;
+      case ZPREPARE_FAIL:
+        sprintf(buf, "Node %d: ZPREPARE_FAIL(%d)", i, nodePtr.p->phase);
+        break;
+      case ZFAIL_CLOSING:
+        sprintf(buf, "Node %d: ZFAIL_CLOSING(%d)", i, nodePtr.p->phase);
+        break;
+      case ZAPI_INACTIVE:
+        sprintf(buf, "Node %d: ZAPI_INACTIVE(%d)", i, nodePtr.p->phase);
+        break;
+      case ZAPI_ACTIVE:
+        sprintf(buf, "Node %d: ZAPI_ACTIVE(%d)", i, nodePtr.p->phase);
+        break;
+      default:
+        sprintf(buf, "Node %d: <UNKNOWN>(%d)", i, nodePtr.p->phase);
+        break;
       }
+      infoEvent(buf);
     }
-  default:
-    ;
-  }//switch
+  }
 
 #ifdef ERROR_INSERT
   if (signal->theData[0] == 935 && signal->getLength() == 2)
Thread
bk commit into 5.1 tree (jonas:1.2153) BUG#28445jonas21 Jun