MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:tomas Date:January 4 2007 2:02pm
Subject:bk commit into 5.1 tree (tomas:1.2087) BUG#24717
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of tomas. When tomas 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
  1.2087 07/01/04 15:02:35 tomas@poseidon. +9 -0
    ndb - bug#24717
      5.0 version
      Add some extra state to try to prevent sending committedread to node too early
      + test case

  storage/ndb/test/run-test/daily-basic-tests.txt
    1.40 07/01/04 15:02:26 tomas@poseidon. +4 -0
        add testcase for bug#24717

  storage/ndb/test/ndbapi/testNodeRestart.cpp
    1.27 07/01/04 15:02:26 tomas@poseidon. +39 -0
        add testcase for bug#24717

  storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
    1.104 07/01/04 15:02:26 tomas@poseidon. +35 -1
        Add extra state to prevent sending committed reads to node to early
          (before connection establishment)

  storage/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp
    1.14 07/01/04 15:02:26 tomas@poseidon. +2 -1
        Add extra state to prevent sending committed reads to node to early
          (before connection establishment)

  storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp
    1.38 07/01/04 15:02:26 tomas@poseidon. +3 -1
        Add extra state to prevent sending committed reads to node to early
          (before connection establishment)

  storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
    1.90 07/01/04 15:02:26 tomas@poseidon. +41 -3
        Add retry mechanism to send TCKEYREF
          (as extra safety)

  storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp
    1.42 07/01/04 15:02:26 tomas@poseidon. +2 -0
        Add retry mechanism to send TCKEYREF
          (as extra safety)

  storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.hpp
    1.5 07/01/04 15:02:26 tomas@poseidon. +2 -1
        Add new error insert 9002
          which is 9000, but will auto enable when started

  storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp
    1.29 07/01/04 15:02:25 tomas@poseidon. +18 -4
        Add new error insert 9002
          which is 9000, but will auto enable when started

# 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:	tomas
# Host:	poseidon.
# Root:	/home/tomas/mysql-5.1-wl2325-5.0

--- 1.39/storage/ndb/test/run-test/daily-basic-tests.txt	2007-01-04 13:03:10 +01:00
+++ 1.40/storage/ndb/test/run-test/daily-basic-tests.txt	2007-01-04 15:02:26 +01:00
@@ -453,6 +453,10 @@
 cmd: testNodeRestart
 args: -n Bug25364 T1
 
+max-time: 1000
+cmd: testNodeRestart
+args: -n Bug24717 T1
+
 # OLD FLEX
 max-time: 500
 cmd: flexBench

--- 1.28/storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp	2007-01-04 12:22:26 +01:00
+++ 1.29/storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp	2007-01-04 15:02:25 +01:00
@@ -91,6 +91,7 @@
   addRecSignal(GSN_DUMP_STATE_ORD, &Cmvmi::execDUMP_STATE_ORD);
 
   addRecSignal(GSN_TESTSIG, &Cmvmi::execTESTSIG);
+  addRecSignal(GSN_NODE_START_REP, &Cmvmi::execNODE_START_REP, true);
   
   subscriberPool.setSize(5);
 
@@ -418,7 +419,8 @@
   if(len == 2){
 
 #ifdef ERROR_INSERT
-    if (! (ERROR_INSERTED(9000) && c_error_9000_nodes_mask.get(tStartingNode)))
+    if (! ((ERROR_INSERTED(9000) || ERROR_INSERTED(9002)) 
+	   && c_error_9000_nodes_mask.get(tStartingNode)))
 #endif
     {
       globalTransporterRegistry.do_connect(tStartingNode);
@@ -439,7 +441,8 @@
 	jam();
 
 #ifdef ERROR_INSERT
-	if (ERROR_INSERTED(9000) && c_error_9000_nodes_mask.get(i))
+	if ((ERROR_INSERTED(9000) || ERROR_INSERTED(9002))
+	    && c_error_9000_nodes_mask.get(i))
 	  continue;
 #endif
 	
@@ -1134,9 +1137,9 @@
   }
 
 #ifdef ERROR_INSERT
-  if (arg == 9000)
+  if (arg == 9000 || arg == 9002)
   {
-    SET_ERROR_INSERT_VALUE(9000);
+    SET_ERROR_INSERT_VALUE(arg);
     for (Uint32 i = 1; i<signal->getLength(); i++)
       c_error_9000_nodes_mask.set(signal->theData[i]);
   }
@@ -1183,6 +1186,17 @@
 #endif
 }//Cmvmi::execDUMP_STATE_ORD()
 
+void
+Cmvmi::execNODE_START_REP(Signal* signal)
+{
+#ifdef ERROR_INSERT
+  if (ERROR_INSERTED(9002) && signal->theData[0] == getOwnNodeId())
+  {
+    signal->theData[0] = 9001;
+    execDUMP_STATE_ORD(signal);
+  }
+#endif
+}
 
 BLOCK_FUNCTIONS(Cmvmi)
 

--- 1.4/storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.hpp	2005-10-07 01:06:18 +02:00
+++ 1.5/storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.hpp	2007-01-04 15:02:26 +01:00
@@ -72,7 +72,8 @@
   void handleSET_VAR_REQ(Signal* signal);
 
   void execTESTSIG(Signal* signal);
-
+  void execNODE_START_REP(Signal* signal);
+  
   char theErrorMessage[256];
   void sendSTTORRY(Signal* signal);
 

--- 1.41/storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp	2006-10-10 16:13:26 +02:00
+++ 1.42/storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp	2007-01-04 15:02:26 +01:00
@@ -235,6 +235,7 @@
 #define ZSCAN_MARKERS 18
 #define ZOPERATION_EVENT_REP 19
 #define ZPREP_DROP_TABLE 20
+#define ZRETRY_TCKEYREF 22
 
 /* ------------------------------------------------------------------------- */
 /*        NODE STATE DURING SYSTEM RESTART, VARIABLES CNODES_SR_STATE        */
@@ -2274,6 +2275,7 @@
   void releaseScanrec(Signal* signal);
   void seizeScanrec(Signal* signal);
   Uint32 sendKeyinfo20(Signal* signal, ScanRecord *, TcConnectionrec *);
+  void sendTCKEYREF(Signal*, Uint32 dst, Uint32 route, Uint32 cnt);
   void sendScanFragConf(Signal* signal, Uint32 scanCompleted);
   void initCopyrec(Signal* signal);
   void initCopyTc(Signal* signal);

--- 1.89/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp	2006-10-11 14:05:06 +02:00
+++ 1.90/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp	2007-01-04 15:02:26 +01:00
@@ -437,6 +437,22 @@
     checkDropTab(signal);
     return;
     break;
+  case ZRETRY_TCKEYREF:
+  {
+    jam();
+    Uint32 cnt = signal->theData[1];
+    Uint32 ref = signal->theData[2];
+    if (cnt < (10 * 60 * 5))
+    {
+      jam();
+      /**
+       * Only retry for 5 minutes...then hope that API has handled it..somehow
+       */
+      memmove(signal->theData, signal->theData+3, 4*TcKeyRef::SignalLength);
+      sendTCKEYREF(signal, ref, 0, cnt);
+    }
+    return;
+  }
   default:
     ndbrequire(false);
     break;
@@ -2343,7 +2359,7 @@
     tcKeyRef->transId[0] = transid1;
     tcKeyRef->transId[1] = transid2;
     tcKeyRef->errorCode = errCode;
-    sendSignal(apiRef, GSN_TCKEYREF, signal, TcKeyRef::SignalLength, JBB);
+    sendTCKEYREF(signal, apiRef, signal->getSendersBlockRef(), 0);
   } else {
     jam();
 
@@ -6552,8 +6568,7 @@
     tcKeyRef->transId[0] = regTcPtr->transid[0];
     tcKeyRef->transId[1] = regTcPtr->transid[1];
     tcKeyRef->errorCode = regTcPtr->errorCode;
-    sendSignal(regTcPtr->applRef, 
-               GSN_TCKEYREF, signal, TcKeyRef::SignalLength, JBB);
+    sendTCKEYREF(signal, regTcPtr->applRef, regTcPtr->clientBlockref, 0);
     cleanUp(signal);
     return;
   }//if
@@ -6587,6 +6602,29 @@
   }//if
   cleanUp(signal);
 }//Dblqh::continueAfterLogAbortWriteLab()
+
+void
+Dblqh::sendTCKEYREF(Signal* signal, Uint32 ref, Uint32 routeRef, Uint32 cnt)
+{
+  const Uint32 nodeId = refToNode(ref);
+  const bool connectedToNode = getNodeInfo(nodeId).m_connected;
+  
+  if (likely(connectedToNode))
+  {
+    jam();
+    sendSignal(ref, GSN_TCKEYREF, signal, TcKeyRef::SignalLength, JBB);
+  }
+  else
+  {
+    jam();
+    memmove(signal->theData + 3, signal->theData, 4*TcKeyRef::SignalLength);
+    signal->theData[0] = ZRETRY_TCKEYREF;
+    signal->theData[1] = cnt + 1;
+    signal->theData[2] = ref;
+    sendSignalWithDelay(reference(), GSN_CONTINUEB, signal, 100,
+			TcKeyRef::SignalLength + 3);
+  }
+}
 
 /* ########################################################################## 
  * #######                       MODULE TO HANDLE TC FAILURE          ####### 

--- 1.37/storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp	2007-01-04 12:44:28 +01:00
+++ 1.38/storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp	2007-01-04 15:02:26 +01:00
@@ -948,7 +948,8 @@
       NF_CHECK_SCAN        = 0x2,
       NF_CHECK_TRANSACTION = 0x4,
       NF_CHECK_DROP_TAB    = 0x8,
-      NF_NODE_FAIL_BITS    = 0xF // All bits...
+      NF_NODE_FAIL_BITS    = 0xF, // All bits...
+      NF_STARTED           = 0x10
     };
     Uint32 m_nf_bits;
     NdbNodeBitmask m_lqh_trans_conf;
@@ -1325,6 +1326,7 @@
   void execCOMMITCONF(Signal* signal);
   void execABORTCONF(Signal* signal);
   void execNODE_FAILREP(Signal* signal);
+  void execNODE_START_REP(Signal* signal);
   void execINCL_NODEREQ(Signal* signal);
   void execTIME_SIGNAL(Signal* signal);
   void execAPI_FAILREQ(Signal* signal);

--- 1.13/storage/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp	2005-10-14 10:31:07 +02:00
+++ 1.14/storage/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp	2007-01-04 15:02:26 +01:00
@@ -290,7 +290,8 @@
   addRecSignal(GSN_WAIT_DROP_TAB_CONF, &Dbtc::execWAIT_DROP_TAB_CONF);
   
   addRecSignal(GSN_ALTER_TAB_REQ, &Dbtc::execALTER_TAB_REQ);
-
+  addRecSignal(GSN_NODE_START_REP, &Dbtc::execNODE_START_REP, true);
+  
   cacheRecord = 0;
   apiConnectRecord = 0;
   tcConnectRecord = 0;

--- 1.103/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp	2007-01-04 12:15:38 +01:00
+++ 1.104/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp	2007-01-04 15:02:26 +01:00
@@ -3078,7 +3078,28 @@
 	  }//if
 	}//for
       }
-    }//if
+
+      if (regTcPtr->tcNodedata[0] != getOwnNodeId())
+      {
+	jam();
+	for (Uint32 i = 0; i < tnoOfBackup + 1; i++)
+	{
+	  HostRecordPtr hostPtr;
+	  hostPtr.i = regTcPtr->tcNodedata[i];
+	  ptrCheckGuard(hostPtr, chostFilesize, hostRecord);
+	  if (hostPtr.p->m_nf_bits & HostRecord::NF_STARTED)
+	  {
+	    jam();
+	    if (i != 0)
+	    {
+	      jam();
+	      regTcPtr->tcNodedata[0] = hostPtr.i;
+	    }
+	    break;
+	  }
+	}
+      }//if
+    }
     jam();
     regTcPtr->lastReplicaNo = 0;
     regTcPtr->noOfNodes = 1;
@@ -7024,6 +7045,19 @@
     nodeFailCheckTransactions(signal, 0, hostptr.i);
   }
 }//Dbtc::execNODE_FAILREP()
+
+void
+Dbtc::execNODE_START_REP(Signal* signal)
+{
+  Uint32 nodeId = signal->theData[0];
+  hostptr.i = nodeId;
+  ptrCheckGuard(hostptr, chostFilesize, hostRecord);
+  if (hostptr.p->m_nf_bits == 0)
+  {
+    jam();
+    hostptr.p->m_nf_bits |= HostRecord::NF_STARTED;
+  }
+}
 
 void
 Dbtc::checkNodeFailComplete(Signal* signal, 

--- 1.26/storage/ndb/test/ndbapi/testNodeRestart.cpp	2007-01-04 13:03:10 +01:00
+++ 1.27/storage/ndb/test/ndbapi/testNodeRestart.cpp	2007-01-04 15:02:26 +01:00
@@ -23,6 +23,7 @@
 #include <Vector.hpp>
 #include <signaldata/DumpStateOrd.hpp>
 #include <Bitmask.hpp>
+#include <RefConvert.hpp>
 
 int runLoadTable(NDBT_Context* ctx, NDBT_Step* step){
 
@@ -989,6 +990,41 @@
   return NDBT_OK;
 }
 
+int runBug24717(NDBT_Context* ctx, NDBT_Step* step){
+  int result = NDBT_OK;
+  int loops = ctx->getNumLoops();
+  int records = ctx->getNumRecords();
+  NdbRestarter restarter;
+  Ndb* pNdb = GETNDB(step);
+  
+  HugoTransactions hugoTrans(*ctx->getTab());
+
+  int dump[] = { 9002, 0 } ;
+  Uint32 ownNode = refToNode(pNdb->getReference());
+  dump[1] = ownNode;
+
+  for (; loops; loops --)
+  {
+    int nodeId = restarter.getRandomNotMasterNodeId(rand());
+    restarter.restartOneDbNode(nodeId, false, true, true);
+    restarter.waitNodesNoStart(&nodeId, 1);
+    
+    if (restarter.dumpStateOneNode(nodeId, dump, 2))
+      return NDBT_FAILED;
+    
+    restarter.startNodes(&nodeId, 1);
+    
+    for (Uint32 i = 0; i < 100; i++)
+    {
+      hugoTrans.pkReadRecords(pNdb, 100, 1, NdbOperation::LM_CommittedRead);
+    }
+    
+    restarter.waitClusterStarted();
+  }
+  
+  return NDBT_OK;
+}
+
 
 NDBT_TESTSUITE(testNodeRestart);
 TESTCASE("NoLoad", 
@@ -1301,6 +1337,9 @@
   INITIALIZER(runLoadTable);
   STEP(runBug20185);
   FINALIZER(runClearTable);
+}
+TESTCASE("Bug24717", ""){
+  INITIALIZER(runBug24717);
 }
 TESTCASE("Bug24543", "")
 {
Thread
bk commit into 5.1 tree (tomas:1.2087) BUG#24717tomas4 Jan