MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Jonas Oreland Date:December 9 2009 3:29pm
Subject:bzr commit into mysql-5.1-telco-6.3 branch (jonas:3189) Bug#49560
View as plain text  
#At file:///home/jonas/src/telco-6.3/ based on revid:jonas@stripped

 3189 Jonas Oreland	2009-12-09
      ndb - bug#49560 - cleanup error handling wrt Suma not started

    modified:
      storage/ndb/include/kernel/signaldata/SumaImpl.hpp
      storage/ndb/include/ndb_version.h.in
      storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp
      storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp
      storage/ndb/src/kernel/blocks/suma/Suma.cpp
=== modified file 'storage/ndb/include/kernel/signaldata/SumaImpl.hpp'
--- a/storage/ndb/include/kernel/signaldata/SumaImpl.hpp	2009-05-27 12:11:46 +0000
+++ b/storage/ndb/include/kernel/signaldata/SumaImpl.hpp	2009-12-09 15:29:35 +0000
@@ -75,6 +75,7 @@ struct SubCreateRef {
     ,OutOfTableRecords = 1423
     ,TableDropped = 1417
     ,NF_FakeErrorREF = 11
+    ,NotStarted = 1428
   };
 };
 
@@ -138,6 +139,7 @@ struct SubStartRef {
     NotMaster = 702, // For API/DICT communication
     BusyWithNR = 1405,
     NodeDied = 1427
+    ,NotStarted = 1428
   };
 
   STATIC_CONST( SignalLength = 7 );
@@ -221,6 +223,7 @@ struct SubStopRef {
     NoSuchSubscriber = 1426,
     NotMaster = 702,
     BusyWithNR = 1405
+    ,NotStarted = 1428
   };
 
   STATIC_CONST( SignalLength = 8 );
@@ -480,6 +483,7 @@ struct SubRemoveRef {
     NoSuchSubscription = 1407,
     Locked = 1411,
     AlreadyDropped = 1419
+    ,NotStarted = 1428
   };
 
   Uint32 senderRef;

=== modified file 'storage/ndb/include/ndb_version.h.in'
--- a/storage/ndb/include/ndb_version.h.in	2009-11-02 17:09:12 +0000
+++ b/storage/ndb/include/ndb_version.h.in	2009-12-09 15:29:35 +0000
@@ -286,4 +286,29 @@ ndb_delayed_copy_active_req(Uint32 x)
   }
 }
 
+#define NDBD_SUMA_NOTSTARTED_REF_63 NDB_MAKE_VERSION(6,3,29)
+#define NDBD_SUMA_NOTSTARTED_REF_70 NDB_MAKE_VERSION(7,0,10)
+
+static
+inline
+int
+ndb_suma_not_started_ref(Uint32 x)
+{
+  if (x >= NDB_VERSION_D)
+    return 1;
+
+  {
+    const Uint32 major = (x >> 16) & 0xFF;
+
+    if (major >= 6)
+    {
+      return x >= NDBD_SUMA_NOTSTARTED_REF_63;
+    }
+    else
+    {
+      return x >= NDBD_SUMA_NOTSTARTED_REF_70;
+    }
+  }
+}
+
 #endif

=== modified file 'storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp'
--- a/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp	2009-12-08 15:26:29 +0000
+++ b/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp	2009-12-09 15:29:35 +0000
@@ -10992,17 +10992,27 @@ void Dbdict::execSUB_CREATE_REF(Signal* 
   evntRecPtr.i = ref->senderData;
   ndbrequire((evntRecPtr.p = c_opCreateEvent.getPtr(evntRecPtr.i)) != NULL);
 
-  if (ref->errorCode)
+  if (ref->errorCode == SubCreateRef::NotStarted)
   {
+    jam();
+    // ignore (was previously NF_FakeErrorREF)
+    // NOTE: different handling then rest of execSUB_XXX_REF
+    // note to mess with GSN_CREATE_EVNT
+  }
+  else if (ref->errorCode)
+  {
+    jam();
     evntRecPtr.p->m_errorCode = ref->errorCode;
     evntRecPtr.p->m_errorLine = __LINE__;
+    evntRecPtr.p->m_errorNode = reference();
   }
   else
   {
+    jam();
     evntRecPtr.p->m_errorCode = 1;
     evntRecPtr.p->m_errorLine = __LINE__;
+    evntRecPtr.p->m_errorNode = reference();
   }
-  evntRecPtr.p->m_errorNode = reference();
 
   createEvent_sendReply(signal, evntRecPtr);
   DBUG_VOID_RETURN;
@@ -11270,6 +11280,22 @@ busy:
   }
 }
 
+bool
+Dbdict::upgrade_suma_NotStarted(Uint32 err, Uint32 ref) const
+{
+  /**
+   * Check that receiver can handle 1428,
+   *   else return true if error code should be replaced by NF_FakeErrorREF
+   */
+  if (err == 1428)
+  {
+    jam();
+    if (!ndb_suma_not_started_ref(getNodeInfo(refToNode(ref)).m_version))
+      return true;
+  }
+  return false;
+}
+
 void Dbdict::execSUB_START_REF(Signal* signal)
 {
   jamEntry();
@@ -11281,7 +11307,8 @@ void Dbdict::execSUB_START_REF(Signal* s
   OpSubEventPtr subbPtr;
   c_opSubEvent.getPtr(subbPtr, ref->senderData);
 
-  if (refToBlock(senderRef) == SUMA) {
+  if (refToBlock(senderRef) == SUMA)
+  {
     /*
      * Participant
      */
@@ -11291,7 +11318,12 @@ void Dbdict::execSUB_START_REF(Signal* s
     ndbout_c("DBDICT(Participant) got GSN_SUB_START_REF = (%d)", subbPtr.i);
 #endif
 
-    jam();
+    if (upgrade_suma_NotStarted(err, subbPtr.p->m_senderRef))
+    {
+      jam();
+      err = SubStartRef::NF_FakeErrorREF;
+    }
+
     SubStartRef* ref = (SubStartRef*) signal->getDataPtrSend();
     ref->senderRef = reference();
     ref->senderData = subbPtr.p->m_senderData;
@@ -11308,10 +11340,13 @@ void Dbdict::execSUB_START_REF(Signal* s
 #ifdef EVENT_PH3_DEBUG
   ndbout_c("DBDICT(Coordinator) got GSN_SUB_START_REF = (%d)", subbPtr.i);
 #endif
-  if (err == SubStartRef::NF_FakeErrorREF){
+  if (err == SubStartRef::NF_FakeErrorREF || err == SubStartRef::NotStarted)
+  {
     jam();
     subbPtr.p->m_reqTracker.ignoreRef(c_counterMgr, refToNode(senderRef));
-  } else {
+  }
+  else
+  {
     jam();
     if (subbPtr.p->m_errorCode == 0)
     {
@@ -11541,11 +11576,19 @@ void Dbdict::execSUB_STOP_REF(Signal* si
   OpSubEventPtr subbPtr;
   c_opSubEvent.getPtr(subbPtr, ref->senderData);
 
-  if (refToBlock(senderRef) == SUMA) {
+  if (refToBlock(senderRef) == SUMA)
+  {
     /*
      * Participant
      */
     jam();
+
+    if (upgrade_suma_NotStarted(err, subbPtr.p->m_senderRef))
+    {
+      jam();
+      err = SubStopRef::NF_FakeErrorREF;
+    }
+
     SubStopRef* ref = (SubStopRef*) signal->getDataPtrSend();
     ref->senderRef = reference();
     ref->senderData = subbPtr.p->m_senderData;
@@ -11559,10 +11602,13 @@ void Dbdict::execSUB_STOP_REF(Signal* si
    * Coordinator
    */
   ndbrequire(refToBlock(senderRef) == DBDICT);
-  if (err == SubStopRef::NF_FakeErrorREF){
+  if (err == SubStopRef::NF_FakeErrorREF || err == SubStopRef::NotStarted)
+  {
     jam();
     subbPtr.p->m_reqTracker.ignoreRef(c_counterMgr, refToNode(senderRef));
-  } else {
+  }
+  else
+  {
     jam();
     if (subbPtr.p->m_errorCode == 0)
     {
@@ -11914,14 +11960,17 @@ Dbdict::execSUB_REMOVE_REF(Signal* signa
   Uint32 senderRef = ref->senderRef;
   Uint32 err= ref->errorCode;
 
-  if (refToBlock(senderRef) == SUMA) {
+  if (refToBlock(senderRef) == SUMA)
+  {
     /*
      * Participant
      */
     jam();
     OpSubEventPtr subbPtr;
     c_opSubEvent.getPtr(subbPtr, ref->senderData);
-    if (err == 1407) {
+    if (err == SubRemoveRef::NoSuchSubscription)
+    {
+      jam();
       // conf this since this may occur if a nodefailure has occured
       // earlier so that the systable was not cleared
       SubRemoveConf* conf = (SubRemoveConf*) signal->getDataPtrSend();
@@ -11929,7 +11978,17 @@ Dbdict::execSUB_REMOVE_REF(Signal* signa
       conf->senderData = subbPtr.p->m_senderData;
       sendSignal(subbPtr.p->m_senderRef, GSN_SUB_REMOVE_CONF,
 		 signal, SubRemoveConf::SignalLength, JBB);
-    } else {
+    }
+    else
+    {
+      jam();
+
+      if (upgrade_suma_NotStarted(err, subbPtr.p->m_senderRef))
+      {
+        jam();
+        err = SubRemoveRef::NF_FakeErrorREF;
+      }
+
       SubRemoveRef* ref = (SubRemoveRef*) signal->getDataPtrSend();
       ref->senderRef = reference();
       ref->senderData = subbPtr.p->m_senderData;
@@ -11946,10 +12005,13 @@ Dbdict::execSUB_REMOVE_REF(Signal* signa
   ndbrequire(refToBlock(senderRef) == DBDICT);
   OpDropEventPtr eventRecPtr;
   c_opDropEvent.getPtr(eventRecPtr, ref->senderData);
-  if (err == SubRemoveRef::NF_FakeErrorREF){
+  if (err == SubRemoveRef::NF_FakeErrorREF || err == SubRemoveRef::NotStarted)
+  {
     jam();
     eventRecPtr.p->m_reqTracker.ignoreRef(c_counterMgr, refToNode(senderRef));
-  } else {
+  }
+  else
+  {
     jam();
     if (eventRecPtr.p->m_errorCode == 0)
     {

=== modified file 'storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp'
--- a/storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp	2009-12-08 15:26:29 +0000
+++ b/storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp	2009-12-09 15:29:35 +0000
@@ -2350,6 +2350,7 @@ private:
 			  LinearSectionPtr dataPtr);
 
   void parseReadEventSys(Signal *signal, sysTab_NDBEVENTS_0& m_eventRec);
+  bool upgrade_suma_NotStarted(Uint32 err, Uint32 ref) const;
 
   // create trigger
   void createTrigger_recvReply(Signal* signal, const CreateTrigConf* conf,

=== modified file 'storage/ndb/src/kernel/blocks/suma/Suma.cpp'
--- a/storage/ndb/src/kernel/blocks/suma/Suma.cpp	2009-10-08 10:29:46 +0000
+++ b/storage/ndb/src/kernel/blocks/suma/Suma.cpp	2009-12-09 15:29:35 +0000
@@ -1549,7 +1549,7 @@ Suma::execSUB_CREATE_REQ(Signal* signal)
      * We havent started syncing yet
      */
     sendSubCreateRef(signal, senderRef, senderData,
-                     SubCreateRef::NF_FakeErrorREF);
+                     SubCreateRef::NotStarted);
     return;
   }
 
@@ -2406,7 +2406,7 @@ Suma::execSUB_START_REQ(Signal* signal){
      * We havent started syncing yet
      */
     sendSubStartRef(signal,
-                    senderRef, senderData, SubStartRef::NF_FakeErrorREF);
+                    senderRef, senderData, SubStartRef::NotStarted);
     return;
   }
 
@@ -2984,7 +2984,7 @@ Suma::execSUB_STOP_REQ(Signal* signal){
      * We havent started syncing yet
      */
     sendSubStopRef(signal,
-                   senderRef, senderData, SubStopRef::NF_FakeErrorREF);
+                   senderRef, senderData, SubStopRef::NotStarted);
     return;
   }
 
@@ -4209,7 +4209,7 @@ Suma::execSUB_REMOVE_REQ(Signal* signal)
     /**
      * We havent started syncing yet
      */
-    sendSubRemoveRef(signal,  req, SubRemoveRef::NF_FakeErrorREF);
+    sendSubRemoveRef(signal,  req, SubRemoveRef::NotStarted);
     return;
   }
 


Attachment: [text/bzr-bundle] bzr/jonas@mysql.com-20091209152935-j3xmjexsczoapzxs.bundle
Thread
bzr commit into mysql-5.1-telco-6.3 branch (jonas:3189) Bug#49560Jonas Oreland9 Dec