MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:jonas Date:August 1 2006 2:55pm
Subject:bk commit into 4.1 tree (jonas:1.2514) BUG#21384
View as plain text  
Below is the list of changes that have just been committed into a local
4.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, 2006-08-01 16:55:41+02:00, jonas@stripped +5 -0
  ndb - bug#21384
    handle error in TCKEYREQ during TCINDXREQ better

  ndb/src/kernel/blocks/ERROR_codes.txt@stripped, 2006-08-01 16:55:40+02:00, jonas@stripped +2 -1
    new error code

  ndb/src/kernel/blocks/dbtc/Dbtc.hpp@stripped, 2006-08-01 16:55:40+02:00, jonas@stripped +2 -2
    Add 3 values to isIndexOp

  ndb/src/kernel/blocks/dbtc/DbtcMain.cpp@stripped, 2006-08-01 16:55:40+02:00, jonas@stripped +131 -28
    handle error in TCKEYREQ during TCINDXREQ

  ndb/test/ndbapi/testIndex.cpp@stripped, 2006-08-01 16:55:40+02:00, jonas@stripped +52 -0
    Add testcase

  ndb/test/run-test/daily-basic-tests.txt@stripped, 2006-08-01 16:55:40+02:00, jonas@stripped +4 -0
    Add testcase

# 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/41-work

--- 1.32/ndb/test/run-test/daily-basic-tests.txt	2006-08-01 16:55:44 +02:00
+++ 1.33/ndb/test/run-test/daily-basic-tests.txt	2006-08-01 16:55:44 +02:00
@@ -474,6 +474,10 @@
 cmd: testNodeRestart
 args: -n Bug20185 T1
 
+max-time: 1000
+cmd: testIndex
+args: -n Bug21384
+
 # OLD FLEX
 max-time: 500
 cmd: flexBench

--- 1.17/ndb/src/kernel/blocks/ERROR_codes.txt	2006-08-01 16:55:44 +02:00
+++ 1.18/ndb/src/kernel/blocks/ERROR_codes.txt	2006-08-01 16:55:44 +02:00
@@ -6,7 +6,7 @@
 Next DBLQH 5043
 Next DBDICT 6006
 Next DBDIH 7174
-Next DBTC 8037
+Next DBTC 8038
 Next CMVMI 9000
 Next BACKUP 10022
 Next DBUTIL 11002
@@ -281,6 +281,7 @@
 
 8032: No free TC records any more
 
+8037 : Invalid schema version in TCINDXREQ
 
 CMVMI
 -----

--- 1.24/ndb/src/kernel/blocks/dbtc/Dbtc.hpp	2006-08-01 16:55:44 +02:00
+++ 1.25/ndb/src/kernel/blocks/dbtc/Dbtc.hpp	2006-08-01 16:55:44 +02:00
@@ -718,7 +718,7 @@
     
     // Index data
     
-    bool isIndexOp;      // Used to mark on-going TcKeyReq as indx table access
+    Uint8 isIndexOp;      // Used to mark on-going TcKeyReq as indx table access
     bool indexOpReturn;
     UintR noIndexOp;     // No outstanding index ops
 
@@ -806,7 +806,7 @@
     UintR savedState[LqhKeyConf::SignalLength];
     
     // Index data
-    bool isIndexOp; // Used to mark on-going TcKeyReq as index table access
+    Uint8 isIndexOp; // Used to mark on-going TcKeyReq as index table access
     UintR indexOp;
     UintR currentIndexId;
     UintR attrInfoLen;

--- 1.67/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp	2006-08-01 16:55:44 +02:00
+++ 1.68/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp	2006-08-01 16:55:44 +02:00
@@ -1757,8 +1757,7 @@
   apiConnectptr.i = signal->theData[0];
   tmaxData = 20;
   if (apiConnectptr.i >= capiConnectFilesize) {
-    jam();
-    warningHandlerLab(signal);
+    TCKEY_abort(signal, 18);
     return;
   }//if
   ptrAss(apiConnectptr, apiConnectRecord);
@@ -1767,9 +1766,7 @@
   compare_transid2 = apiConnectptr.p->transid[1] ^ signal->theData[2];
   compare_transid1 = compare_transid1 | compare_transid2;
   if (compare_transid1 != 0) {
-    jam();
-    printState(signal, 10);
-    sendSignalErrorRefuseLab(signal);
+    TCKEY_abort(signal, 19);
     return;
   }//if
   switch (apiConnectptr.p->apiConnectstate) {
@@ -2467,7 +2464,7 @@
   Uint32 TstartFlag = tcKeyReq->getStartFlag(Treqinfo);
   Uint32 TexecFlag = TcKeyReq::getExecuteFlag(Treqinfo);
 
-  bool isIndexOp = regApiPtr->isIndexOp;
+  Uint8 isIndexOp = regApiPtr->isIndexOp;
   bool isIndexOpReturn = regApiPtr->indexOpReturn;
   regApiPtr->isIndexOp = false; // Reset marker
   regApiPtr->m_exec_flag |= TexecFlag;
@@ -3210,7 +3207,7 @@
   sig1 = regCachePtr->fragmentid + (regTcPtr->tcNodedata[1] << 16);
   sig2 = regApiPtr->transid[0];
   sig3 = regApiPtr->transid[1];
-  sig4 = regApiPtr->ndbapiBlockref;
+  sig4 = (regTcPtr->isIndexOp == 2) ? reference() : regApiPtr->ndbapiBlockref;
   sig5 = regTcPtr->clientData;
   sig6 = regCachePtr->scanInfo;
 
@@ -8551,6 +8548,7 @@
       // left over from simple/dirty read
     } else {
       jam();
+      jamLine(transP->apiConnectstate);
       errCode = ZSTATE_ERROR;
       goto SCAN_TAB_error_no_state_change;
     }
@@ -11915,14 +11913,18 @@
 			     opType == ZREAD ? ZREAD : ZREAD_EX);
   TcKeyReq::setAIInTcKeyReq(tcKeyRequestInfo, 1); // Allways send one AttrInfo
   TcKeyReq::setExecutingTrigger(tcKeyRequestInfo, 0);
-  BlockReference originalReceiver = regApiPtr->ndbapiBlockref;
-  regApiPtr->ndbapiBlockref = reference(); // Send result to me
   tcKeyReq->senderData = indexOp->indexOpId;
   indexOp->indexOpState = IOS_INDEX_ACCESS;
   regApiPtr->executingIndexOp = regApiPtr->accumulatingIndexOp;
   regApiPtr->accumulatingIndexOp = RNIL;
-  regApiPtr->isIndexOp = true;
+  regApiPtr->isIndexOp = 2;
 
+  if (ERROR_INSERTED(8037))
+  {
+    ndbout_c("shifting index version");
+    tcKeyReq->tableSchemaVersion = ~(Uint32)indexOp->tcIndxReq.indexSchemaVersion;
+  }
+  
   Uint32 remainingKey = indexOp->keyInfo.getSize();
   bool moreKeyData = indexOp->keyInfo.first(keyIter);
   // *********** KEYINFO in TCKEYREQ ***********
@@ -11941,21 +11943,13 @@
   ndbassert(TcKeyReq::getDirtyFlag(tcKeyRequestInfo) == 0);
   ndbassert(TcKeyReq::getSimpleFlag(tcKeyRequestInfo) == 0);
   EXECUTE_DIRECT(DBTC, GSN_TCKEYREQ, signal, tcKeyLength);
- 
-  /**
-   * "Fool" TC not to start commiting transaction since it always will
-   *   have one outstanding lqhkeyreq
-   * This is later decreased when the index read is complete
-   */ 
-  regApiPtr->lqhkeyreqrec++;
+  jamEntry();
 
-  /**
-   * Remember ptr to index read operation
-   *   (used to set correct save point id on index operation later)
-   */
-  indexOp->indexReadTcConnect = regApiPtr->lastTcConnect;
+  if (unlikely(regApiPtr->apiConnectstate == CS_ABORTING))
+  {
+    goto err;
+  }
 
-  jamEntry();
   // *********** KEYINFO ***********
   if (moreKeyData) {
     jam();
@@ -11975,6 +11969,10 @@
 	EXECUTE_DIRECT(DBTC, GSN_KEYINFO, signal, 
 		       KeyInfo::HeaderLength + KeyInfo::DataLength);
         jamEntry();
+	if (unlikely(regApiPtr->apiConnectstate == CS_ABORTING))
+	{
+	  goto err;
+	}
 	dataPos = 0;
 	dataPtr = (Uint32 *) &keyInfo->keyData;
       }       
@@ -11985,10 +11983,32 @@
       EXECUTE_DIRECT(DBTC, GSN_KEYINFO, signal,
 		     KeyInfo::HeaderLength + dataPos);
       jamEntry();
+      if (unlikely(regApiPtr->apiConnectstate == CS_ABORTING))
+      {
+	goto err;
+      }
     }
   }
   
-  regApiPtr->ndbapiBlockref = originalReceiver; // reset original receiver
+  /**
+   * "Fool" TC not to start commiting transaction since it always will
+   *   have one outstanding lqhkeyreq
+   * This is later decreased when the index read is complete
+   */ 
+  regApiPtr->lqhkeyreqrec++;
+
+  /**
+   * Remember ptr to index read operation
+   *   (used to set correct save point id on index operation later)
+   */
+  indexOp->indexReadTcConnect = regApiPtr->lastTcConnect;
+  
+done:  
+  return;
+  
+err:
+  jam();
+  goto done;
 }
 
 /**
@@ -12039,7 +12059,7 @@
   tcKeyReq->transId2 = regApiPtr->transid[1];
   tcKeyReq->senderData = tcIndxReq->senderData; // Needed for TRANSID_AI to API
   indexOp->indexOpState = IOS_INDEX_OPERATION;
-  regApiPtr->isIndexOp = true;
+  regApiPtr->isIndexOp = 1;
   regApiPtr->executingIndexOp = indexOp->indexOpId;;
   regApiPtr->noIndexOp++; // Increase count
 
@@ -12112,9 +12132,16 @@
   const Uint32 currSavePointId = regApiPtr->currSavePointId;
   regApiPtr->currSavePointId = tmp.p->savePointId;
   EXECUTE_DIRECT(DBTC, GSN_TCKEYREQ, signal, tcKeyLength);
+  jamEntry();
+  
+  if (unlikely(regApiPtr->apiConnectstate == CS_ABORTING))
+  {
+    jam();
+    return;
+  }
+
   regApiPtr->currSavePointId = currSavePointId;
   
-  jamEntry();
   // *********** KEYINFO ***********
   if (moreKeyData) {
     jam();
@@ -12135,6 +12162,13 @@
 	EXECUTE_DIRECT(DBTC, GSN_KEYINFO, signal, 
 		       KeyInfo::HeaderLength + KeyInfo::DataLength);
         jamEntry();
+
+	if (unlikely(regApiPtr->apiConnectstate == CS_ABORTING))
+	{
+	  jam();
+	  return;
+	}
+
 	dataPos = 0;
 	dataPtr = (Uint32 *) &keyInfo->keyData;
       }
@@ -12145,6 +12179,12 @@
       EXECUTE_DIRECT(DBTC, GSN_KEYINFO, signal,
 		     KeyInfo::HeaderLength + dataPos);
       jamEntry();
+
+      if (unlikely(regApiPtr->apiConnectstate == CS_ABORTING))
+      {
+	jam();
+	return;
+      }
     }
   }
   
@@ -12174,6 +12214,13 @@
         EXECUTE_DIRECT(DBTC, GSN_ATTRINFO, signal,
 		       AttrInfo::HeaderLength + AttrInfo::DataLength);
         jamEntry();
+
+	if (unlikely(regApiPtr->apiConnectstate == CS_ABORTING))
+	{
+	  jam();
+	  return;
+	}
+
         attrInfoPos = 0;
 	dataPtr = (Uint32 *) &attrInfo->attrData;
       }
@@ -12573,9 +12620,16 @@
   const Uint32 currSavePointId = regApiPtr->currSavePointId;
   regApiPtr->currSavePointId = opRecord->savePointId;
   EXECUTE_DIRECT(DBTC, GSN_TCKEYREQ, signal, tcKeyLength);
+  jamEntry();
+
+  if (unlikely(regApiPtr->apiConnectstate == CS_ABORTING))
+  {
+    jam();
+    return;
+  }
+
   regApiPtr->currSavePointId = currSavePointId;
   tcConnectptr.p->currentIndexId = indexData->indexId;
-  jamEntry();
 
   // *********** KEYINFO ***********
   if (moreKeyData) {
@@ -12605,6 +12659,12 @@
 		       KeyInfo::HeaderLength + KeyInfo::DataLength);
         jamEntry();
 #endif
+	if (unlikely(regApiPtr->apiConnectstate == CS_ABORTING))
+	{
+	  jam();
+	  return;
+	}
+	
 	dataPtr = (Uint32 *) &keyInfo->keyData;
 	dataPos = 0;
       }
@@ -12640,6 +12700,13 @@
 			 KeyInfo::HeaderLength + KeyInfo::DataLength);
           jamEntry();
 #endif
+
+	  if (unlikely(regApiPtr->apiConnectstate == CS_ABORTING))
+	  {
+	    jam();
+	    return;
+	  }
+
 	  dataPtr = (Uint32 *) &keyInfo->keyData;	  
           dataPos = 0;
         }       
@@ -12657,6 +12724,11 @@
 		     KeyInfo::HeaderLength + dataPos);
       jamEntry();
 #endif
+      if (unlikely(regApiPtr->apiConnectstate == CS_ABORTING))
+      {
+	jam();
+	return;
+      }
     }
   }
   
@@ -12692,6 +12764,12 @@
 		       AttrInfo::HeaderLength + AttrInfo::DataLength);
         jamEntry();
 #endif
+	if (unlikely(regApiPtr->apiConnectstate == CS_ABORTING))
+	{
+	  jam();
+	  return;
+	}
+
 	dataPtr = (Uint32 *) &attrInfo->attrData;
 	attrInfoPos = 0;
       }
@@ -12728,6 +12806,12 @@
 			 AttrInfo::HeaderLength + AttrInfo::DataLength);
           jamEntry();
 #endif
+	  if (unlikely(regApiPtr->apiConnectstate == CS_ABORTING))
+	  {
+	    jam();
+	    return;
+	  }
+	  
 	  dataPtr = (Uint32 *) &attrInfo->attrData;	  
           attrInfoPos = 0;
         }       
@@ -12873,9 +12957,16 @@
   const Uint32 currSavePointId = regApiPtr->currSavePointId;
   regApiPtr->currSavePointId = opRecord->savePointId;
   EXECUTE_DIRECT(DBTC, GSN_TCKEYREQ, signal, tcKeyLength);
+  jamEntry();
+
+  if (unlikely(regApiPtr->apiConnectstate == CS_ABORTING))
+  {
+    jam();
+    return;
+  }
+
   regApiPtr->currSavePointId = currSavePointId;
   tcConnectptr.p->currentIndexId = indexData->indexId;
-  jamEntry();
 
   // *********** KEYINFO ***********
   if (moreKeyData) {
@@ -12906,6 +12997,12 @@
 		       KeyInfo::HeaderLength + KeyInfo::DataLength);
         jamEntry();
 #endif
+	if (unlikely(regApiPtr->apiConnectstate == CS_ABORTING))
+	{
+	  jam();
+	  return;
+	}
+
 	dataPtr = (Uint32 *) &keyInfo->keyData;
 	dataPos = 0;
       }
@@ -12942,6 +13039,12 @@
 			 KeyInfo::HeaderLength + KeyInfo::DataLength);
           jamEntry();
 #endif
+	  if (unlikely(regApiPtr->apiConnectstate == CS_ABORTING))
+	  {
+	    jam();
+	    return;
+	  }
+
 	  dataPtr = (Uint32 *) &keyInfo->keyData;	  
           dataPos = 0;
         }       

--- 1.13/ndb/test/ndbapi/testIndex.cpp	2006-08-01 16:55:44 +02:00
+++ 1.14/ndb/test/ndbapi/testIndex.cpp	2006-08-01 16:55:44 +02:00
@@ -1201,6 +1201,48 @@
   return NDBT_OK;
 }
 
+int 
+runBug21384(NDBT_Context* ctx, NDBT_Step* step)
+{
+  Ndb* pNdb = GETNDB(step);
+  HugoTransactions hugoTrans(*ctx->getTab());
+  NdbRestarter restarter;
+  
+  int loops = ctx->getNumLoops();
+  const int rows = ctx->getNumRecords();
+  const int batchsize = ctx->getProperty("BatchSize", 50);
+  
+  while (loops--)
+  {
+    if(restarter.insertErrorInAllNodes(8037) != 0)
+    {
+      g_err << "Failed to error insert(8037)" << endl;
+      return NDBT_FAILED;
+    }
+    
+    if (hugoTrans.indexReadRecords(pNdb, pkIdxName, rows, batchsize) == 0)
+    {
+      g_err << "Index succeded (it should have failed" << endl;
+      return NDBT_FAILED;
+    }
+    
+    if(restarter.insertErrorInAllNodes(0) != 0)
+    {
+      g_err << "Failed to error insert(0)" << endl;
+      return NDBT_FAILED;
+    }
+    
+    if (hugoTrans.indexReadRecords(pNdb, pkIdxName, rows, batchsize) != 0){
+      g_err << "Index read failed" << endl;
+      return NDBT_FAILED;
+    }
+  }
+  
+  return NDBT_OK;
+}
+
+
+
 NDBT_TESTSUITE(testIndex);
 TESTCASE("CreateAll", 
 	 "Test that we can create all various indexes on each table\n"
@@ -1504,6 +1546,16 @@
   STEP(runUniqueNullTransactions);
   FINALIZER(runVerifyIndex);
   FINALIZER(createRandomIndex_Drop);
+  FINALIZER(createPkIndex_Drop);
+  FINALIZER(runClearTable);
+}
+TESTCASE("Bug21384", 
+	 "Test that unique indexes and nulls"){ 
+  TC_PROPERTY("LoggedIndexes", (unsigned)0);
+  INITIALIZER(runClearTable);
+  INITIALIZER(createPkIndex);
+  INITIALIZER(runLoadTable);
+  STEP(runBug21384);
   FINALIZER(createPkIndex_Drop);
   FINALIZER(runClearTable);
 }
Thread
bk commit into 4.1 tree (jonas:1.2514) BUG#21384jonas1 Aug