List:Commits« Previous MessageNext Message »
From:David Li Date:September 20 2006 4:25am
Subject:bk commit into 5.1 tree (dli:1.2292)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of dli. When dli 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, 2006-09-20 10:25:31+08:00, dli@stripped +5 -0
  Merge dev3-76.dev.cn.tlan:/home/dli/mysql/mysql-5.0/mysql-5.0-bug-20395
  into  dev3-76.dev.cn.tlan:/home/dli/mysql/mysql-5.1/mysql-5.1-bug-20395
  MERGE: 1.1810.2028.1

  storage/ndb/include/kernel/signaldata/CmRegSignalData.hpp@stripped, 2006-09-20
10:06:43+08:00, dli@stripped +0 -0
    Auto merged
    MERGE: 1.1.2.2

  storage/ndb/include/kernel/signaldata/CmRegSignalData.hpp@stripped, 2006-09-20
10:06:43+08:00, dli@stripped +0 -0
    Merge rename: ndb/include/kernel/signaldata/CmRegSignalData.hpp ->
storage/ndb/include/kernel/signaldata/CmRegSignalData.hpp

  storage/ndb/include/mgmapi/ndbd_exit_codes.h@stripped, 2006-09-20 10:25:29+08:00,
dli@stripped +1 -1
    merge for bug#20395.
    MERGE: 1.2.4.2

  storage/ndb/include/mgmapi/ndbd_exit_codes.h@stripped, 2006-09-20 10:06:43+08:00,
dli@stripped +0 -0
    Merge rename: ndb/include/mgmapi/ndbd_exit_codes.h ->
storage/ndb/include/mgmapi/ndbd_exit_codes.h

  storage/ndb/include/ndb_version.h.in@stripped, 2006-09-20 10:06:43+08:00,
dli@stripped +0 -0
    Auto merged
    MERGE: 1.1.6.2

  storage/ndb/include/ndb_version.h.in@stripped, 2006-09-20 10:06:43+08:00,
dli@stripped +0 -0
    Merge rename: ndb/include/ndb_version.h.in -> storage/ndb/include/ndb_version.h.in

  storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp@stripped, 2006-09-20 10:06:43+08:00,
dli@stripped +0 -0
    Auto merged
    MERGE: 1.13.21.2

  storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp@stripped, 2006-09-20 10:06:43+08:00,
dli@stripped +0 -0
    Merge rename: ndb/src/kernel/blocks/qmgr/QmgrMain.cpp ->
storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp

  storage/ndb/src/kernel/error/ndbd_exit_codes.c@stripped, 2006-09-20 10:06:43+08:00,
dli@stripped +0 -0
    Auto merged
    MERGE: 1.1.6.2

  storage/ndb/src/kernel/error/ndbd_exit_codes.c@stripped, 2006-09-20 10:06:43+08:00,
dli@stripped +0 -0
    Merge rename: ndb/src/kernel/error/ndbd_exit_codes.c ->
storage/ndb/src/kernel/error/ndbd_exit_codes.c

# 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:	dli
# Host:	dev3-76.dev.cn.tlan
# Root:	/home/dli/mysql/mysql-5.1/mysql-5.1-bug-20395/RESYNC

--- 1.1.6.1/ndb/include/ndb_version.h.in	2006-09-20 10:25:38 +08:00
+++ 1.10/storage/ndb/include/ndb_version.h.in	2006-09-20 10:25:38 +08:00
@@ -57,10 +57,15 @@
  */
 /*#define NDB_VERSION_ID 0*/
 
+/**
+ * From which version do we support rowid
+ */ 
+#define NDBD_ROWID_VERSION (MAKE_VERSION(5,1,6))
 #define NDBD_INCL_NODECONF_VERSION_4 MAKE_VERSION(4,1,17)
 #define NDBD_INCL_NODECONF_VERSION_5 MAKE_VERSION(5,0,18)
-
+#define NDBD_FRAGID_VERSION (MAKE_VERSION(5,1,6))
 #define NDBD_DICT_LOCK_VERSION_5 MAKE_VERSION(5,0,23)
+#define NDBD_DICT_LOCK_VERSION_5_1 MAKE_VERSION(5,1,12)
 
 #define NDBD_QMGR_SINGLEUSER_VERSION_5 MAKE_VERSION(5,0,25)
 #endif

--- 1.13.21.1/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp	2006-09-20 10:25:38 +08:00
+++ 1.40/storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp	2006-09-20 10:25:38 +08:00
@@ -229,7 +229,7 @@
   Uint32 senderData = req->senderData;
 
   const ndb_mgm_configuration_iterator * p = 
-    theConfiguration.getOwnConfigIterator();
+    m_ctx.m_config.getOwnConfigIterator();
   ndbrequire(p != 0);
 
   ReadConfigConf * conf = (ReadConfigConf*)signal->getDataPtrSend();
@@ -863,7 +863,7 @@
   ptrCheckGuard(myNodePtr, MAX_NDB_NODES, nodeRec);
   
   ndbrequire(c_start.m_gsn == GSN_CM_REGREQ);
-  ndbrequire(myNodePtr.p->phase = ZSTARTING);
+  ndbrequire(myNodePtr.p->phase == ZSTARTING);
   
   cpdistref    = cmRegConf->presidentBlockRef;
   cpresident   = cmRegConf->presidentNodeId;
@@ -2054,7 +2054,7 @@
    * Timeouts
    */
   const ndb_mgm_configuration_iterator * p = 
-    theConfiguration.getOwnConfigIterator();
+    m_ctx.m_config.getOwnConfigIterator();
   ndbrequire(p != 0);
   
   Uint32 hbDBDB = 1500;
@@ -2103,7 +2103,7 @@
     sd->ticket.clear();
     sd->mask.clear();
     ndb_mgm_configuration_iterator * iter =
-      theConfiguration.getClusterConfigIterator();
+      m_ctx.m_config.getClusterConfigIterator();
     for (ndb_mgm_first(iter); ndb_mgm_valid(iter); ndb_mgm_next(iter)) {
       Uint32 tmp = 0;
       if (ndb_mgm_get_int_parameter(iter, CFG_NODE_ARBIT_RANK, &tmp) == 0 && 
@@ -2387,8 +2387,11 @@
   ndbrequire(failedNodePtr.p->failState == NORMAL);
   
   failedNodePtr.p->failState = WAITING_FOR_FAILCONF1;
+  NodeReceiverGroup rg(QMGR, c_clusterNodes);
+  sendSignal(rg, GSN_API_FAILREQ, signal, 2, JBA);
   sendSignal(DBTC_REF, GSN_API_FAILREQ, signal, 2, JBA);
   sendSignal(DBDICT_REF, GSN_API_FAILREQ, signal, 2, JBA);
+  sendSignal(SUMA_REF, GSN_API_FAILREQ, signal, 2, JBA);
 
   /**-------------------------------------------------------------------------
    * THE OTHER NODE WAS AN API NODE. THE COMMUNICATION LINK IS ALREADY 
@@ -2409,6 +2412,27 @@
 	     CloseComReqConf::SignalLength, JBA);
 }//Qmgr::sendApiFailReq()
 
+void Qmgr::execAPI_FAILREQ(Signal* signal)
+{
+  jamEntry();
+  NodeRecPtr failedNodePtr;
+  failedNodePtr.i = signal->theData[0];
+  // signal->theData[1] == QMGR_REF
+  ptrCheckGuard(failedNodePtr, MAX_NODES, nodeRec);
+
+  ndbrequire(getNodeInfo(failedNodePtr.i).getType() != NodeInfo::DB);
+
+  // ignore if api not active
+  if (failedNodePtr.p->phase != ZAPI_ACTIVE)
+    return;
+
+  signal->theData[0] = NDB_LE_Disconnected;
+  signal->theData[1] = failedNodePtr.i;
+  sendSignal(CMVMI_REF, GSN_EVENT_REP, signal, 2, JBB);
+
+  node_failed(signal, failedNodePtr.i);
+}
+
 void Qmgr::execAPI_FAILCONF(Signal* signal) 
 {
   NodeRecPtr failedNodePtr;
@@ -2659,9 +2683,6 @@
   case NodeInfo::MGM:
     compatability_check = ndbCompatible_ndb_mgmt(NDB_VERSION, version);
     break;
-  case NodeInfo::REP:
-    //    compatability_check = ndbCompatible_ndb_api(NDB_VERSION, version);
-    //    break;
   case NodeInfo::DB:
   case NodeInfo::INVALID:
   default:
@@ -2692,7 +2713,7 @@
   apiRegConf->qmgrRef = reference();
   apiRegConf->apiHeartbeatFrequency = (chbApiDelay / 10);
   apiRegConf->version = NDB_VERSION;
-  apiRegConf->nodeState = getNodeState();
+  NodeState state= apiRegConf->nodeState = getNodeState();
   {
     NodeRecPtr nodePtr;
     nodePtr.i = getOwnNodeId();
@@ -2710,9 +2731,12 @@
 
   sendSignal(ref, GSN_API_REGCONF, signal, ApiRegConf::SignalLength, JBB);
 
-  if ((getNodeState().startLevel == NodeState::SL_STARTED ||
-       getNodeState().getSingleUserMode())
-      && apiNodePtr.p->phase == ZAPI_INACTIVE) {
+  if (apiNodePtr.p->phase == ZAPI_INACTIVE &&
+      (state.startLevel == NodeState::SL_STARTED ||
+       state.getSingleUserMode() ||
+       (state.startLevel == NodeState::SL_STARTING && 
+	state.starting.startPhase >= 100)))
+  {       
     jam();
     /**----------------------------------------------------------------------
      * THE API NODE IS REGISTERING. WE WILL ACCEPT IT BY CHANGING STATE AND 
@@ -2722,6 +2746,9 @@
     apiNodePtr.p->blockRef = ref;
     signal->theData[0] = apiNodePtr.i;
     sendSignal(CMVMI_REF, GSN_ENABLE_COMORD, signal, 1, JBA);
+    
+    signal->theData[0] = apiNodePtr.i;
+    EXECUTE_DIRECT(NDBCNTR, GSN_API_START_REP, signal, 1);
   }
   return;
 }//Qmgr::execAPI_REGREQ()
@@ -4764,6 +4791,173 @@
 }
 
 void
+Qmgr::execNODE_FAILREP(Signal * signal)
+{
+  jamEntry();
+  // make sure any distributed signals get acknowledged
+  // destructive of the signal
+  c_counterMgr.execNODE_FAILREP(signal);
+}
+
+void
+Qmgr::execALLOC_NODEID_REQ(Signal * signal)
+{
+  jamEntry();
+  const AllocNodeIdReq * req = (AllocNodeIdReq*)signal->getDataPtr();
+  Uint32 senderRef = req->senderRef;
+  Uint32 nodeId = req->nodeId;
+  Uint32 nodeType = req->nodeType;
+  Uint32 error = 0;
+
+  if (refToBlock(senderRef) != QMGR) // request from management server
+  {
+    /* master */
+
+    if (getOwnNodeId() != cpresident)
+      error = AllocNodeIdRef::NotMaster;
+    else if (!opAllocNodeIdReq.m_tracker.done())
+      error = AllocNodeIdRef::Busy;
+    else if (c_connectedNodes.get(nodeId))
+      error = AllocNodeIdRef::NodeConnected;
+
+    if (error)
+    {
+      jam();
+      AllocNodeIdRef * ref = (AllocNodeIdRef*)signal->getDataPtrSend();
+      ref->senderRef = reference();
+      ref->errorCode = error;
+      ref->masterRef = numberToRef(QMGR, cpresident);
+      sendSignal(senderRef, GSN_ALLOC_NODEID_REF, signal,
+                 AllocNodeIdRef::SignalLength, JBB);
+      return;
+    }
+
+    opAllocNodeIdReq.m_req = *req;
+    opAllocNodeIdReq.m_error = 0;
+    opAllocNodeIdReq.m_connectCount = getNodeInfo(refToNode(senderRef)).m_connectCount;
+
+    jam();
+    AllocNodeIdReq * req = (AllocNodeIdReq*)signal->getDataPtrSend();
+    req->senderRef = reference();
+    NodeReceiverGroup rg(QMGR, c_clusterNodes);
+    RequestTracker & p = opAllocNodeIdReq.m_tracker;
+    p.init<AllocNodeIdRef>(c_counterMgr, rg, GSN_ALLOC_NODEID_REF, 0);
+
+    sendSignal(rg, GSN_ALLOC_NODEID_REQ, signal,
+               AllocNodeIdReq::SignalLength, JBB);
+    return;
+  }
+
+  /* participant */
+
+  if (c_connectedNodes.get(nodeId))
+    error = AllocNodeIdRef::NodeConnected;
+  else
+  {
+    NodeRecPtr nodePtr;
+    nodePtr.i = nodeId;
+    ptrAss(nodePtr, nodeRec);
+    if (nodeType != getNodeInfo(nodeId).m_type)
+      error = AllocNodeIdRef::NodeTypeMismatch;
+    else if (nodePtr.p->failState != NORMAL)
+      error = AllocNodeIdRef::NodeFailureHandlingNotCompleted;
+  }
+
+  if (error)
+  {
+    AllocNodeIdRef * ref = (AllocNodeIdRef*)signal->getDataPtrSend();
+    ref->senderRef = reference();
+    ref->errorCode = error;
+    sendSignal(senderRef, GSN_ALLOC_NODEID_REF, signal,
+               AllocNodeIdRef::SignalLength, JBB);
+    return;
+  }
+
+  AllocNodeIdConf * conf = (AllocNodeIdConf*)signal->getDataPtrSend();
+  conf->senderRef = reference();
+  sendSignal(senderRef, GSN_ALLOC_NODEID_CONF, signal,
+             AllocNodeIdConf::SignalLength, JBB);
+}
+
+void
+Qmgr::execALLOC_NODEID_CONF(Signal * signal)
+{
+  /* master */
+
+  jamEntry();
+  const AllocNodeIdConf * conf = (AllocNodeIdConf*)signal->getDataPtr();
+  opAllocNodeIdReq.m_tracker.reportConf(c_counterMgr,
+                                        refToNode(conf->senderRef));
+  completeAllocNodeIdReq(signal);
+}
+
+
+void
+Qmgr::execALLOC_NODEID_REF(Signal * signal)
+{
+  /* master */
+
+  jamEntry();
+  const AllocNodeIdRef * ref = (AllocNodeIdRef*)signal->getDataPtr();
+  if (ref->errorCode == AllocNodeIdRef::NF_FakeErrorREF)
+  {
+    opAllocNodeIdReq.m_tracker.ignoreRef(c_counterMgr,
+                                         refToNode(ref->senderRef));    
+  }
+  else
+  {
+    opAllocNodeIdReq.m_tracker.reportRef(c_counterMgr,
+                                         refToNode(ref->senderRef));
+    if (opAllocNodeIdReq.m_error == 0)
+      opAllocNodeIdReq.m_error = ref->errorCode;
+  }
+  completeAllocNodeIdReq(signal);
+}
+
+void
+Qmgr::completeAllocNodeIdReq(Signal *signal)
+{
+  /* master */
+
+  if (!opAllocNodeIdReq.m_tracker.done())
+  {
+    jam();
+    return;
+  }
+
+  if (opAllocNodeIdReq.m_connectCount !=
+      getNodeInfo(refToNode(opAllocNodeIdReq.m_req.senderRef)).m_connectCount)
+  {
+    // management server not same version as the original requester
+    jam();
+    return;
+  }
+
+  if (opAllocNodeIdReq.m_tracker.hasRef())
+  {
+    jam();
+    AllocNodeIdRef * ref = (AllocNodeIdRef*)signal->getDataPtrSend();
+    ref->senderRef = reference();
+    ref->senderData = opAllocNodeIdReq.m_req.senderData;
+    ref->nodeId = opAllocNodeIdReq.m_req.nodeId;
+    ref->errorCode = opAllocNodeIdReq.m_error;
+    ref->masterRef = numberToRef(QMGR, cpresident);
+    ndbassert(AllocNodeIdRef::SignalLength == 5);
+    sendSignal(opAllocNodeIdReq.m_req.senderRef, GSN_ALLOC_NODEID_REF, signal,
+               AllocNodeIdRef::SignalLength, JBB);
+    return;
+  }
+  jam();
+  AllocNodeIdConf * conf = (AllocNodeIdConf*)signal->getDataPtrSend();
+  conf->senderRef = reference();
+  conf->senderData = opAllocNodeIdReq.m_req.senderData;
+  conf->nodeId = opAllocNodeIdReq.m_req.nodeId;
+  ndbassert(AllocNodeIdConf::SignalLength == 3);
+  sendSignal(opAllocNodeIdReq.m_req.senderRef, GSN_ALLOC_NODEID_CONF, signal,
+             AllocNodeIdConf::SignalLength, JBB);
+}
+	
+void
 Qmgr::execSTOP_REQ(Signal* signal)
 {
   jamEntry();
@@ -4771,6 +4965,7 @@
 
   if (c_stopReq.senderRef)
   {
+    jam();
     ndbrequire(NdbNodeBitmask::get(c_stopReq.nodes, getOwnNodeId()));
     
     StopConf *conf = (StopConf*)signal->getDataPtrSend();

--- 1.2.4.1/ndb/include/mgmapi/ndbd_exit_codes.h	2006-09-20 10:25:38 +08:00
+++ 1.12/storage/ndb/include/mgmapi/ndbd_exit_codes.h	2006-09-20 10:25:38 +08:00
@@ -79,6 +79,7 @@
 #define NDBD_EXIT_SR_RESTARTCONFLICT          2311
 #define NDBD_EXIT_NO_MORE_UNDOLOG             2312 
 #define NDBD_EXIT_SR_UNDOLOG                  2313 
+#define NDBD_EXIT_SR_SCHEMAFILE               2310
 #define NDBD_EXIT_SINGLE_USER_MODE            2314 
 #define NDBD_EXIT_MEMALLOC                    2327
 #define NDBD_EXIT_BLOCK_JBUFCONGESTION        2334
@@ -93,6 +94,9 @@
 #define NDBD_EXIT_NDBASSERT                   2343
 #define NDBD_EXIT_INVALID_CONFIG              2350
 #define NDBD_EXIT_OUT_OF_LONG_SIGNAL_MEMORY   2351
+
+/* Errorcodes for fatal resource errors */
+#define NDBD_EXIT_RESOURCE_ALLOC_ERROR        2500
 
 #define NDBD_EXIT_OS_SIGNAL_RECEIVED          6000
 

--- 1.1.6.1/ndb/src/kernel/error/ndbd_exit_codes.c	2006-09-20 10:25:38 +08:00
+++ 1.13/storage/ndb/src/kernel/error/ndbd_exit_codes.c	2006-09-20 10:25:38 +08:00
@@ -63,6 +63,7 @@
    {NDBD_EXIT_NODE_NOT_DEAD, XRE, "Internal node state conflict, "
     "most probably resolved by restarting node again"},
    {NDBD_EXIT_SR_REDOLOG, XFI, "Error while reading the REDO log"},
+   {NDBD_EXIT_SR_SCHEMAFILE, XFI, "Error while reading the schema file"},
    /* Currently unused? */
    {2311, XIE, "Conflict when selecting restart type"},
    {NDBD_EXIT_NO_MORE_UNDOLOG, XCR,
@@ -86,6 +87,10 @@
    /* this error message is complemented by additional info when generated */
    {NDBD_EXIT_INVALID_CONFIG, XCE,
     "Invalid configuration received from Management Server"},
+
+   {NDBD_EXIT_RESOURCE_ALLOC_ERROR, XCE,
+    "Resource allocation error, please review the configuration"},
+
    /* this error message is complemented by additional info when
       generated, such as signal, and text
    */
Thread
bk commit into 5.1 tree (dli:1.2292)David Li20 Sep