List:Commits« Previous MessageNext Message »
From:Jonas Oreland Date:March 5 2010 6:27am
Subject:bzr commit into mysql-5.1-telco-6.3 branch (jonas:3129) Bug#51723
View as plain text  
#At file:///home/jonas/src/telco-6.3/ based on revid:jonas@stripped

 3129 Jonas Oreland	2010-03-05
      ndb - bug#51723 - make sure tail-problem is sent after NR

    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:18:56 +0000
+++ b/storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp	2010-03-05 06:27:20 +0000
@@ -1080,14 +1080,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,
@@ -1219,6 +1215,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 14:54:32 +0000
+++ b/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp	2010-03-05 06:27:20 +0000
@@ -5317,7 +5317,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;
@@ -5331,6 +5333,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);
@@ -5344,6 +5347,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;
@@ -5392,14 +5403,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
@@ -12625,19 +12630,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)
       {
@@ -13620,7 +13613,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*/
@@ -13926,6 +13918,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);
+      }
     }
   }
   
@@ -15298,6 +15299,25 @@ Dblqh::rebuildOrderedIndexes(Signal* sig
   if (tableId >= ctabrecFileSize)
   {
     jam();
+
+    for (logPartPtr.i = 0; logPartPtr.i < 4; logPartPtr.i++)
+    {
+      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;
@@ -18551,6 +18571,7 @@ void Dblqh::initLogpart(Signal* signal) 
   logPartPtr.p->headFileNo = ZNIL;
   logPartPtr.p->headPageNo = ZNIL;
   logPartPtr.p->headPageIndex = ZNIL;
+  logPartPtr.p->m_tail_problem = 0;
 }//Dblqh::initLogpart()
 
 /* ========================================================================== 
@@ -19917,10 +19938,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;
@@ -19952,14 +19975,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-20100305062720-8k7i4plt2ct3qqq5.bundle
Thread
bzr commit into mysql-5.1-telco-6.3 branch (jonas:3129) Bug#51723Jonas Oreland5 Mar