List:Commits« Previous MessageNext Message »
From:jonas Date:November 21 2006 1:14pm
Subject:bk commit into 5.0 tree (jonas:1.2268)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 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, 2006-11-21 14:14:43+01:00, jonas@stripped +4 -0
  Merge perch.ndb.mysql.com:/home/jonas/src/41-work
  into  perch.ndb.mysql.com:/home/jonas/src/50-work
  MERGE: 1.1616.2144.206

  ndb/src/kernel/blocks/ERROR_codes.txt@stripped, 2006-11-21 14:11:02+01:00, jonas@stripped +0 -0
    Auto merged
    MERGE: 1.8.1.13

  ndb/src/kernel/blocks/dbtc/DbtcMain.cpp@stripped, 2006-11-21 14:11:02+01:00, jonas@stripped +0 -0
    Auto merged
    MERGE: 1.42.1.28

  ndb/test/ndbapi/testScan.cpp@stripped, 2006-11-21 14:14:41+01:00, jonas@stripped +39 -39
    merge
    MERGE: 1.12.1.2

  ndb/test/run-test/daily-basic-tests.txt@stripped, 2006-11-21 14:14:41+01:00, jonas@stripped +2 -2
    merge
    MERGE: 1.13.2.15

# 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/50-work/RESYNC

--- 1.41/ndb/test/run-test/daily-basic-tests.txt	2006-11-21 14:14:46 +01:00
+++ 1.42/ndb/test/run-test/daily-basic-tests.txt	2006-11-21 14:14:46 +01:00
@@ -414,6 +414,10 @@
 args: -n ScanParallelism
 
 max-time: 500
+cmd: testScan
+args: -n Bug24447 T1
+
+max-time: 500
 cmd: testNodeRestart
 args: -n Bug15587 T1
 

--- 1.23/ndb/src/kernel/blocks/ERROR_codes.txt	2006-11-21 14:14:46 +01:00
+++ 1.24/ndb/src/kernel/blocks/ERROR_codes.txt	2006-11-21 14:14:46 +01:00
@@ -6,7 +6,7 @@
 Next DBLQH 5043
 Next DBDICT 6007
 Next DBDIH 7178
-Next DBTC 8038
+Next DBTC 8039
 Next CMVMI 9000
 Next BACKUP 10022
 Next DBUTIL 11002
@@ -286,6 +286,11 @@
 8032: No free TC records any more
 
 8037 : Invalid schema version in TCINDXREQ
+
+------
+
+8038 : Simulate API disconnect just after SCAN_TAB_REQ
+
 
 CMVMI
 -----

--- 1.98/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp	2006-11-21 14:14:46 +01:00
+++ 1.99/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp	2006-11-21 14:14:46 +01:00
@@ -8701,6 +8701,20 @@
    * IF ANY TO RECEIVE.
    **********************************************************/
   scanptr.p->scanState = ScanRecord::WAIT_AI;
+  
+  if (ERROR_INSERTED(8038))
+  {
+    /**
+     * Force API_FAILREQ
+     */
+    DisconnectRep * const  rep = (DisconnectRep *)signal->getDataPtrSend();
+    rep->nodeId = refToNode(apiConnectptr.p->ndbapiBlockref);
+    rep->err = 8038;
+    
+    EXECUTE_DIRECT(CMVMI, GSN_DISCONNECT_REP, signal, 2);
+    CLEAR_ERROR_INSERT_VALUE;
+  }
+  
   return;
 
  SCAN_error_check:
@@ -8790,6 +8804,7 @@
     jam();
     ScanFragRecPtr ptr;
     ndbrequire(list.seize(ptr));
+    ptr.p->scanFragState = ScanFragRec::IDLE;
     ptr.p->scanRec = scanptr.i;
     ptr.p->scanFragId = 0;
     ptr.p->m_apiPtr = cdata[i];
@@ -9582,9 +9597,17 @@
 
   ScanRecord* scanP = scanPtr.p;
   ndbrequire(scanPtr.p->scanState != ScanRecord::IDLE);  
+  ScanRecord::ScanState old = scanPtr.p->scanState;
   scanPtr.p->scanState = ScanRecord::CLOSING_SCAN;
   scanPtr.p->m_close_scan_req = req_received;
 
+  if (old == ScanRecord::WAIT_FRAGMENT_COUNT)
+  {
+    jam();
+    scanPtr.p->scanState = old;
+    return; // Will continue on execDI_FCOUNTCONF
+  }
+  
   /**
    * Queue         : Action
    * ============= : =================
@@ -9612,11 +9635,22 @@
       ScanFragRecPtr curr = ptr; // Remove while iterating...
       running.next(ptr);
 
-      if(curr.p->scanFragState == ScanFragRec::WAIT_GET_PRIMCONF){
+      switch(curr.p->scanFragState){
+      case ScanFragRec::IDLE:
+	jam(); // real early abort
+	ndbrequire(old == ScanRecord::WAIT_AI);
+	running.release(curr);
+	continue;
+      case ScanFragRec::WAIT_GET_PRIMCONF:
 	jam();
 	continue;
+      case ScanFragRec::LQH_ACTIVE:
+	jam();
+	break;
+      default:
+	jamLine(curr.p->scanFragState);
+	ndbrequire(false);
       }
-      ndbrequire(curr.p->scanFragState == ScanFragRec::LQH_ACTIVE);
       
       curr.p->startFragTimer(ctcTimer);
       curr.p->scanFragState = ScanFragRec::LQH_ACTIVE;

--- 1.17/ndb/test/ndbapi/testScan.cpp	2006-11-21 14:14:46 +01:00
+++ 1.18/ndb/test/ndbapi/testScan.cpp	2006-11-21 14:14:46 +01:00
@@ -630,7 +630,7 @@
     
     int nodeId = restarter.getDbNodeId(lastId);
     lastId = (lastId + 1) % restarter.getNumDbNodes();
-    if(restarter.restartOneDbNode(nodeId) != 0){
+    if(restarter.restartOneDbNode(nodeId, false, false, true) != 0){
       g_err << "Failed to restartNextDbNode" << endl;
       result = NDBT_FAILED;
       break;
@@ -1125,6 +1125,39 @@
   return NDBT_OK;
 }
 
+int
+runBug24447(NDBT_Context* ctx, NDBT_Step* step){
+  int loops = 1; //ctx->getNumLoops();
+  int records = ctx->getNumRecords();
+  int abort = ctx->getProperty("AbortProb", 15);
+  NdbRestarter restarter;
+  HugoTransactions hugoTrans(*ctx->getTab());
+  int i = 0;
+  while (i<loops && !ctx->isTestStopped()) 
+  {
+    g_info << i++ << ": ";
+
+    int nodeId = restarter.getRandomNotMasterNodeId(rand());
+    if (nodeId == -1)
+      nodeId = restarter.getMasterNodeId();
+    if (restarter.insertErrorInNode(nodeId, 8038) != 0)
+    {
+      ndbout << "Could not insert error in node="<<nodeId<<endl;
+      return NDBT_FAILED;
+    }
+
+    for (Uint32 j = 0; i<10; i++)
+    {
+      hugoTrans.scanReadRecords(GETNDB(step), records, abort, 0, 
+				NdbOperation::LM_CommittedRead);
+    }
+
+  }
+  restarter.insertErrorInAllNodes(0);
+  
+  return NDBT_OK;
+}
+
 NDBT_TESTSUITE(testScan);
 TESTCASE("ScanRead", 
 	 "Verify scan requirement: It should be possible "\
@@ -1601,6 +1634,12 @@
 	 "Test scan with different parallelism"){
   INITIALIZER(runLoadTable);
   STEP(runScanParallelism);
+  FINALIZER(runClearTable);
+}
+TESTCASE("Bug24447",
+	 ""){
+  INITIALIZER(runLoadTable);
+  STEP(runBug24447);
   FINALIZER(runClearTable);
 }
 NDBT_TESTSUITE_END(testScan);
Thread
bk commit into 5.0 tree (jonas:1.2268)jonas21 Nov