List:Commits« Previous MessageNext Message »
From:Jonas Oreland Date:October 21 2010 11:45am
Subject:bzr commit into mysql-5.1-telco-6.3 branch (jonas:3316)
View as plain text  
#At file:///home/jonas/src/telco-6.3/ based on revid:jonas@stripped

 3316 Jonas Oreland	2010-10-21
      ndb - fix a (very) sporadic crash when event->subscribe() is performed on a table being dropped. Seen in ndb_binlog_variants and autotest

    modified:
      storage/ndb/include/kernel/signaldata/UtilPrepare.hpp
      storage/ndb/src/kernel/blocks/ERROR_codes.txt
      storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp
      storage/ndb/src/kernel/blocks/dbutil/DbUtil.cpp
      storage/ndb/src/kernel/blocks/dbutil/DbUtil.hpp
=== modified file 'storage/ndb/include/kernel/signaldata/UtilPrepare.hpp'
--- a/storage/ndb/include/kernel/signaldata/UtilPrepare.hpp	2009-05-26 18:53:34 +0000
+++ b/storage/ndb/include/kernel/signaldata/UtilPrepare.hpp	2010-10-21 11:45:41 +0000
@@ -129,6 +129,7 @@ class UtilPrepareRef {
   /**
    * Sender(s) / Receiver(s)
    */
+  friend class Dbdict;
   friend class DbUtil;
   friend class Trix;
 
@@ -150,13 +151,14 @@ public:
     MISSING_PROPERTIES_SECTION = 5
   };
 
-  STATIC_CONST( SignalLength = 2 );
+  STATIC_CONST( SignalLength = 3 );
 
   GET_SET_SENDERDATA
   GET_SET_ERRORCODE
 private:
   Uint32 senderData; // MUST be no 1!
   Uint32 errorCode;
+  Uint32 dictErrCode; // If errorCode == DICT_TAB_INFO_ERROR
 };
 
 

=== modified file 'storage/ndb/src/kernel/blocks/ERROR_codes.txt'
--- a/storage/ndb/src/kernel/blocks/ERROR_codes.txt	2010-10-19 18:26:17 +0000
+++ b/storage/ndb/src/kernel/blocks/ERROR_codes.txt	2010-10-21 11:45:41 +0000
@@ -4,7 +4,7 @@ Next NDBFS 2000
 Next DBACC 3002
 Next DBTUP 4032
 Next DBLQH 5060
-Next DBDICT 6025
+Next DBDICT 6026
 Next DBDIH 7229
 Next DBTC 8088
 Next CMVMI 9000

=== modified file 'storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp'
--- a/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp	2010-09-13 14:25:36 +0000
+++ b/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp	2010-10-21 11:45:41 +0000
@@ -401,6 +401,21 @@ void Dbdict::packTableIntoPages(Signal* 
     TableRecordPtr tablePtr;
     c_tableRecordPool.getPtr(tablePtr, tableId);
     packTableIntoPages(w, tablePtr, signal);
+    if (unlikely(signal->theData[0] != 0))
+    {
+      jam();
+      Uint32 err = signal->theData[0];
+      GetTabInfoRef * ref = CAST_PTR(GetTabInfoRef, signal->getDataPtrSend());
+      ref->tableId = c_retrieveRecord.tableId;
+      ref->senderRef = reference();
+      ref->senderData = c_retrieveRecord.m_senderData;
+      ref->errorCode = err;
+      Uint32 dstRef = c_retrieveRecord.blockRef;
+      sendSignal(dstRef, GSN_GET_TABINFOREF, signal, 
+                 GetTabInfoRef::SignalLength, JBB);
+      initRetrieveRecord(0,0,0);
+      return;
+    }
     break;
   }
   case DictTabInfo::Tablespace:
@@ -515,8 +530,21 @@ Dbdict::packTableIntoPages(SimplePropert
     req->fragmentationType = tablePtr.p->fragmentType;
     req->noOfFragments = 0;
     req->primaryTableId = tablePtr.i;
-    EXECUTE_DIRECT(DBDIH, GSN_CREATE_FRAGMENTATION_REQ, signal,
-		   CreateFragmentationReq::SignalLength);
+    if (!ERROR_INSERTED(6025))
+    {
+      EXECUTE_DIRECT(DBDIH, GSN_CREATE_FRAGMENTATION_REQ, signal,
+                     CreateFragmentationReq::SignalLength);
+    }
+    else
+    {
+      signal->theData[0] = CreateFragmentationRef::InvalidPrimaryTable;
+    }
+    Uint32 err = signal->theData[0];
+    if (unlikely(err != 0))
+    {
+      jam();
+      return;
+    }
     ndbrequire(signal->theData[0] == 0);
     Uint16 *data = (Uint16*)&signal->theData[25];
     Uint32 count = 2 + (1 + data[0]) * data[1];
@@ -9900,8 +9928,13 @@ void
 Dbdict::execUTIL_PREPARE_REF(Signal *signal)
 {
   jamEntry();
+  const UtilPrepareRef * ref = CAST_CONSTPTR(UtilPrepareRef, 
+                                             signal->getDataPtr());
+  Uint32 code = ref->errorCode;
+  if (code == UtilPrepareRef::DICT_TAB_INFO_ERROR)
+    code = ref->dictErrCode;
   EVENT_TRACE;
-  ndbrequire(recvSignalUtilReq(signal, 1) == 0);
+  ndbrequire(recvSignalUtilReq(signal, code) == 0);
 }
 
 void Dbdict::execUTIL_EXECUTE_CONF(Signal *signal)

=== modified file 'storage/ndb/src/kernel/blocks/dbutil/DbUtil.cpp'
--- a/storage/ndb/src/kernel/blocks/dbutil/DbUtil.cpp	2009-10-08 10:29:46 +0000
+++ b/storage/ndb/src/kernel/blocks/dbutil/DbUtil.cpp	2010-10-21 11:45:41 +0000
@@ -798,10 +798,12 @@ DbUtil::execUTIL_RELEASE_REF(Signal* sig
 
 void
 DbUtil::sendUtilPrepareRef(Signal* signal, UtilPrepareRef::ErrorCode error, 
-			   Uint32 recipient, Uint32 senderData){
+			   Uint32 recipient, Uint32 senderData,
+                           Uint32 errCode2){
   UtilPrepareRef * ref = (UtilPrepareRef *)signal->getDataPtrSend();
   ref->errorCode = error;
   ref->senderData = senderData;
+  ref->dictErrCode = errCode2;
 
   sendSignal(recipient, GSN_UTIL_PREPARE_REF, signal, 
 	     UtilPrepareRef::SignalLength, JBB);
@@ -1011,7 +1013,8 @@ DbUtil::execGET_TABINFOREF(Signal* signa
   c_runningPrepares.getPtr(prepPtr, prepI);
 
   sendUtilPrepareRef(signal, UtilPrepareRef::DICT_TAB_INFO_ERROR,
-		     prepPtr.p->clientRef, prepPtr.p->clientData);
+		     prepPtr.p->clientRef, prepPtr.p->clientData,
+                     ref->errorCode);
 
   releasePrepare(prepPtr);
 }

=== modified file 'storage/ndb/src/kernel/blocks/dbutil/DbUtil.hpp'
--- a/storage/ndb/src/kernel/blocks/dbutil/DbUtil.hpp	2009-10-09 09:19:46 +0000
+++ b/storage/ndb/src/kernel/blocks/dbutil/DbUtil.hpp	2010-10-21 11:45:41 +0000
@@ -418,7 +418,8 @@ public:
 			SimpleProperties::Reader* reader, 
 			Uint32 senderData);
   void prepareOperation(Signal*, PreparePtr, SegmentedSectionPtr);
-  void sendUtilPrepareRef(Signal*, UtilPrepareRef::ErrorCode, Uint32, Uint32);
+  void sendUtilPrepareRef(Signal*, UtilPrepareRef::ErrorCode, Uint32, Uint32,
+                          Uint32 extraError = 0);
   void sendUtilExecuteRef(Signal*, UtilExecuteRef::ErrorCode, 
 			  Uint32, Uint32, Uint32);
   void releasePrepare(PreparePtr);


Attachment: [text/bzr-bundle] bzr/jonas@mysql.com-20101021114541-wp8zfla4j1jdvjib.bundle
Thread
bzr commit into mysql-5.1-telco-6.3 branch (jonas:3316) Jonas Oreland21 Oct