List:Commits« Previous MessageNext Message »
From:Jonas Oreland Date:March 5 2010 7:21am
Subject:bzr commit into mysql-5.1-telco-7.1 branch (jonas:3483)
View as plain text  
#At file:///home/jonas/src/telco-7.1/ based on revid:magnus.blaudd@stripped

 3483 Jonas Oreland	2010-03-05 [merge]
      merge 70 to 71

    modified:
      storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp
      storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
=== modified file 'storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp'
--- a/storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp	2010-02-25 16:25:35 +0000
+++ b/storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp	2010-03-05 06:29:37 +0000
@@ -1059,14 +1059,10 @@ public:
       SR_FOURTH_PHASE_STARTED = 6,    ///< Finding the log tail and head 
                                       ///< is the fourth phase.
       SR_FOURTH_PHASE_COMPLETED = 7,
-      FILE_CHANGE_PROBLEM = 8,        ///< For some reason the write to 
+      FILE_CHANGE_PROBLEM = 8         ///< For some reason the write to 
                                       ///< page zero in file zero have not   
                                       ///< finished after 15 mbyte of 
                                       ///< log data have been written
-      TAIL_PROBLEM = 9                ///< Only 1 mbyte of log left. 
-                                      ///< No operations allowed to enter the 
-                                      ///< log. Only special log records 
-                                      ///< are allowed
     };
     enum WaitWriteGciLog {
       WWGL_TRUE = 0,
@@ -1198,6 +1194,12 @@ public:
      *       The current state of this log part.                               
      */
     LogPartState logPartState;
+
+    /**
+     * does current log-part have tail-problem (i.e 410)
+     */
+    bool m_tail_problem;
+
     /**
      *       A timer that is set every time a log page is sent to disk.
      *       Ensures that log pages are not kept in main memory for

=== modified file 'storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp'
--- a/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp	2010-03-02 15:37:59 +0000
+++ b/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp	2010-03-05 06:34:36 +0000
@@ -6021,7 +6021,9 @@ void Dblqh::logLqhkeyreqLab(Signal* sign
   UintR tcurrentFilepage;
   TcConnectionrecPtr tmpTcConnectptr;
 
-  if (cnoOfLogPages < ZMIN_LOG_PAGES_OPERATION || ERROR_INSERTED(5032)) {
+  if (unlikely(cnoOfLogPages < ZMIN_LOG_PAGES_OPERATION) || 
+      ERROR_INSERTED(5032))
+  {
     jam();
     if(ERROR_INSERTED(5032)){
       CLEAR_ERROR_INSERT_VALUE;
@@ -6035,6 +6037,7 @@ void Dblqh::logLqhkeyreqLab(Signal* sign
     abortErrorLab(signal);
     return;
   }//if
+
   TcConnectionrec * const regTcPtr = tcConnectptr.p;
   logPartPtr.i = regTcPtr->m_log_part_ptr_i;
   ptrCheckGuard(logPartPtr, clogPartFileSize, logPartRecord);
@@ -6048,6 +6051,14 @@ void Dblqh::logLqhkeyreqLab(Signal* sign
 /* -------------------------------------------------- */
   LogPartRecord * const regLogPartPtr = logPartPtr.p;
 
+  if (unlikely(regLogPartPtr->m_tail_problem))
+  {
+    jam();
+    terrorCode = ZTAIL_PROBLEM_IN_LOG_ERROR;
+    abortErrorLab(signal);
+    return;
+  }
+
   if(ERROR_INSERTED(5033)){
     jam();
     CLEAR_ERROR_INSERT_VALUE;
@@ -6096,14 +6107,8 @@ void Dblqh::logLqhkeyreqLab(Signal* sign
       signal->theData[1] = logPartPtr.i;
       sendSignal(cownref, GSN_CONTINUEB, signal, 2, JBB);
     }//if
-    if (regLogPartPtr->logPartState == LogPartRecord::TAIL_PROBLEM) {
-      jam();
-      terrorCode = ZTAIL_PROBLEM_IN_LOG_ERROR;
-    } else {
-      ndbrequire(regLogPartPtr->logPartState == LogPartRecord::FILE_CHANGE_PROBLEM);
-      jam();
-      terrorCode = ZFILE_CHANGE_PROBLEM_IN_LOG_ERROR;
-    }//if
+    ndbrequire(regLogPartPtr->logPartState == LogPartRecord::FILE_CHANGE_PROBLEM);
+    terrorCode = ZFILE_CHANGE_PROBLEM_IN_LOG_ERROR;
     abortErrorLab(signal);
     return;
   }//if
@@ -13466,19 +13471,7 @@ retry:
       if (tailmoved && mb > c_free_mb_tail_problem_limit)
       {
         jam();
-        if (sltLogPartPtr.p->logPartState == LogPartRecord::TAIL_PROBLEM)
-        {
-          if (sltLogPartPtr.p->firstLogQueue == RNIL)
-          {
-            jam();
-            sltLogPartPtr.p->logPartState = LogPartRecord::IDLE;
-          }
-          else
-          {
-            jam();
-            sltLogPartPtr.p->logPartState = LogPartRecord::ACTIVE;
-          }
-        }
+        sltLogPartPtr.p->m_tail_problem = false;
       }
       else if (!tailmoved && mb <= c_free_mb_force_lcp_limit)
       {
@@ -14515,7 +14508,6 @@ void Dblqh::timeSup(Signal* signal) 
       return;
       break;
     case LogPartRecord::IDLE:
-    case LogPartRecord::TAIL_PROBLEM:
       jam();
 /*---------------------------------------------------------------------------*/
 /* IDLE AND NOT WRITTEN TO DISK IN A SECOND. ALSO WHEN WE HAVE A TAIL PROBLEM*/
@@ -14821,6 +14813,15 @@ void Dblqh::writePageZeroLab(Signal* sig
     {
       jam();
       logPartPtr.p->logPartState = LogPartRecord::ACTIVE;
+      if (logPartPtr.p->LogLqhKeyReqSent == ZFALSE)
+      {
+        jam();
+
+        logPartPtr.p->LogLqhKeyReqSent = ZTRUE;
+        signal->theData[0] = ZLOG_LQHKEYREQ;
+        signal->theData[1] = logPartPtr.i;
+        sendSignal(cownref, GSN_CONTINUEB, signal, 2, JBB);
+      }
     }
   }
   
@@ -16229,6 +16230,26 @@ Dblqh::rebuildOrderedIndexes(Signal* sig
   if (tableId >= ctabrecFileSize)
   {
     jam();
+
+    for (logPartPtr.i = 0; logPartPtr.i < clogPartFileSize; logPartPtr.i++)
+    {
+      jam();
+      ptrCheckGuard(logPartPtr, clogPartFileSize, logPartRecord);
+      LogFileRecordPtr logFile;
+      logFile.i = logPartPtr.p->currentLogfile;
+      ptrCheckGuard(logFile, clogFileFileSize, logFileRecord);
+      
+      LogPosition head = { logFile.p->fileNo, logFile.p->currentMbyte };
+      LogPosition tail = { logPartPtr.p->logTailFileNo, 
+                           logPartPtr.p->logTailMbyte};
+      Uint64 mb = free_log(head, tail, logPartPtr.p->noLogFiles, clogFileSize);
+      if (mb <= c_free_mb_tail_problem_limit)
+      {
+        jam();
+        logPartPtr.p->m_tail_problem = true;
+      }
+    }
+    
     StartRecConf * conf = (StartRecConf*)signal->getDataPtrSend();
     conf->startingNodeId = getOwnNodeId();
     conf->senderData = cstartRecReqData;
@@ -19507,7 +19528,7 @@ void Dblqh::initLogpart(Signal* signal) 
   logPartPtr.p->headFileNo = ZNIL;
   logPartPtr.p->headPageNo = ZNIL;
   logPartPtr.p->headPageIndex = ZNIL;
-
+  logPartPtr.p->m_tail_problem = 0;
   NdbLogPartInfo lpinfo(instance());
   ndbrequire(lpinfo.partCount == clogPartFileSize);
   logPartPtr.p->logPartNo = lpinfo.partNo[logPartPtr.i];
@@ -20922,10 +20943,12 @@ void Dblqh::writeNextLog(Signal* signal)
       char buf[100];
       BaseString::snprintf(buf, sizeof(buf), 
                            "Head/Tail met in REDO log, logpart: %u"
-                           " file: %u mbyte: %u",
+                           " file: %u mbyte: %u state: %u tail-problem: %u",
                            logPartPtr.i,
                            logFilePtr.p->fileNo,
-                           logFilePtr.p->currentMbyte);
+                           logFilePtr.p->currentMbyte,
+                           logPartPtr.p->logPartState,
+                           logPartPtr.p->m_tail_problem);
 
 
       signal->theData[0] = 2398;
@@ -20957,14 +20980,10 @@ void Dblqh::writeNextLog(Signal* signal)
     force_lcp(signal);
   }
 
-  if (logPartPtr.p->logPartState == LogPartRecord::ACTIVE ||
-      logPartPtr.p->logPartState == LogPartRecord::IDLE)
+  if (free_mb <= c_free_mb_tail_problem_limit)
   {
-    if (free_mb <= c_free_mb_tail_problem_limit)
-    {
-      jam();
-      logPartPtr.p->logPartState = LogPartRecord::TAIL_PROBLEM;
-    }
+    jam();
+    logPartPtr.p->m_tail_problem = true;
   }
 }//Dblqh::writeNextLog()
 


Attachment: [text/bzr-bundle] bzr/jonas@mysql.com-20100305072107-m0hqmfaiyhi9dwks.bundle
Thread
bzr commit into mysql-5.1-telco-7.1 branch (jonas:3483)Jonas Oreland5 Mar