List:Commits« Previous MessageNext Message »
From:Jonas Oreland Date:February 17 2011 3:51pm
Subject:bzr commit into mysql-5.1-telco-7.0 branch (jonas:4203)
View as plain text  
#At file:///home/jonas/src/telco-7.0/ based on revid:jonas@stripped

 4203 Jonas Oreland	2011-02-17
      ndb - fix a few bugs in 2pass inr - found by autotest

    modified:
      storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp
      storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
      storage/ndb/src/kernel/blocks/lgman.cpp
=== modified file 'storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp'
--- a/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp	2011-02-15 13:49:23 +0000
+++ b/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp	2011-02-17 15:51:08 +0000
@@ -1989,6 +1989,7 @@ void Dbdih::execREAD_NODESCONF(Signal* s
   if (c_2pass_inr)
   {
     jam();
+    Uint32 workers = getNodeInfo(getOwnNodeId()).m_lqh_workers;
     printf("Checking 2-pass initial node restart: ");
     for (i = 0; i<index; i++)
     {
@@ -1996,7 +1997,16 @@ void Dbdih::execREAD_NODESCONF(Signal* s
       {
         jam();
         c_2pass_inr = false;
-        printf("not ok (node %u) => disabled\n", nodeArray[i]);
+        printf("not ok (version node %u) => disabled\n", nodeArray[i]);
+        break;
+      }
+
+      if (workers > 1 &&
+          workers != getNodeInfo(nodeArray[i]).m_lqh_workers)
+      {
+        c_2pass_inr = false;
+        printf("not ok (different worker cnt node %u) => disabled\n", 
+               nodeArray[i]);
         break;
       }
     }
@@ -3778,7 +3788,7 @@ done:
     req->fragId = takeOverPtr.p->toCurrentFragid;
     req->noOfLogNodes = 0;
 
-    if (c_2pass_inr)
+    if (c_2pass_inr && cstarttype == NodeState::ST_INITIAL_NODE_RESTART)
     {
       /**
        * Check if we can make 2-phase copy
@@ -3829,7 +3839,7 @@ done:
                takeOverPtr.p->toCurrentTabref,
                takeOverPtr.p->toCurrentFragid,
                req->lqhLogNode[0],
-               req->lcpId);
+               takeOverPtr.p->startGci);
     }
 
     BlockReference ref = numberToRef(DBLQH, takeOverPtr.p->toStartingNode);

=== modified file 'storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp'
--- a/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp	2011-02-15 11:41:27 +0000
+++ b/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp	2011-02-17 15:51:08 +0000
@@ -73,6 +73,7 @@
 #include <signaldata/SignalDroppedRep.hpp>
 #include <signaldata/FsReadWriteReq.hpp>
 #include <signaldata/DbinfoScan.hpp>
+#include <signaldata/SystemError.hpp>
 #include <NdbEnv.h>
 
 #include "../suma/Suma.hpp"
@@ -7807,12 +7808,6 @@ void Dblqh::commitContinueAfterBlockedLa
       EXECUTE_DIRECT(tup, GSN_TUP_COMMITREQ, signal, 
 		     TupCommitReq::SignalLength);
 
-      if(signal->theData[0] != 0)
-      {
-	regTcPtr.p->transactionState = TcConnectionrec::WAIT_TUP_COMMIT;
-	return; // TUP_COMMIT was timesliced
-      }
-      
       if (TRACENR_FLAG)
       {
 	TRACENR("COMMIT: ");
@@ -7833,9 +7828,18 @@ void Dblqh::commitContinueAfterBlockedLa
 	if (LqhKeyReq::getRowidFlag(regTcPtr.p->reqinfo))
 	  TRACENR(" rowid: " << regTcPtr.p->m_row_id);
 	TRACENR(" key: " << getKeyInfoWordOrZero(regTcPtr.p, 0));
+
+        if (signal->theData[0] != 0)
+          TRACENR(" TIMESLICE");
 	TRACENR(endl);
       }
 
+      if(signal->theData[0] != 0)
+      {
+        regTcPtr.p->transactionState = TcConnectionrec::WAIT_TUP_COMMIT;
+        return; // TUP_COMMIT was timesliced
+      }
+
       TRACE_OP(regTcPtr.p, "ACC_COMMITREQ");
 
       Uint32 acc = refToMain(regTcPtr.p->tcAccBlockref);
@@ -16495,7 +16499,6 @@ Dblqh::send_restore_lcp(Signal * signal)
 
     sendSignal(ref, GSN_COPY_FRAGREQ, signal,
                CopyFragReq::SignalLength, JBB);
-
   }
 }
 
@@ -16503,7 +16506,17 @@ void
 Dblqh::execCOPY_FRAGREF(Signal* signal)
 {
   jamEntry();
-  ndbrequire(false);
+
+  const CopyFragRef * ref = CAST_CONSTPTR(CopyFragRef, signal->getDataPtr());
+  Uint32 errorCode = ref->errorCode;
+
+  SystemError * sysErr = (SystemError*)&signal->theData[0];
+  sysErr->errorCode = SystemError::CopyFragRefError;
+  sysErr->errorRef = reference();
+  sysErr->data[0] = errorCode;
+  sysErr->data[1] = 0;
+  sendSignal(NDBCNTR_REF, GSN_SYSTEM_ERROR, signal,
+             SystemError::SignalLength, JBB);
 }
 
 void
@@ -16600,7 +16613,18 @@ void Dblqh::execRESTORE_LCP_CONF(Signal*
     lcpPtr.i = 0;
     ptrAss(lcpPtr, lcpRecord);
     lcpPtr.p->m_outstanding = 1;
-    
+
+    if (cstartType == NodeState::ST_INITIAL_NODE_RESTART)
+    {
+      jam();
+      /**
+       * Skip lgman undo...
+       */
+      signal->theData[0] = LGMAN_REF;
+      sendSignal(reference(), GSN_START_RECCONF, signal, 1, JBB);
+      return;
+    }
+
     if (!isNdbMtLqh())
     {
       jam();

=== modified file 'storage/ndb/src/kernel/blocks/lgman.cpp'
--- a/storage/ndb/src/kernel/blocks/lgman.cpp	2011-02-15 08:46:20 +0000
+++ b/storage/ndb/src/kernel/blocks/lgman.cpp	2011-02-17 15:51:08 +0000
@@ -595,7 +595,9 @@ Lgman::execCREATE_FILEGROUP_IMPL_REQ(Sig
     m_logfile_group_hash.add(ptr);
     m_logfile_group_list.add(ptr);
 
-    if (getNodeState().getNodeRestartInProgress() ||
+    if ((getNodeState().getNodeRestartInProgress() &&
+         getNodeState().starting.restartType !=
+         NodeState::ST_INITIAL_NODE_RESTART)||
         getNodeState().getSystemRestartInProgress())
     {
       ptr.p->m_state = Logfile_group::LG_STARTING;


Attachment: [text/bzr-bundle] bzr/jonas@mysql.com-20110217155108-d94hdbit562mjftd.bundle
Thread
bzr commit into mysql-5.1-telco-7.0 branch (jonas:4203) Jonas Oreland17 Feb