List:Commits« Previous MessageNext Message »
From:Jonas Oreland Date:February 27 2009 4:07pm
Subject:bzr commit into mysql-5.1-telco-6.3 branch (jonas:2889)
View as plain text  
#At file:///home/jonas/src/telco-6.3/

 2889 Jonas Oreland	2009-02-27 [merge]
      merge 62 to 63
modified:
  storage/ndb/include/kernel/signaldata/BuildIndx.hpp
  storage/ndb/src/kernel/blocks/dbutil/DbUtil.cpp
  storage/ndb/src/kernel/blocks/dbutil/DbUtil.hpp
  storage/ndb/src/kernel/blocks/trix/Trix.cpp
  storage/ndb/src/ndbapi/ndberror.c
  storage/ndb/test/ndbapi/testIndex.cpp
  storage/ndb/test/run-test/daily-basic-tests.txt
  storage/ndb/test/run-test/daily-devel-tests.txt

=== modified file 'storage/ndb/include/kernel/signaldata/BuildIndx.hpp'
--- a/storage/ndb/include/kernel/signaldata/BuildIndx.hpp	2006-12-23 19:20:40 +0000
+++ b/storage/ndb/include/kernel/signaldata/BuildIndx.hpp	2009-02-27 13:18:49 +0000
@@ -239,7 +239,8 @@ public:
     InvalidIndexType = 4250,
     IndexNotUnique = 4251,
     AllocationFailure = 4252,
-    InternalError = 4346
+    InternalError = 4346,
+    DeadlockError = 4351
   };
   STATIC_CONST( SignalLength = BuildIndxConf::SignalLength + 2 );
 

=== modified file 'storage/ndb/src/kernel/blocks/dbutil/DbUtil.cpp'
--- a/storage/ndb/src/kernel/blocks/dbutil/DbUtil.cpp	2009-02-18 20:52:35 +0000
+++ b/storage/ndb/src/kernel/blocks/dbutil/DbUtil.cpp	2009-02-27 15:07:04 +0000
@@ -1097,7 +1097,6 @@ DbUtil::prepareOperation(Signal* signal,
   Uint32 noOfPKAttribsStored = 0;
   Uint32 noOfNonPKAttribsStored = 0;
   Uint32 attrLength = 0;
-  Uint32 pkAttrLength = 0;
   char attrNameRequested[MAX_ATTR_NAME_SIZE];
   Uint32 attrIdRequested;
 
@@ -1248,8 +1247,6 @@ DbUtil::prepareOperation(Signal* signal,
 	break;
       }
       attrLength += len;
-      if (attrDesc.AttributeKeyFlag)
-	pkAttrLength += len;
 
       if (operationType == UtilPrepareReq::Read) {
 	AttributeHeader::init(rsInfoIt.data, 
@@ -1299,14 +1296,7 @@ DbUtil::prepareOperation(Signal* signal,
   prepOpPtr.p->tckey.tableId = tableDesc.TableId;
   prepOpPtr.p->tckey.tableSchemaVersion = tableDesc.TableVersion;
   prepOpPtr.p->noOfKeyAttr = tableDesc.NoOfKeyAttr;
-  prepOpPtr.p->keyLen = tableDesc.KeyLength; // Total no of words in PK
-  if (prepOpPtr.p->keyLen > TcKeyReq::MaxKeyInfo) {
-    jam();
-    prepOpPtr.p->tckeyLenInBytes = (static_len + TcKeyReq::MaxKeyInfo) * 4;
-  } else {
-    jam();
-    prepOpPtr.p->tckeyLenInBytes = (static_len + prepOpPtr.p->keyLen) * 4;
-  }
+  prepOpPtr.p->tckeyLen = static_len;
   prepOpPtr.p->keyDataPos = static_len;  // Start of keyInfo[] in tckeyreq
   
   Uint32 requestInfo = 0;
@@ -1415,14 +1405,13 @@ DbUtil::hardcodedPrepare() {
   /**
    * Prepare SequenceCurrVal (READ)
    */
+  Uint32 keyLen = 1;
   {
     PreparedOperationPtr ptr;
     ndbrequire(c_preparedOperationPool.seizeId(ptr, 0));
-    ptr.p->keyLen = 1;
     ptr.p->tckey.attrLen = 1;
     ptr.p->rsLen = 3;
-    ptr.p->tckeyLenInBytes = (TcKeyReq::StaticLength +
-                              ptr.p->keyLen + ptr.p->tckey.attrLen) * 4;
+    ptr.p->tckeyLen = TcKeyReq::StaticLength + keyLen + ptr.p->tckey.attrLen;
     ptr.p->keyDataPos = TcKeyReq::StaticLength; 
     ptr.p->tckey.tableId = 0;
     Uint32 requestInfo = 0;
@@ -1448,9 +1437,8 @@ DbUtil::hardcodedPrepare() {
   {
     PreparedOperationPtr ptr;
     ndbrequire(c_preparedOperationPool.seizeId(ptr, 1));
-    ptr.p->keyLen = 1;
     ptr.p->rsLen = 3;
-    ptr.p->tckeyLenInBytes = (TcKeyReq::StaticLength + ptr.p->keyLen + 5) * 4;
+    ptr.p->tckeyLen = TcKeyReq::StaticLength + keyLen + 5;
     ptr.p->keyDataPos = TcKeyReq::StaticLength; 
     ptr.p->tckey.attrLen = 11;
     ptr.p->tckey.tableId = 0;
@@ -1504,11 +1492,9 @@ DbUtil::hardcodedPrepare() {
   {
     PreparedOperationPtr ptr;
     ndbrequire(c_preparedOperationPool.seizeId(ptr, 2));
-    ptr.p->keyLen = 1;
     ptr.p->tckey.attrLen = 5;
     ptr.p->rsLen = 0;
-    ptr.p->tckeyLenInBytes = (TcKeyReq::StaticLength +
-                              ptr.p->keyLen + ptr.p->tckey.attrLen) * 4;
+    ptr.p->tckeyLen = TcKeyReq::StaticLength + keyLen + ptr.p->tckey.attrLen;
     ptr.p->keyDataPos = TcKeyReq::StaticLength;
     ptr.p->tckey.tableId = 0;
     Uint32 requestInfo = 0;
@@ -1526,9 +1512,8 @@ DbUtil::hardcodedPrepare() {
   {
     PreparedOperationPtr ptr;
     ndbrequire(c_preparedOperationPool.seizeId(ptr, 3));
-    ptr.p->keyLen = 1;
     ptr.p->rsLen = 0;
-    ptr.p->tckeyLenInBytes = (TcKeyReq::StaticLength + ptr.p->keyLen + 5) * 4;
+    ptr.p->tckeyLen = TcKeyReq::StaticLength + keyLen + 5;
     ptr.p->keyDataPos = TcKeyReq::StaticLength;
     ptr.p->tckey.attrLen = 9;
     ptr.p->tckey.tableId = 0;
@@ -1587,7 +1572,7 @@ DbUtil::execUTIL_SEQUENCE_REQ(Signal* si
   ndbrequire(transPtr.p->operations.seize(opPtr));
   
   ndbrequire(opPtr.p->rs.seize(prepOp->rsLen));
-  ndbrequire(opPtr.p->keyInfo.seize(prepOp->keyLen));
+  ndbrequire(opPtr.p->keyInfo.seize(1));
 
   transPtr.p->gsn = GSN_UTIL_SEQUENCE_REQ;
   transPtr.p->clientRef = signal->senderBlockRef();
@@ -1853,7 +1838,7 @@ DbUtil::execUTIL_EXECUTE_REQ(Signal* sig
   ndbrequire(transPtr.p->operations.seize(opPtr));
   opPtr.p->prepOp   = prepOpPtr.p;
   opPtr.p->prepOp_i = prepOpPtr.i;
-  
+
 #if 0 //def EVENT_DEBUG
   printf("opPtr.p->rs.seize( %u )\n", prepOpPtr.p->rsLen);
 #endif
@@ -1928,13 +1913,6 @@ DbUtil::execUTIL_EXECUTE_REQ(Signal* sig
     return;
   }
 
-  // quick hack for hash index build
-  if (TcKeyReq::getOperationType(prepOpPtr.p->tckey.requestInfo) != ZREAD){
-    prepOpPtr.p->tckey.attrLen =
-      prepOpPtr.p->attrInfo.getSize() + opPtr.p->attrInfo.getSize();
-    TcKeyReq::setKeyLength(prepOpPtr.p->tckey.requestInfo, keyInfo->getSize());
-  }
-
 #if 0
   const Uint32 l1 = prepOpPtr.p->tckey.attrLen;
   const Uint32 l2 = 
@@ -2018,7 +1996,7 @@ DbUtil::runOperation(Signal* signal, Tra
   
   TcKeyReq * tcKey = (TcKeyReq*)signal->getDataPtrSend();
   //ndbout << "*** 6 ***"<< endl; pop->print();
-  memcpy(tcKey, &pop->tckey, pop->tckeyLenInBytes);
+  memcpy(tcKey, &pop->tckey, 4*pop->tckeyLen);
   //ndbout << "*** 6b ***"<< endl; 
   //printTCKEYREQ(stdout, signal->getDataPtrSend(), 
   //              pop->tckeyLenInBytes >> 2, 0);
@@ -2035,7 +2013,12 @@ DbUtil::runOperation(Signal* signal, Tra
   printf("DbUtil::runOperation: ATTRINFO\n");
   op->attrInfo.print(stdout);
 #endif
-
+  
+  Uint32 attrLen = pop->attrInfo.getSize() + op->attrInfo.getSize();
+  Uint32 keyLen = op->keyInfo.getSize();
+  tcKey->attrLen = attrLen + TcKeyReq::getAIInTcKeyReq(tcKey->requestInfo);
+  TcKeyReq::setKeyLength(tcKey->requestInfo, keyLen);
+  
   /**
    * Key Info
    */
@@ -2049,12 +2032,13 @@ DbUtil::runOperation(Signal* signal, Tra
   //ndbout << "*** 7 ***" << endl;
   //printTCKEYREQ(stdout, signal->getDataPtrSend(), 
   //		pop->tckeyLenInBytes >> 2, 0);
-
+  
 #if 0 //def EVENT_DEBUG
-    printf("DbUtil::runOperation: sendSignal(DBTC_REF, GSN_TCKEYREQ, signal, %d ,
JBB)\n",  pop->tckeyLenInBytes >> 2);
-    printTCKEYREQ(stdout, signal->getDataPtr(), pop->tckeyLenInBytes >> 2,0);
+  printf("DbUtil::runOperation: sendSignal(DBTC_REF, GSN_TCKEYREQ, signal, %d , JBB)\n", 
pop->tckeyLenInBytes >> 2);
+  printTCKEYREQ(stdout, signal->getDataPtr(), pop->tckeyLenInBytes >> 2,0);
 #endif
-  sendSignal(DBTC_REF, GSN_TCKEYREQ, signal, pop->tckeyLenInBytes >> 2, JBB);
+  Uint32 sigLen = pop->tckeyLen + (keyLen > 8 ? 8 : keyLen);
+  sendSignal(DBTC_REF, GSN_TCKEYREQ, signal, sigLen, JBB);
   
   /**
    * More the 8 words of key info not implemented

=== modified file 'storage/ndb/src/kernel/blocks/dbutil/DbUtil.hpp'
--- a/storage/ndb/src/kernel/blocks/dbutil/DbUtil.hpp	2007-12-23 12:52:25 +0000
+++ b/storage/ndb/src/kernel/blocks/dbutil/DbUtil.hpp	2009-02-27 15:07:04 +0000
@@ -211,7 +211,6 @@ public:
     }
 
     /*** Various Operation Info ***/
-    Uint32    keyLen;          // Length of primary key (fixed size is assumed)
     Uint32    rsLen;           // Size of result set
     Uint32    noOfKeyAttr;     // Number of key attributes
     Uint32    noOfAttr;        // Number of attributes
@@ -233,7 +232,7 @@ public:
     AttrMappingBuffer    attrMapping;
 
     /*** First signal in tckeyreq train ***/
-    Uint32    tckeyLenInBytes;    // TcKeyReq total signal length (in bytes)
+    Uint32    tckeyLen;           // TcKeyReq total signal length
     Uint32    keyDataPos;         // Where to store keydata[] in tckey signal
                                   // (in #words from base in tckey signal)
     TcKeyReq  tckey;              // Signaldata for first signal in train
@@ -254,11 +253,10 @@ public:
     
     void print() const {
       ndbout << "[-PreparedOperation-" << endl
-	     << " keyLen: " << keyLen
 	     << ", rsLen: " << rsLen
 	     << ", noOfKeyAttr: " << noOfKeyAttr 
 	     << ", noOfAttr: " << noOfAttr 
-	     << ", tckeyLenInBytes: " << tckeyLenInBytes 
+	     << ", tckeyLen: " << tckeyLen 
 	     << ", keyDataPos: " << keyDataPos << endl
 	     << "-AttrMapping- (AttrId, KeyPos)-pairs "
 	     << "(Pos=3fff if non-key attr):" << endl;

=== modified file 'storage/ndb/src/kernel/blocks/trix/Trix.cpp'
--- a/storage/ndb/src/kernel/blocks/trix/Trix.cpp	2008-09-30 08:23:31 +0000
+++ b/storage/ndb/src/kernel/blocks/trix/Trix.cpp	2009-02-27 15:07:04 +0000
@@ -34,6 +34,17 @@
 
 #define CONSTRAINT_VIOLATION 893
 
+static
+bool
+check_timeout(Uint32 errCode)
+{
+  switch(errCode){
+  case 266:
+    return true;
+  }
+  return false;
+}
+
 #define DEBUG(x) { ndbout << "TRIX::" << x << endl; }
 
 /**
@@ -604,9 +615,20 @@ void Trix::execUTIL_EXECUTE_REF(Signal* 
   subRecPtr.p = subRec;
   ndbrequire(utilExecuteRef->errorCode == UtilExecuteRef::TCError);
   if(utilExecuteRef->TCErrorCode == CONSTRAINT_VIOLATION)
+  {
+    jam();
     buildFailed(signal, subRecPtr, BuildIndxRef::IndexNotUnique);
+  }
+  else if (check_timeout(utilExecuteRef->TCErrorCode))
+  {
+    jam();
+    buildFailed(signal, subRecPtr, BuildIndxRef::DeadlockError);
+  }
   else
+  {
+    jam();
     buildFailed(signal, subRecPtr, BuildIndxRef::InternalError);
+  }
 }
 
 void Trix::execSUB_CREATE_CONF(Signal* signal)

=== modified file 'storage/ndb/src/ndbapi/ndberror.c'
--- a/storage/ndb/src/ndbapi/ndberror.c	2009-02-10 06:53:05 +0000
+++ b/storage/ndb/src/ndbapi/ndberror.c	2009-02-27 15:07:04 +0000
@@ -288,6 +288,7 @@ ErrorBundle ErrorCodes[] = {
   { 4348, DMEC, IE, "Inconsistency detected at alter index" },
   { 4349, DMEC, IE, "Inconsistency detected at index usage" },
   { 4350, DMEC, IE, "Transaction already aborted" },
+  { 4351, DMEC, TO, "Timeout/deadlock during index build" },
 
   /**
    * Application error

=== modified file 'storage/ndb/test/ndbapi/testIndex.cpp'
--- a/storage/ndb/test/ndbapi/testIndex.cpp	2008-08-21 22:05:42 +0000
+++ b/storage/ndb/test/ndbapi/testIndex.cpp	2009-02-27 13:18:49 +0000
@@ -199,7 +199,10 @@ int create_index(NDBT_Context* ctx, int 
     ndbout << "FAILED!" << endl;
     const NdbError err = pNdb->getDictionary()->getNdbError();
     ERR(err);
-    if(err.classification == NdbError::ApplicationError)
+    if (err.classification == NdbError::ApplicationError)
+      return SKIP_INDEX;
+
+    if (err.status == NdbError::TemporaryError)
       return SKIP_INDEX;
     
     return NDBT_FAILED;

=== modified file 'storage/ndb/test/run-test/daily-basic-tests.txt'
--- a/storage/ndb/test/run-test/daily-basic-tests.txt	2009-02-23 15:07:48 +0000
+++ b/storage/ndb/test/run-test/daily-basic-tests.txt	2009-02-27 15:07:04 +0000
@@ -274,6 +274,10 @@ max-time: 500
 cmd: testIndex
 args: -n MixedTransaction T1 
 
+max-time: 2500
+cmd: testIndex
+args: -n BuildDuring T6 
+
 #
 # SCAN TESTS
 #

=== modified file 'storage/ndb/test/run-test/daily-devel-tests.txt'
--- a/storage/ndb/test/run-test/daily-devel-tests.txt	2009-02-23 12:37:51 +0000
+++ b/storage/ndb/test/run-test/daily-devel-tests.txt	2009-02-27 13:18:49 +0000
@@ -128,10 +128,6 @@ args: -n NFNR3 T6 T13 
 
 max-time: 2500
 cmd: testIndex
-args: -n BuildDuring T6 
-
-max-time: 2500
-cmd: testIndex
 args: -l 2 -n SR1 T6 T13 
 
 max-time: 2500

Thread
bzr commit into mysql-5.1-telco-6.3 branch (jonas:2889)Jonas Oreland27 Feb 2009