List:Commits« Previous MessageNext Message »
From:jonas Date:December 3 2007 8:44am
Subject:bk commit into 5.1 tree (jonas:1.2701) BUG#32922
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-12-03 09:44:16+01:00, jonas@stripped +4 -0
  ndb - bug#32922
    Fix race between GCP_PREPARE (to self) and NODE_FAILREP
    (micro GCP only)

  storage/ndb/src/kernel/blocks/ERROR_codes.txt@stripped, 2007-12-03 09:44:13+01:00, jonas@stripped +1 -1
    new error codes

  storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp@stripped, 2007-12-03 09:44:13+01:00, jonas@stripped +55 -4
    fix race between GCP_PREPARE and NODE_FAILREP

  storage/ndb/test/ndbapi/testNodeRestart.cpp@stripped, 2007-12-03 09:44:13+01:00, jonas@stripped +49 -0
    testcase

  storage/ndb/test/run-test/daily-basic-tests.txt@stripped, 2007-12-03 09:44:13+01:00, jonas@stripped +4 -0
    testcase

diff -Nrup a/storage/ndb/src/kernel/blocks/ERROR_codes.txt b/storage/ndb/src/kernel/blocks/ERROR_codes.txt
--- a/storage/ndb/src/kernel/blocks/ERROR_codes.txt	2007-11-08 10:20:09 +01:00
+++ b/storage/ndb/src/kernel/blocks/ERROR_codes.txt	2007-12-03 09:44:13 +01:00
@@ -5,7 +5,7 @@ Next DBACC 3002
 Next DBTUP 4029
 Next DBLQH 5048
 Next DBDICT 6008
-Next DBDIH 7195
+Next DBDIH 7202
 Next DBTC 8057
 Next CMVMI 9000
 Next BACKUP 10038
diff -Nrup a/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp b/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp
--- a/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp	2007-11-20 15:17:23 +01:00
+++ b/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp	2007-12-03 09:44:13 +01:00
@@ -202,8 +202,26 @@ void Dbdih::sendGCP_PREPARE(Signal* sign
   req->nodeId = cownNodeId;
   req->gci_hi = Uint32(m_micro_gcp.m_master.m_new_gci >> 32);
   req->gci_lo = Uint32(m_micro_gcp.m_master.m_new_gci);
-  sendSignal(ref, GSN_GCP_PREPARE, signal, GCPPrepare::SignalLength, JBA);
-  
+
+  if (! (ERROR_INSERTED(7201) || ERROR_INSERTED(7202)))
+  {
+    sendSignal(ref, GSN_GCP_PREPARE, signal, GCPPrepare::SignalLength, JBA);
+  }
+  else if (ERROR_INSERTED(7201))
+  {
+    sendSignal(ref, GSN_GCP_PREPARE, signal, GCPPrepare::SignalLength, JBB);
+  } 
+  else if (ERROR_INSERTED(7202))
+  {
+    ndbrequire(nodeId == getOwnNodeId());
+    sendSignalWithDelay(ref, GSN_GCP_PREPARE, signal, 2000, 
+                        GCPPrepare::SignalLength);    
+  }
+  else
+  {
+    ndbrequire(false); // should be dead code #ifndef ERROR_INSERT
+  }
+
   ndbassert(m_micro_gcp.m_enabled || Uint32(m_micro_gcp.m_new_gci) == 0);
 }//Dbdih::sendGCP_PREPARE()
 
@@ -5106,8 +5124,8 @@ void Dbdih::checkGcpOutstanding(Signal* 
     jam();
     GCPPrepareConf* conf = (GCPPrepareConf*)signal->getDataPtrSend();
     conf->nodeId = failedNodeId;
-    conf->gci_hi = Uint32(m_micro_gcp.m_new_gci >> 32);
-    conf->gci_lo = Uint32(m_micro_gcp.m_new_gci);
+    conf->gci_hi = Uint32(m_micro_gcp.m_master.m_new_gci >> 32);
+    conf->gci_lo = Uint32(m_micro_gcp.m_master.m_new_gci);
     sendSignal(reference(), GSN_GCP_PREPARECONF, signal, 
                GCPPrepareConf::SignalLength, JBB);
   }//if
@@ -8154,6 +8172,39 @@ Dbdih::startGcpLab(Signal* signal, Uint3
                       signal, &c_GCP_PREPARE_Counter, &Dbdih::sendGCP_PREPARE);
     signal->theData[0] = 9999;
     sendSignalWithDelay(CMVMI_REF, GSN_NDB_TAMPER, signal, 1000, 1);
+    return;
+  }
+  else if (ERROR_INSERTED(7200))
+  {
+    c_GCP_PREPARE_Counter.clearWaitingFor();
+    NodeRecordPtr nodePtr;
+    nodePtr.i = cfirstAliveNode;
+    do {
+      jam();
+      ptrCheckGuard(nodePtr, MAX_NDB_NODES, nodeRecord);
+      c_GCP_PREPARE_Counter.setWaitingFor(nodePtr.i);
+      if (nodePtr.i != getOwnNodeId())
+      {
+        SET_ERROR_INSERT_VALUE(7201);
+        sendGCP_PREPARE(signal, nodePtr.i);
+      }
+      else
+      {
+        SET_ERROR_INSERT_VALUE(7202);
+        sendGCP_PREPARE(signal, nodePtr.i);
+      }
+      nodePtr.i = nodePtr.p->nextNode;
+    } while (nodePtr.i != RNIL);
+
+    NodeReceiverGroup rg(CMVMI, c_GCP_PREPARE_Counter);
+    rg.m_nodes.clear(getOwnNodeId());
+    Uint32 victim = rg.m_nodes.find(0);
+    
+    signal->theData[0] = 9999;
+    sendSignal(numberToRef(CMVMI, victim),
+	       GSN_NDB_TAMPER, signal, 1, JBA);
+
+    CLEAR_ERROR_INSERT_VALUE;
     return;
   }
 #endif
diff -Nrup a/storage/ndb/test/ndbapi/testNodeRestart.cpp b/storage/ndb/test/ndbapi/testNodeRestart.cpp
--- a/storage/ndb/test/ndbapi/testNodeRestart.cpp	2007-11-08 10:24:29 +01:00
+++ b/storage/ndb/test/ndbapi/testNodeRestart.cpp	2007-12-03 09:44:13 +01:00
@@ -2018,6 +2018,52 @@ runBug32160(NDBT_Context* ctx, NDBT_Step
   return NDBT_OK;
 }
 
+int
+runBug32922(NDBT_Context* ctx, NDBT_Step* step)
+{
+  int result = NDBT_OK;
+  int loops = ctx->getNumLoops();
+  int records = ctx->getNumRecords();
+  Ndb* pNdb = GETNDB(step);
+  NdbRestarter res;
+
+  if (res.getNumDbNodes() < 2)
+  {
+    return NDBT_OK;
+  }
+
+  while (loops--)
+  {
+    int master = res.getMasterNodeId();    
+
+    int victim = 32768;
+    for (Uint32 i = 0; i<res.getNumDbNodes(); i++)
+    {
+      int node = res.getDbNodeId(i);
+      if (node != master && node < victim)
+        victim = node;
+    }
+
+    int val2[] = { DumpStateOrd::CmvmiSetRestartOnErrorInsert, 1 };    
+    if (res.dumpStateOneNode(victim, val2, 2))
+      return NDBT_FAILED;
+    
+    if (res.insertErrorInNode(master, 7200))
+      return NDBT_FAILED;
+    
+    if (res.waitNodesNoStart(&victim, 1))
+      return NDBT_FAILED;
+    
+    if (res.startNodes(&victim, 1))
+      return NDBT_FAILED;
+    
+    if (res.waitClusterStarted())
+      return NDBT_FAILED;
+  }
+  
+  return NDBT_OK;
+}
+
 NDBT_TESTSUITE(testNodeRestart);
 TESTCASE("NoLoad", 
 	 "Test that one node at a time can be stopped and then restarted "\
@@ -2398,6 +2444,9 @@ TESTCASE("GCP", ""){
 }
 TESTCASE("Bug32160", ""){
   INITIALIZER(runBug32160);
+}
+TESTCASE("Bug32922", ""){
+  INITIALIZER(runBug32922);
 }
 NDBT_TESTSUITE_END(testNodeRestart);
 
diff -Nrup a/storage/ndb/test/run-test/daily-basic-tests.txt b/storage/ndb/test/run-test/daily-basic-tests.txt
--- a/storage/ndb/test/run-test/daily-basic-tests.txt	2007-11-19 11:01:26 +01:00
+++ b/storage/ndb/test/run-test/daily-basic-tests.txt	2007-12-03 09:44:13 +01:00
@@ -1082,3 +1082,7 @@ max-time: 300
 cmd: testSystemRestart
 args: -n Bug22696 T1
 
+max-time: 300
+cmd: testNodeRestart
+args: -n Bug32922 T1
+
Thread
bk commit into 5.1 tree (jonas:1.2701) BUG#32922jonas3 Dec