List:Commits« Previous MessageNext Message »
From:jonas Date:January 11 2007 8:09pm
Subject:bk commit into 5.1 tree (jonas:1.2371)
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-01-11 21:09:27+01:00, jonas@stripped +3 -0
  Merge perch.ndb.mysql.com:/home/jonas/src/51-work
  into  perch.ndb.mysql.com:/home/jonas/src/mysql-5.1-new-ndb
  MERGE: 1.2344.3.19

  storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp@stripped, 2007-01-11 21:09:24+01:00, jonas@stripped +0 -0
    Auto merged
    MERGE: 1.110.1.2

  storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp@stripped, 2007-01-11 21:09:24+01:00, jonas@stripped +0 -0
    Auto merged
    MERGE: 1.94.1.2

  storage/ndb/test/run-test/daily-basic-tests.txt@stripped, 2007-01-11 21:09:24+01:00, jonas@stripped +0 -0
    Auto merged
    MERGE: 1.58.1.4

# 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/mysql-5.1-new-ndb/RESYNC

--- 1.60/storage/ndb/test/run-test/daily-basic-tests.txt	2007-01-11 21:09:32 +01:00
+++ 1.61/storage/ndb/test/run-test/daily-basic-tests.txt	2007-01-11 21:09:32 +01:00
@@ -513,6 +513,14 @@
 cmd: testNodeRestart
 args: -n Bug24717 T1
 
+max-time: 1000
+cmd: testNodeRestart
+args: -n Bug25364 T1
+
+max-time: 1000
+cmd: testNodeRestart
+args: -n Bug25554 T1
+
 #
 # DICT TESTS
 max-time: 1500
@@ -763,6 +771,10 @@
 max-time: 1500
 cmd: testSystemRestart
 args: -n Bug24664
+
+max-time: 1000
+cmd: testNodeRestart
+args: -n Bug25468 T1
 
 # OLD FLEX
 max-time: 500

--- 1.111/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp	2007-01-11 21:09:32 +01:00
+++ 1.112/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp	2007-01-11 21:09:32 +01:00
@@ -10050,9 +10050,20 @@
   }
   OpSubEventPtr subbPtr;
   Uint32 errCode = 0;
+
+  DictLockPtr loopPtr;
+  if (c_dictLockQueue.first(loopPtr) &&
+      loopPtr.p->lt->lockType == DictLockReq::NodeRestartLock)
+  {
+    jam();
+    errCode = 1405;
+    goto busy;
+  }
+
   if (!c_opSubEvent.seize(subbPtr)) {
     errCode = SubStartRef::Busy;
 busy:
+    jam();
     SubStartRef * ref = (SubStartRef *)signal->getDataPtrSend();
 
     { // fix
@@ -10151,6 +10162,7 @@
     SubStartRef* ref = (SubStartRef*) signal->getDataPtrSend();
     ref->senderRef = reference();
     ref->senderData = subbPtr.p->m_senderData;
+    ref->errorCode = err;
     sendSignal(subbPtr.p->m_senderRef, GSN_SUB_START_REF,
 	       signal, SubStartRef::SignalLength2, JBB);
     c_opSubEvent.release(subbPtr);
@@ -10213,6 +10225,7 @@
 #ifdef EVENT_PH3_DEBUG
   ndbout_c("DBDICT(Coordinator) got GSN_SUB_START_CONF = (%d)", subbPtr.i);
 #endif
+  subbPtr.p->m_sub_start_conf = *conf;
   subbPtr.p->m_reqTracker.reportConf(c_counterMgr, refToNode(senderRef));
   completeSubStartReq(signal,subbPtr.i,0);
 }
@@ -10252,6 +10265,9 @@
 #ifdef EVENT_DEBUG
   ndbout_c("SUB_START_CONF");
 #endif
+  
+  SubStartConf* conf = (SubStartConf*)signal->getDataPtrSend();
+  * conf = subbPtr.p->m_sub_start_conf;
   sendSignal(subbPtr.p->m_senderRef, GSN_SUB_START_CONF,
 	     signal, SubStartConf::SignalLength, JBB);
   c_opSubEvent.release(subbPtr);
@@ -10373,6 +10389,7 @@
     SubStopRef* ref = (SubStopRef*) signal->getDataPtrSend();
     ref->senderRef = reference();
     ref->senderData = subbPtr.p->m_senderData;
+    ref->errorCode = err;
     sendSignal(subbPtr.p->m_senderRef, GSN_SUB_STOP_REF,
 	       signal, SubStopRef::SignalLength, JBB);
     c_opSubEvent.release(subbPtr);
@@ -10425,6 +10442,7 @@
    * Coordinator
    */
   ndbrequire(refToBlock(senderRef) == DBDICT);
+  subbPtr.p->m_sub_stop_conf = *conf;
   subbPtr.p->m_reqTracker.reportConf(c_counterMgr, refToNode(senderRef));
   completeSubStopReq(signal,subbPtr.i,0);
 }
@@ -10465,6 +10483,8 @@
 #ifdef EVENT_DEBUG
   ndbout_c("SUB_STOP_CONF");
 #endif
+  SubStopConf* conf = (SubStopConf*)signal->getDataPtrSend();
+  * conf = subbPtr.p->m_sub_stop_conf;
   sendSignal(subbPtr.p->m_senderRef, GSN_SUB_STOP_CONF,
 	     signal, SubStopConf::SignalLength, JBB);
   c_opSubEvent.release(subbPtr);
@@ -10713,6 +10733,7 @@
       SubRemoveRef* ref = (SubRemoveRef*) signal->getDataPtrSend();
       ref->senderRef = reference();
       ref->senderData = subbPtr.p->m_senderData;
+      ref->errorCode = err;
       sendSignal(subbPtr.p->m_senderRef, GSN_SUB_REMOVE_REF,
 		 signal, SubRemoveRef::SignalLength, JBB);
     }

--- 1.95/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp	2007-01-11 21:09:32 +01:00
+++ 1.96/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp	2007-01-11 21:09:32 +01:00
@@ -3741,7 +3741,6 @@
   takeOverPtr.i = takeOverPtrI;
   ptrCheckGuard(takeOverPtr, MAX_NDB_NODES, takeOverRecord);
 
-  releaseTakeOver(takeOverPtrI);
   if ((takeOverPtr.p->toMasterStatus != TakeOverRecord::IDLE) &&
       (takeOverPtr.p->toMasterStatus != TakeOverRecord::TO_WAIT_START_TAKE_OVER)) {
     jam();
@@ -3755,6 +3754,7 @@
   }//if
   setAllowNodeStart(takeOverPtr.p->toStartingNode, true);
   initTakeOver(takeOverPtr);
+  releaseTakeOver(takeOverPtrI);
 }//Dbdih::endTakeOver()
 
 void Dbdih::releaseTakeOver(Uint32 takeOverPtrI)
@@ -4046,6 +4046,11 @@
   Uint32 newMasterId = nodeFail->masterNodeId;
   const Uint32 noOfFailedNodes = nodeFail->noOfNodes;
 
+  if (ERROR_INSERTED(7179))
+  {
+    CLEAR_ERROR_INSERT_VALUE;
+  }
+
   /*-------------------------------------------------------------------------*/
   // The first step is to convert from a bit mask to an array of failed nodes.
   /*-------------------------------------------------------------------------*/
@@ -4909,6 +4914,7 @@
       break;
     }
     ndbrequire(ok);
+    endTakeOver(takeOverPtr.i);
   }//if
 }//Dbdih::handleTakeOverNewMaster()
 
@@ -10256,12 +10262,42 @@
   Uint32 fragId = lcpReport->fragId;
   
   jamEntry();
+
+  if (ERROR_INSERTED(7178) && nodeId != getOwnNodeId())
+  {
+    jam();
+    Uint32 owng =Sysfile::getNodeGroup(getOwnNodeId(), SYSFILE->nodeGroups);
+    Uint32 nodeg = Sysfile::getNodeGroup(nodeId, SYSFILE->nodeGroups);
+    if (owng == nodeg)
+    {
+      jam();
+      ndbout_c("throwing away LCP_FRAG_REP from  (and killing) %d", nodeId);
+      SET_ERROR_INSERT_VALUE(7179);
+      signal->theData[0] = 9999;
+      sendSignal(numberToRef(CMVMI, nodeId), 
+		 GSN_NDB_TAMPER, signal, 1, JBA);  
+      return;
+    }
+  }
  
+  if (ERROR_INSERTED(7179) && nodeId != getOwnNodeId())
+  {
+    jam();
+    Uint32 owng =Sysfile::getNodeGroup(getOwnNodeId(), SYSFILE->nodeGroups);
+    Uint32 nodeg = Sysfile::getNodeGroup(nodeId, SYSFILE->nodeGroups);
+    if (owng == nodeg)
+    {
+      jam();
+      ndbout_c("throwing away LCP_FRAG_REP from %d", nodeId);
+      return;
+    }
+  }    
+
   CRASH_INSERTION2(7025, isMaster());
   CRASH_INSERTION2(7016, !isMaster());
-
+  
   bool fromTimeQueue = (signal->senderBlockRef() == reference());
-
+  
   TabRecordPtr tabPtr;
   tabPtr.i = tableId;
   ptrCheckGuard(tabPtr, ctabFileSize, tabRecord);
@@ -10463,6 +10499,37 @@
   ndbrequire(false);
 }//Dbdih::findReplica()
 
+
+int
+Dbdih::handle_invalid_lcp_no(const LcpFragRep* rep, 
+			     ReplicaRecordPtr replicaPtr)
+{
+  ndbrequire(!isMaster());
+  Uint32 lcpNo = rep->lcpNo;
+  Uint32 lcpId = rep->lcpId;
+  Uint32 replicaLcpNo = replicaPtr.p->nextLcp;
+  Uint32 prevReplicaLcpNo = prevLcpNo(replicaLcpNo);
+
+  warningEvent("Detected previous node failure of %d during lcp",
+	       rep->nodeId);
+  replicaPtr.p->nextLcp = lcpNo;
+  replicaPtr.p->lcpId[lcpNo] = 0;
+  replicaPtr.p->lcpStatus[lcpNo] = ZINVALID;
+  
+  for (Uint32 i = lcpNo; i != lcpNo; i = nextLcpNo(i))
+  {
+    jam();
+    if (replicaPtr.p->lcpStatus[i] == ZVALID &&
+	replicaPtr.p->lcpId[i] >= lcpId)
+    {
+      ndbout_c("i: %d lcpId: %d", i, replicaPtr.p->lcpId[i]);
+      ndbrequire(false);
+    }
+  }
+
+  return 0;
+}
+
 /**
  * Return true  if table is all fragment replicas have been checkpointed
  *                 to disk (in all LQHs)
@@ -10491,9 +10558,12 @@
   
   ndbrequire(replicaPtr.p->lcpOngoingFlag == true);
   if(lcpNo != replicaPtr.p->nextLcp){
-    ndbout_c("lcpNo = %d replicaPtr.p->nextLcp = %d", 
-	     lcpNo, replicaPtr.p->nextLcp);
-    ndbrequire(false);
+    if (handle_invalid_lcp_no(lcpReport, replicaPtr))
+    {
+      ndbout_c("lcpNo = %d replicaPtr.p->nextLcp = %d", 
+	       lcpNo, replicaPtr.p->nextLcp);
+      ndbrequire(false);
+    }
   }
   ndbrequire(lcpNo == replicaPtr.p->nextLcp);
   ndbrequire(lcpNo < MAX_LCP_STORED);
Thread
bk commit into 5.1 tree (jonas:1.2371)jonas11 Jan