List:Commits« Previous MessageNext Message »
From:jonas Date:November 7 2007 12:07pm
Subject:bk commit into 5.1 tree (jonas:1.2673) BUG#31980
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-11-07 13:07:46+01:00, jonas@stripped +4 -0
  ndb - bug#31980
    Fix problem with api disconnect 'during' TC-take-over (after node failure)

  storage/ndb/src/kernel/blocks/ERROR_codes.txt@stripped, 2007-11-07 13:07:43+01:00, jonas@stripped +4 -1
    new error codes

  storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp@stripped, 2007-11-07 13:07:43+01:00, jonas@stripped +33 -0
    new error codes
    fix problem

  storage/ndb/test/ndbapi/testNodeRestart.cpp@stripped, 2007-11-07 13:07:43+01:00, jonas@stripped +55 -0
    testcase

  storage/ndb/test/run-test/daily-basic-tests.txt@stripped, 2007-11-07 13:07:43+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-10-23 15:57:26 +02:00
+++ b/storage/ndb/src/kernel/blocks/ERROR_codes.txt	2007-11-07 13:07:43 +01:00
@@ -6,7 +6,7 @@ Next DBTUP 4029
 Next DBLQH 5048
 Next DBDICT 6008
 Next DBDIH 7193
-Next DBTC 8054
+Next DBTC 8057
 Next CMVMI 9000
 Next BACKUP 10038
 Next DBUTIL 11002
@@ -327,6 +327,9 @@ ABORT OF TCKEYREQ
 ------
 
 8038 : Simulate API disconnect just after SCAN_TAB_REQ
+
+8055 : Crash in sendApiCommit, disconnect API, and set 8056
+8056 : return directly in API_FAILREQ
 
 8052 : Simulate failure of TransactionBufferMemory allocation for OI lookup
 
diff -Nrup a/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp b/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
--- a/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp	2007-10-15 10:08:56 +02:00
+++ b/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp	2007-11-07 13:07:43 +01:00
@@ -921,6 +921,13 @@ void Dbtc::execAPI_FAILREQ(Signal* signa
    * can only be true after all api connect records have been checked.
    **************************************************************************/
   jamEntry();  
+
+  if (ERROR_INSERTED(8056))
+  {
+    CLEAR_ERROR_INSERT_VALUE;
+    return;
+  }
+
   capiFailRef = signal->theData[1];
   arrGuard(signal->theData[0], MAX_NODES);
   capiConnectClosing[signal->theData[0]] = 1;
@@ -4703,6 +4710,24 @@ void Dbtc::sendApiCommit(Signal* signal)
 {
   ApiConnectRecord * const regApiPtr = apiConnectptr.p;
 
+  if (ERROR_INSERTED(8055))
+  {
+    /**
+     * 1) Kill self
+     * 2) Disconnect API
+     * 3) Prevent execAPI_FAILREQ from handling trans...
+     */
+    signal->theData[0] = 9999;
+    sendSignalWithDelay(CMVMI_REF, GSN_NDB_TAMPER, signal, 1000, 1);
+    
+    Uint32 node = refToNode(regApiPtr->ndbapiBlockref);
+    signal->theData[0] = node;
+    sendSignal(QMGR_REF, GSN_API_FAILREQ, signal, 1, JBB);
+
+    SET_ERROR_INSERT_VALUE(8056);
+    return;
+  }
+  
   if (regApiPtr->returnsignal == RS_TCKEYCONF) {
     sendtckeyconf(signal, 1);
   } else if (regApiPtr->returnsignal == RS_TC_COMMITCONF) {
@@ -7821,7 +7846,15 @@ Dbtc::routeTCKEY_FAILREFCONF(Signal* sig
     }
   }
   
+ 
+   /**
+    * This code was 'unfinished' code for partially connected API's
+    *   it does however not really work...
+    *   and we seriously need to think about semantics for API connect
+    */
+#if 0
   ndbrequire(getNodeInfo(refToNode(ref)).m_type == NodeInfo::DB);
+#endif
 }
 
 void
diff -Nrup a/storage/ndb/test/ndbapi/testNodeRestart.cpp b/storage/ndb/test/ndbapi/testNodeRestart.cpp
--- a/storage/ndb/test/ndbapi/testNodeRestart.cpp	2007-10-15 15:01:38 +02:00
+++ b/storage/ndb/test/ndbapi/testNodeRestart.cpp	2007-11-07 13:07:43 +01:00
@@ -1921,6 +1921,58 @@ runBug31525(NDBT_Context* ctx, NDBT_Step
   return NDBT_OK;
 }
 
+int
+runBug31980(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;
+  }
+
+
+  HugoOperations hugoOps (* ctx->getTab());
+  if(hugoOps.startTransaction(pNdb) != 0)
+    return NDBT_FAILED;
+  
+  if(hugoOps.pkInsertRecord(pNdb, 1) != 0)
+    return NDBT_FAILED;
+  
+  if(hugoOps.execute_NoCommit(pNdb) != 0)
+    return NDBT_FAILED;
+  
+  int transNode= hugoOps.getTransaction()->getConnectedNodeId();
+  int val2[] = { DumpStateOrd::CmvmiSetRestartOnErrorInsert, 1 };    
+
+  if (res.dumpStateOneNode(transNode, val2, 2))
+  {
+    return NDBT_FAILED;
+  }
+
+  if (res.insertErrorInNode(transNode, 8055))
+  {
+    return NDBT_FAILED;
+  }
+    
+  hugoOps.execute_Commit(pNdb); // This should hang/fail
+
+  if (res.waitNodesNoStart(&transNode, 1))
+    return NDBT_FAILED;
+
+  if (res.startNodes(&transNode, 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 "\
@@ -2286,6 +2338,9 @@ TESTCASE("Bug28023", ""){
 }
 TESTCASE("Bug28717", ""){
   INITIALIZER(runBug28717);
+}
+TESTCASE("Bug31980", ""){
+  INITIALIZER(runBug31980);
 }
 TESTCASE("Bug29364", ""){
   INITIALIZER(runBug29364);
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-10-23 15:57:26 +02:00
+++ b/storage/ndb/test/run-test/daily-basic-tests.txt	2007-11-07 13:07:43 +01:00
@@ -916,6 +916,10 @@ max-time: 1000
 cmd: test_event
 args: -l 10 -n Bug27169 T1
 
+max-time: 300
+cmd: testNodeRestart
+args: -n Bug31980 T1
+
 # OLD FLEX
 max-time: 500
 cmd: flexBench
Thread
bk commit into 5.1 tree (jonas:1.2673) BUG#31980jonas7 Nov