List:Commits« Previous MessageNext Message »
From:tomas Date:January 18 2006 3:45pm
Subject:bk commit into 5.1 tree (tomas:1.2073)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of tomas. When tomas 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
  1.2073 06/01/18 16:45:17 tomas@stripped +4 -0
  fixed startup suma bug when ndb api connects during node restart

  storage/ndb/src/kernel/blocks/suma/Suma.hpp
    1.10 06/01/18 16:45:10 tomas@stripped +1 -0
    fixed startup suma bug when ndb api connects during node restart

  storage/ndb/src/kernel/blocks/suma/Suma.cpp
    1.32 06/01/18 16:45:10 tomas@stripped +54 -3
    fixed startup suma bug when ndb api connects during node restart

  storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp
    1.28 06/01/18 16:45:10 tomas@stripped +14 -0
    fixed startup suma bug when ndb api connects during node restart

  storage/ndb/include/kernel/signaldata/SystemError.hpp
    1.4 06/01/18 16:45:10 tomas@stripped +3 -2
    fixed startup suma bug when ndb api connects during node restart

# 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:	tomas
# Host:	poseidon.ndb.mysql.com
# Root:	/home/tomas/mysql-5.1-new

--- 1.3/storage/ndb/include/kernel/signaldata/SystemError.hpp	2005-10-07 01:06:17 +02:00
+++ 1.4/storage/ndb/include/kernel/signaldata/SystemError.hpp	2006-01-18 16:45:10 +01:00
@@ -43,10 +43,11 @@
   enum ErrorCode {
     GCPStopDetected = 3,
     CopyFragRefError = 5,
-    TestStopOnError = 6
+    TestStopOnError = 6,
+    CopySubscriptionRef = 7,
+    CopySubscriberRef = 8
   };
   
-private:
   Uint32 errorRef;
   Uint32 errorCode;
   Uint32 data1;

--- 1.27/storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp	2005-11-22 18:04:53 +01:00
+++ 1.28/storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp	2006-01-18 16:45:10 +01:00
@@ -203,6 +203,20 @@
 	     killingNode, data1);
     break;
 
+  case SystemError::CopySubscriptionRef:
+    BaseString::snprintf(buf, sizeof(buf), 
+	     "Node %d killed this node because "
+	     "it could not copy a subscription during node restart. "
+	     "Copy subscription error code: %u.",
+	     killingNode, data1);
+    break;
+  case SystemError::CopySubscriberRef:
+    BaseString::snprintf(buf, sizeof(buf), 
+	     "Node %d killed this node because "
+	     "it could not start a subscriber during node restart. "
+	     "Copy subscription error code: %u.",
+	     killingNode, data1);
+    break;
   default:
     BaseString::snprintf(buf, sizeof(buf), "System error %d, "
 	     " this node was killed by node %d", 

--- 1.31/storage/ndb/src/kernel/blocks/suma/Suma.cpp	2006-01-12 19:50:34 +01:00
+++ 1.32/storage/ndb/src/kernel/blocks/suma/Suma.cpp	2006-01-18 16:45:10 +01:00
@@ -44,6 +44,7 @@
 #include <signaldata/DropTab.hpp>
 #include <signaldata/AlterTab.hpp>
 #include <signaldata/DihFragCount.hpp>
+#include <signaldata/SystemError.hpp>
 
 #include <ndbapi/NdbDictionary.hpp>
 
@@ -690,7 +691,7 @@
   
   if(failed.get(Restart.nodeId))
   {
-    Restart.nodeId = 0;
+    Restart.resetRestart(signal);
   }
 
   signal->theData[0] = SumaContinueB::RESEND_BUCKET;
@@ -3756,7 +3757,33 @@
   jamEntry();
   DBUG_ENTER("Suma::execSUB_CREATE_REF");
   ndbassert(signal->getNoOfSections() == 0);
-  ndbrequire(false);
+  SubCreateRef *const ref= (SubCreateRef *)signal->getDataPtr();
+  Uint32 error= ref->errorCode;
+  if (error != 1415)
+  {
+    /*
+     * This will happen if an api node connects during while other node
+     * is restarting, and in this case the subscription will already
+     * have been created.
+     * ToDo: more complete handling of api nodes joining during
+     * node restart
+     */
+    Uint32 senderRef = signal->getSendersBlockRef();
+    BlockReference cntrRef = calcNdbCntrBlockRef(refToNode(senderRef));
+    // for some reason we did not manage to create a subscription
+    // on the starting node
+    SystemError * const sysErr = (SystemError*)&signal->theData[0];
+    sysErr->errorCode = SystemError::CopySubscriptionRef;
+    sysErr->errorRef = reference();
+    sysErr->data1 = error;
+    sysErr->data2 = 0;
+    sendSignal(cntrRef, GSN_SYSTEM_ERROR, signal,
+               SystemError::SignalLength, JBB);
+    Restart.resetRestart(signal);
+    DBUG_VOID_RETURN;
+  }
+  // SubCreateConf has same signaldata as SubCreateRef
+  Restart.runSUB_CREATE_CONF(signal);
   DBUG_VOID_RETURN;
 }
 
@@ -3785,7 +3812,22 @@
   jamEntry();
   DBUG_ENTER("Suma::execSUB_START_REF");
   ndbassert(signal->getNoOfSections() == 0);
-  ndbrequire(false);
+  SubStartRef *const ref= (SubStartRef *)signal->getDataPtr();
+  Uint32 error= ref->errorCode;
+  {
+    Uint32 senderRef = signal->getSendersBlockRef();
+    BlockReference cntrRef = calcNdbCntrBlockRef(refToNode(senderRef));
+    // for some reason we did not manage to start a subscriber
+    // on the starting node
+    SystemError * const sysErr = (SystemError*)&signal->theData[0];
+    sysErr->errorCode = SystemError::CopySubscriberRef;
+    sysErr->errorRef = reference();
+    sysErr->data1 = error;
+    sysErr->data2 = 0;
+    sendSignal(cntrRef, GSN_SYSTEM_ERROR, signal,
+               SystemError::SignalLength, JBB);
+    Restart.resetRestart(signal);
+  }
   DBUG_VOID_RETURN;
 }
 
@@ -4080,6 +4122,15 @@
   //SumaStartMeConf *conf= (SumaStartMeConf*)signal->getDataPtrSend();
   suma.sendSignal(sumaRef, GSN_SUMA_START_ME_CONF, signal,
 		  SumaStartMeConf::SignalLength, JBB);
+  resetRestart(signal);
+  DBUG_VOID_RETURN;
+}
+
+void
+Suma::Restart::resetRestart(Signal* signal)
+{
+  jam();
+  DBUG_ENTER("Suma::Restart::resetRestart");
   nodeId = 0;
   DBUG_VOID_RETURN;
 }

--- 1.9/storage/ndb/src/kernel/blocks/suma/Suma.hpp	2006-01-14 11:51:09 +01:00
+++ 1.10/storage/ndb/src/kernel/blocks/suma/Suma.hpp	2006-01-18 16:45:10 +01:00
@@ -489,6 +489,7 @@
     void completeSubscriber(Signal* signal, Uint32 sumaRef);
 
     void completeRestartingNode(Signal* signal, Uint32 sumaRef);
+    void resetRestart(Signal* signal);
   } Restart;
 
 private:
Thread
bk commit into 5.1 tree (tomas:1.2073)tomas18 Jan