List:Commits« Previous MessageNext Message »
From:Jonas Oreland Date:March 22 2010 12:41pm
Subject:bzr push into mysql-5.1-telco-7.0 branch (jonas:3467 to 3468)
View as plain text  
 3468 Jonas Oreland	2010-03-22 [merge]
      merge 63 to 70

    modified:
      storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp
      storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
      storage/ndb/test/ndbapi/testUpgrade.cpp
 3467 Jonas Oreland	2010-03-21 [merge]
      merge 63 to 70

    modified:
      storage/ndb/include/kernel/NodeState.hpp
      storage/ndb/include/kernel/signaldata/ApiRegSignalData.hpp
      storage/ndb/include/kernel/signaldata/ListTables.hpp
      storage/ndb/src/kernel/blocks/backup/Backup.cpp
      storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp
      storage/ndb/src/ndbapi/NdbApiSignal.hpp
      storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp
=== modified file 'storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp'
--- a/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp	2010-03-19 14:15:57 +0000
+++ b/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp	2010-03-22 12:38:39 +0000
@@ -278,13 +278,21 @@ void Dbdih::sendSTART_RECREQ(Signal* sig
     c_START_RECREQ_Counter.clearWaitingFor(nodeId);
     return;
   }
-  
+
+  Uint32 keepGCI = SYSFILE->keepGCI;
+  Uint32 lastCompletedGCI = SYSFILE->lastCompletedGCI[nodeId];
+  if (keepGCI > lastCompletedGCI)
+  {
+    jam();
+    keepGCI = lastCompletedGCI;
+  }
+
   StartRecReq * const req = (StartRecReq*)&signal->theData[0];
   BlockReference ref = calcLqhBlockRef(nodeId);
   req->receivingNodeId = nodeId;
   req->senderRef = reference();
-  req->keepGci = SYSFILE->keepGCI;
-  req->lastCompletedGci = SYSFILE->lastCompletedGCI[nodeId];
+  req->keepGci = keepGCI;
+  req->lastCompletedGci = lastCompletedGCI;
   req->newestGci = SYSFILE->newestRestorableGCI;
   req->senderData = extra;
   m_sr_nodes.copyto(NdbNodeBitmask::Size, req->sr_nodes);
@@ -292,8 +300,8 @@ void Dbdih::sendSTART_RECREQ(Signal* sig
 
   signal->theData[0] = NDB_LE_StartREDOLog;
   signal->theData[1] = nodeId;
-  signal->theData[2] = SYSFILE->keepGCI;
-  signal->theData[3] = SYSFILE->lastCompletedGCI[nodeId];
+  signal->theData[2] = keepGCI;
+  signal->theData[3] = lastCompletedGCI;
   signal->theData[4] = SYSFILE->newestRestorableGCI;
   sendSignal(CMVMI_REF, GSN_EVENT_REP, signal, 5, JBB);
 }//Dbdih::sendSTART_RECREQ()
@@ -3503,6 +3511,7 @@ void Dbdih::startTakeOver(Signal* signal
 
   TakeOverRecordPtr takeOverPtr;
   ndbrequire(c_activeTakeOverList.seize(takeOverPtr));
+  takeOverPtr.p->startGci = SYSFILE->lastCompletedGCI[startNode];
   takeOverPtr.p->restorableGci = SYSFILE->lastCompletedGCI[startNode];
   takeOverPtr.p->toStartingNode = startNode;
   takeOverPtr.p->toFailedNode = nodeTakenOver;
@@ -3708,6 +3717,12 @@ done:
     BlockReference ref = numberToRef(DBLQH, takeOverPtr.p->toStartingNode);
     sendSignal(ref, GSN_START_FRAGREQ, signal, 
 	       StartFragReq::SignalLength, JBB);
+
+    if (replicaPtr.p->maxGciCompleted[maxLcpIndex] < takeOverPtr.p->startGci)
+    {
+      jam();
+      takeOverPtr.p->startGci = replicaPtr.p->maxGciCompleted[maxLcpIndex];
+    }
   }
 }
 
@@ -3723,12 +3738,22 @@ Dbdih::nr_run_redo(Signal* signal, TakeO
   m_sr_nodes.clear();
   m_sr_nodes.set(takeOverPtr.p->toStartingNode);
 
+  Uint32 save_keepGCI = SYSFILE->keepGCI;
+  if (takeOverPtr.p->startGci < SYSFILE->keepGCI)
+  {
+    jam();
+    SYSFILE->keepGCI = takeOverPtr.p->startGci;
+    ndbout_c("GSN_START_RECREQ keepGci: %u (%u)",
+             takeOverPtr.p->startGci, save_keepGCI);
+  }
+
   takeOverPtr.p->toCurrentTabref = 0;
   takeOverPtr.p->toCurrentFragid = 0;
   takeOverPtr.p->toSlaveStatus = TakeOverRecord::TO_RUN_REDO;
   sendSTART_RECREQ(signal, takeOverPtr.p->toStartingNode, takeOverPtr.i);
 
   m_sr_nodes = save; // restore
+  SYSFILE->keepGCI = save_keepGCI;
 }
 
 void
@@ -13021,13 +13046,20 @@ Dbdih::sendLCP_FRAG_ORD(Signal* signal, 
               info.tableId);
     replicaPtr.p->nextLcp = 0;
   }
+
+  Uint32 keepGci = c_lcpState.keepGci;
+  if (keepGci > SYSFILE->lastCompletedGCI[replicaPtr.p->procNode])
+  {
+    jam();
+    keepGci = SYSFILE->lastCompletedGCI[replicaPtr.p->procNode];
+  }
   
   LcpFragOrd * const lcpFragOrd = (LcpFragOrd *)&signal->theData[0];
   lcpFragOrd->tableId    = info.tableId;
   lcpFragOrd->fragmentId = info.fragId;
   lcpFragOrd->lcpId      = SYSFILE->latestLCP_ID;
   lcpFragOrd->lcpNo      = replicaPtr.p->nextLcp;
-  lcpFragOrd->keepGci    = c_lcpState.keepGci;
+  lcpFragOrd->keepGci    = keepGci;
   lcpFragOrd->lastFragmentFlag = false;
   sendSignal(ref, GSN_LCP_FRAG_ORD, signal, LcpFragOrd::SignalLength, JBB);
 }

=== modified file 'storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp'
--- a/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp	2010-03-19 14:15:57 +0000
+++ b/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp	2010-03-22 12:38:39 +0000
@@ -193,7 +193,7 @@ static int TRACENR_FLAG = 0;
 static NdbOut * traceopout = 0;
 #define TRACE_OP(regTcPtr, place) do { if (TRACE_OP_CHECK(regTcPtr)) TRACE_OP_DUMP(regTcPtr, place); } while(0)
 #else
-#define TRACE_OP(x, y) {}
+#define TRACE_OP(x, y) { (void)x;}
 #endif
 
 struct LogPosition
@@ -2931,6 +2931,7 @@ void Dblqh::execLQHKEYREF(Signal* signal
 {
   jamEntry();
   tcConnectptr.i = signal->theData[0];
+  Uint32 tcOprec  = signal->theData[1];
   terrorCode = signal->theData[2];
   Uint32 transid1 = signal->theData[3];
   Uint32 transid2 = signal->theData[4];
@@ -2938,20 +2939,38 @@ void Dblqh::execLQHKEYREF(Signal* signal
     errorReport(signal, 3);
     return;
   }//if
-/*------------------------------------------------------------------*/
-/*       WE HAVE TO CHECK THAT THE SIGNAL DO NOT BELONG TO SOMETHING*/
-/*       REMOVED DUE TO A TIME-OUT.                                 */
-/*------------------------------------------------------------------*/
+
   ptrAss(tcConnectptr, tcConnectionrec);
   TcConnectionrec * const regTcPtr = tcConnectptr.p;
+
+  if (likely(! ((regTcPtr->connectState == TcConnectionrec::LOG_CONNECTED) ||
+                (regTcPtr->connectState == TcConnectionrec::COPY_CONNECTED))))
+  {
+    /**
+     * This...is unpleasant...
+     *   LOG_CONNECTED and COPY_CONNECTED will not release there tcConnectptr
+     *   before all outstanding is finished.
+     *
+     *   CONNECTED on the other hand can, (in ::execABORT)
+     *     which means that findTransaction *should* be used
+     *     to make sure that correct tcConnectptr is accessed.
+     *
+     *   However, as LOG_CONNECTED & COPY_CONNECTED only uses 1 tcConnectptr
+     *     (and fiddles) with transid and other stuff, I could
+     *     not find an easy way to modify the code so that findTransaction
+     *     is usable also for them
+     */
+    if (findTransaction(transid1, transid2, tcOprec) != ZOK)
+    {
+      jam();
+      warningReport(signal, 14);
+      return;
+    }
+  }
+
   switch (regTcPtr->connectState) {
   case TcConnectionrec::CONNECTED:
     jam();
-    if ((regTcPtr->transid[0] != transid1) ||
-        (regTcPtr->transid[1] != transid2)) {
-      warningReport(signal, 14);
-      return;
-    }//if
     if (regTcPtr->abortState != TcConnectionrec::ABORT_IDLE) {
       warningReport(signal, 15);
       return;
@@ -3342,6 +3361,7 @@ void Dblqh::execTUPKEYREF(Signal* signal
 /* ------------------------------------------------------------------------- */
     break;
   default:
+    jamLine(tcConnectptr.p->transactionState);
     ndbrequire(false);
     break;
   }//switch
@@ -7327,7 +7347,7 @@ void Dblqh::execLQHKEYCONF(Signal* signa
     return;
     break;
   default:
-    jam();
+    jamLine(tcConnectptr.p->connectState);
     ndbrequire(false);
     break;
   }//switch
@@ -8367,6 +8387,7 @@ void Dblqh::abortContinueAfterBlockedLab
   Uint32 canBlock = 2; // 2, block if needed
   switch(regTcPtr->transactionState){
   case TcConnectionrec::WAIT_TUP:
+    jam();
     /**
      * This is when getting from execTUPKEYREF
      *   in which case we *do* have ACC lock
@@ -16111,14 +16132,7 @@ void Dblqh::execSTART_RECREQ(Signal* sig
   cnewestGci = req->newestGci;
   cstartRecReqData = req->senderData;
 
-#if 0
-  /**
-   * This require fails...
-   *   investigate what is reasonable to do!!
-   *   and what it means
-   */
   ndbrequire(crestartOldestGci <= crestartNewestGci);
-#endif
   ndbrequire(req->receivingNodeId == cownNodeid);
 
   cnewestCompletedGci = cnewestGci;
@@ -18177,6 +18191,8 @@ void Dblqh::readSrFourthPhaseLab(Signal*
      * If "keepGci" is bigger than latest-completed-gci
      *   move cnewest/cnewestCompletedGci forward
      */
+    ndbout_c("readSrFourthPhaseLab: gci %u => %u",
+             gci, crestartOldestGci);
     gci = crestartOldestGci;
   }
   cnewestGci = gci;

=== modified file 'storage/ndb/test/ndbapi/testUpgrade.cpp'
--- a/storage/ndb/test/ndbapi/testUpgrade.cpp	2010-02-18 23:50:31 +0000
+++ b/storage/ndb/test/ndbapi/testUpgrade.cpp	2010-03-22 12:38:39 +0000
@@ -578,7 +578,7 @@ int runCheckStarted(NDBT_Context* ctx, N
 
   // Make sure atrt assigns nodeid != -1
   SqlResultSet procs;
-  if (!atrt.doQuery("SELECT * FROM process", procs))
+  if (!atrt.doQuery("SELECT * FROM process where type <> \'mysql\'", procs))
     return NDBT_FAILED;
 
   while (procs.next())


Attachment: [text/bzr-bundle] bzr/jonas@mysql.com-20100322123839-w1lmo3s0u6c0d8r4.bundle
Thread
bzr push into mysql-5.1-telco-7.0 branch (jonas:3467 to 3468)Jonas Oreland22 Mar