List:Commits« Previous MessageNext Message »
From:Jonas Oreland Date:September 23 2010 6:30am
Subject:bzr push into mysql-5.1-telco-7.1 branch (jonas:3824 to 3825)
View as plain text  
 3825 Jonas Oreland	2010-09-23 [merge]
      ndb - merge 70 to 71

    modified:
      storage/ndb/include/kernel/GlobalSignalNumbers.h
      storage/ndb/include/kernel/signaldata/FsReadWriteReq.hpp
      storage/ndb/src/kernel/blocks/ERROR_codes.txt
      storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp
      storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
      storage/ndb/src/kernel/blocks/ndbfs/AsyncIoThread.cpp
      storage/ndb/src/kernel/blocks/ndbfs/AsyncIoThread.hpp
      storage/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp
      storage/ndb/src/kernel/blocks/ndbfs/Ndbfs.hpp
      storage/ndb/src/kernel/blocks/ndbfs/VoidFs.cpp
      storage/ndb/test/include/NdbRestarter.hpp
      storage/ndb/test/ndbapi/testSystemRestart.cpp
      storage/ndb/test/src/NdbRestarter.cpp
 3824 Bernd Ocklin	2010-09-22
      fixing backslash classpaths

    modified:
      win/configure.js
=== modified file 'storage/ndb/include/kernel/GlobalSignalNumbers.h'
--- a/storage/ndb/include/kernel/GlobalSignalNumbers.h	2010-06-28 08:40:27 +0000
+++ b/storage/ndb/include/kernel/GlobalSignalNumbers.h	2010-09-20 13:09:18 +0000
@@ -192,7 +192,7 @@ extern const GlobalSignalNumber NO_OF_SI
 #define GSN_ROUTE_ORD                   121
 #define GSN_NODE_VERSION_REP            122
 /* 123 not unused */
-/* 124 unused */
+#define GSN_FSSUSPENDORD                124 /* local */
 #define GSN_CHECK_LCP_STOP              125
 #define GSN_CLOSE_COMCONF               126 /* local */
 #define GSN_CLOSE_COMREQ                127 /* local */

=== modified file 'storage/ndb/include/kernel/signaldata/FsReadWriteReq.hpp'
--- a/storage/ndb/include/kernel/signaldata/FsReadWriteReq.hpp	2009-05-27 15:21:45 +0000
+++ b/storage/ndb/include/kernel/signaldata/FsReadWriteReq.hpp	2010-09-20 13:09:18 +0000
@@ -173,5 +173,12 @@ FsReadWriteReq::getPartialReadFlag(UintR
   return (opFlag >> PARTIAL_READ_SHIFT) & 1;
 }
 
+struct FsSuspendOrd
+{
+  UintR filePointer;          // DATA 0
+  Uint32 milliseconds;
+
+  STATIC_CONST(SignalLength = 2);
+};
 
 #endif

=== modified file 'storage/ndb/src/kernel/blocks/ERROR_codes.txt'
--- a/storage/ndb/src/kernel/blocks/ERROR_codes.txt	2010-09-06 08:20:33 +0000
+++ b/storage/ndb/src/kernel/blocks/ERROR_codes.txt	2010-09-20 13:09:18 +0000
@@ -3,7 +3,7 @@ Next NDBCNTR 1002
 Next NDBFS 2000
 Next DBACC 3002
 Next DBTUP 4035
-Next DBLQH 5057
+Next DBLQH 5060
 Next DBDICT 6025
 Next DBDIH 7226
 Next DBTC 8088

=== modified file 'storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp'
--- a/storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp	2010-08-30 09:51:49 +0000
+++ b/storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp	2010-09-20 13:09:18 +0000
@@ -1419,10 +1419,13 @@ public:
       OPEN_SR_READ_INVALIDATE_PAGES = 21,
       CLOSE_SR_READ_INVALIDATE_PAGES = 22,
       OPEN_SR_WRITE_INVALIDATE_PAGES = 23,
-      CLOSE_SR_WRITE_INVALIDATE_PAGES = 24
+      CLOSE_SR_WRITE_INVALIDATE_PAGES = 24,
+      OPEN_SR_READ_INVALIDATE_SEARCH_FILES = 25,
+      CLOSE_SR_READ_INVALIDATE_SEARCH_FILES = 26,
+      CLOSE_SR_READ_INVALIDATE_SEARCH_LAST_FILE = 27
 #ifndef NO_REDO_OPEN_FILE_CACHE
-      ,OPEN_EXEC_LOG_CACHED = 25
-      ,CLOSING_EXEC_LOG_CACHED = 26
+      ,OPEN_EXEC_LOG_CACHED = 28
+      ,CLOSING_EXEC_LOG_CACHED = 29
 #endif
     };
     
@@ -1596,6 +1599,7 @@ public:
       READ_SR_INVALIDATE_PAGES = 18,
       WRITE_SR_INVALIDATE_PAGES = 19,
       WRITE_SR_INVALIDATE_PAGES_UPDATE_PAGE0 = 20
+      ,READ_SR_INVALIDATE_SEARCH_FILES = 21
     };
     /**
      * We have to remember the log pages read. 
@@ -2428,6 +2432,8 @@ private:
   Uint32 nextLogFilePtr(Uint32 logFilePtrI);
   void readFileInInvalidate(Signal *signal, int stepNext);
   void writeFileInInvalidate(Signal *signal, int stepPrev);
+  bool invalidateCloseFile(Signal*, Ptr<LogPartRecord>, Ptr<LogFileRecord>,
+                           LogFileRecord::LogFileStatus status);
   void exitFromInvalidate(Signal* signal);
   Uint32 calcPageCheckSum(LogPageRecordPtr logP);
   Uint32 handleLongTupKey(Signal* signal, Uint32* dataPtr, Uint32 len);
@@ -3176,6 +3182,9 @@ public:
 
   Uint32 get_node_status(Uint32 nodeId) const;
   bool check_ndb_versions() const;
+
+  void suspendFile(Signal* signal, Uint32 filePtrI, Uint32 millis);
+  void suspendFile(Signal* signal, Ptr<LogFileRecord> logFile, Uint32 millis);
 };
 
 inline

=== modified file 'storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp'
--- a/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp	2010-08-31 10:55:01 +0000
+++ b/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp	2010-09-20 13:09:18 +0000
@@ -14153,6 +14153,23 @@ void Dblqh::execFSCLOSECONF(Signal* sign
     readFileInInvalidate(signal, 2);
     return;
 
+  case LogFileRecord::CLOSE_SR_READ_INVALIDATE_SEARCH_FILES:
+    jam();
+    logFilePtr.p->logFileStatus = LogFileRecord::CLOSED;
+
+    logPartPtr.i = logFilePtr.p->logPartRec;
+    ptrCheckGuard(logPartPtr, clogPartFileSize, logPartRecord);
+
+    readFileInInvalidate(signal, 4);
+    return;
+  case LogFileRecord::CLOSE_SR_READ_INVALIDATE_SEARCH_LAST_FILE:
+    logFilePtr.p->logFileStatus = LogFileRecord::CLOSED;
+
+    logPartPtr.i = logFilePtr.p->logPartRec;
+    ptrCheckGuard(logPartPtr, clogPartFileSize, logPartRecord);
+
+    readFileInInvalidate(signal, 7);
+    return;
   case LogFileRecord::CLOSE_SR_WRITE_INVALIDATE_PAGES:
     jam();
     logFilePtr.p->logFileStatus = LogFileRecord::CLOSED;
@@ -14215,6 +14232,11 @@ void Dblqh::execFSOPENCONF(Signal* signa
     logFilePtr.p->logFileStatus = LogFileRecord::OPEN;
     readFileInInvalidate(signal, 0);
     return;
+  case LogFileRecord::OPEN_SR_READ_INVALIDATE_SEARCH_FILES:
+    jam();
+    logFilePtr.p->logFileStatus = LogFileRecord::OPEN;
+    readFileInInvalidate(signal, 5);
+    return;
   case LogFileRecord::OPEN_SR_WRITE_INVALIDATE_PAGES:
     jam();
     logFilePtr.p->logFileStatus = LogFileRecord::OPEN;
@@ -14352,6 +14374,10 @@ void Dblqh::execFSREADCONF(Signal* signa
     jam();
     invalidateLogAfterLastGCI(signal);
     return;
+  case LogFileOperationRecord::READ_SR_INVALIDATE_SEARCH_FILES:
+    jam();
+    invalidateLogAfterLastGCI(signal);
+    return;
   case LogFileOperationRecord::READ_SR_FOURTH_PHASE:
     jam();
     releaseLfo(signal);
@@ -17661,7 +17687,8 @@ Dblqh::nextLogFilePtr(Uint32 logFilePtrI
   return tmp.p->nextLogFile;
 }
 
-void Dblqh::invalidateLogAfterLastGCI(Signal* signal)
+void
+Dblqh::invalidateLogAfterLastGCI(Signal* signal)
 {
   jam();
   if (logPartPtr.p->logExecState != LogPartRecord::LES_EXEC_LOG_INVALIDATE) {
@@ -17675,6 +17702,34 @@ void Dblqh::invalidateLogAfterLastGCI(Si
   }
 
   switch (lfoPtr.p->lfoState) {
+  case LogFileOperationRecord::READ_SR_INVALIDATE_SEARCH_FILES:
+  {
+    jam();
+    // Check if this file contains pages needing to be invalidated
+    ndbrequire(logPartPtr.p->invalidatePageNo == 1);
+    bool ok = logPagePtr.p->logPageWord[ZPOS_LOG_LAP] == logPartPtr.p->logLap;
+    releaseLfo(signal);
+    releaseLogpage(signal);
+    if (ok)
+    {
+      jam();
+      // This page must be invalidated.
+      // We search next file
+      readFileInInvalidate(signal, 3);
+      return;
+    }
+    else
+    {
+      jam();
+      /**
+       * This file doest not need to be invalidated...move to previous
+       *   file and search forward linear
+       */
+      readFileInInvalidate(signal, 6);
+      return;
+    }
+    break;
+  }
   case LogFileOperationRecord::READ_SR_INVALIDATE_PAGES:
     jam();
     // Check if this page must be invalidated.
@@ -17729,22 +17784,10 @@ void Dblqh::invalidateLogAfterLastGCI(Si
         }
       }
       
-      if (logFilePtr.p->fileNo != 0 &&
-          logFilePtr.i != logPartPtr.p->currentLogfile &&
-          logFilePtr.i != nextLogFilePtr(logPartPtr.p->currentLogfile))
+      if (invalidateCloseFile(signal, logPartPtr, logFilePtr,
+                              LogFileRecord::CLOSE_SR_WRITE_INVALIDATE_PAGES))
       {
         jam();
-        if (DEBUG_REDO)
-        {
-          ndbout_c("invalidate part: %u close %u(%u) (write) (%u)",
-                   logPartPtr.i,
-                   logFilePtr.p->fileNo,
-                   logFilePtr.i,
-                   logPartPtr.p->currentLogfile);
-        }
-        logFilePtr.p->logFileStatus =
-          LogFileRecord::CLOSE_SR_WRITE_INVALIDATE_PAGES;
-        closeFile(signal, logFilePtr, __LINE__);
         return;
       }
       writeFileInInvalidate(signal, 1); // step prev
@@ -17816,31 +17859,53 @@ Dblqh::writeFileInInvalidate(Signal* sig
   return;
 }//Dblqh::invalidateLogAfterLastGCI
 
+bool
+Dblqh::invalidateCloseFile(Signal* signal,
+                           Ptr<LogPartRecord> partPtr,
+                           Ptr<LogFileRecord> filePtr,
+                           LogFileRecord::LogFileStatus status)
+{
+  jam();
+  if (filePtr.p->fileNo != 0 &&
+      filePtr.i != partPtr.p->currentLogfile &&
+      filePtr.i != nextLogFilePtr(logPartPtr.p->currentLogfile))
+  {
+    jam();
+    if (DEBUG_REDO)
+    {
+      ndbout_c("invalidate part: %u close %u(%u) state: %u (%u)",
+               logPartPtr.i,
+               logFilePtr.p->fileNo,
+               logFilePtr.i,
+               (Uint32)status,
+               logPartPtr.p->currentLogfile);
+    }
+    filePtr.p->logFileStatus = status;
+    closeFile(signal, filePtr, __LINE__);
+    return true;
+  }
+  return false;
+}
+
 void Dblqh::readFileInInvalidate(Signal* signal, int stepNext)
 {
   jam();
 
+  if (DEBUG_REDO)
+  {
+    ndbout_c("readFileInInvalidate part: %u file: %u stepNext: %u",
+             logPartPtr.i, logFilePtr.p->fileNo, stepNext);
+  }
+
   if (stepNext == 1)
   {
     logPartPtr.p->invalidatePageNo++;
     if (logPartPtr.p->invalidatePageNo == (clogFileSize * ZPAGES_IN_MBYTE))
     {
-      if (logFilePtr.p->fileNo != 0 &&
-          logFilePtr.i != logPartPtr.p->currentLogfile &&
-          logFilePtr.i != nextLogFilePtr(logPartPtr.p->currentLogfile))
+      if (invalidateCloseFile(signal, logPartPtr, logFilePtr,
+                              LogFileRecord::CLOSE_SR_READ_INVALIDATE_PAGES))
       {
         jam();
-        if (DEBUG_REDO)
-        {
-          ndbout_c("invalidate part: %u close %u(%u) (read) (%u)",
-                   logPartPtr.i,
-                   logFilePtr.p->fileNo,
-                   logFilePtr.i,
-                   logPartPtr.p->currentLogfile);
-        }
-        logFilePtr.p->logFileStatus =
-          LogFileRecord::CLOSE_SR_READ_INVALIDATE_PAGES;
-        closeFile(signal, logFilePtr, __LINE__);
         return;
       }
       else
@@ -17849,6 +17914,14 @@ void Dblqh::readFileInInvalidate(Signal*
         stepNext = 2; // After close
       }
     }
+    else
+    {
+      jam();
+      // Contact NDBFS. Real time break.
+      readSinglePage(signal, logPartPtr.p->invalidatePageNo);
+      lfoPtr.p->lfoState = LogFileOperationRecord::READ_SR_INVALIDATE_PAGES;
+      return;
+    }
   }
   
   if (stepNext == 2)
@@ -17870,28 +17943,144 @@ void Dblqh::readFileInInvalidate(Signal*
       logPartPtr.p->logLap++;
       if (DEBUG_REDO)
       {
-        ndbout_c("readFileInInvalidate part: %u wrap to file 0 -> logLap: %u",
-                 logPartPtr.i, logPartPtr.p->logLap);
+        ndbout_c("readFileInInvalidate part: %u step: %u wrap to file 0 -> logLap: %u",
+                 logPartPtr.i, stepNext, logPartPtr.p->logLap);
       }
     }
 
+stepNext_2:
     if (logFilePtr.p->logFileStatus != LogFileRecord::OPEN)
     {
       jam();
       if (DEBUG_REDO)
       {
-        ndbout_c("invalidate part: %u open for read %u",
-                 logPartPtr.i, logFilePtr.p->fileNo);
+        ndbout_c("invalidate part: %u step: %u open for read %u",
+                 logPartPtr.i, stepNext, logFilePtr.p->fileNo);
       }
       logFilePtr.p->logFileStatus =LogFileRecord::OPEN_SR_READ_INVALIDATE_PAGES;
       openFileRw(signal, logFilePtr);
       return;
     }
+
+    // Contact NDBFS. Real time break.
+    readSinglePage(signal, logPartPtr.p->invalidatePageNo);
+    lfoPtr.p->lfoState = LogFileOperationRecord::READ_SR_INVALIDATE_PAGES;
+    return;
+  }
+
+  if (stepNext == 3)
+  {
+    jam();
+    if (invalidateCloseFile
+        (signal, logPartPtr, logFilePtr,
+         LogFileRecord::CLOSE_SR_READ_INVALIDATE_SEARCH_FILES))
+    {
+      jam();
+      return;
+    }
+    stepNext = 4;
+  }
+
+  if (stepNext == 4)
+  {
+    jam();
+    logFilePtr.i = logFilePtr.p->nextLogFile;
+    ptrCheckGuard(logFilePtr, clogFileFileSize, logFileRecord);
+    logPartPtr.p->invalidateFileNo = logFilePtr.p->fileNo;
+    // Page 0 is used for file descriptors.
+    logPartPtr.p->invalidatePageNo = 1;
+
+    if (logFilePtr.p->fileNo == 0)
+    {
+      /**
+       * We're wrapping in the log...
+       *   update logLap
+       */
+      logPartPtr.p->logLap++;
+      if (DEBUG_REDO)
+      {
+        ndbout_c("readFileInInvalidate part: %u step: %u wrap to file 0 -> logLap: %u",
+                 logPartPtr.i, stepNext, logPartPtr.p->logLap);
+      }
+    }
+
+    if (logFilePtr.p->logFileStatus != LogFileRecord::OPEN)
+    {
+      jam();
+      if (DEBUG_REDO)
+      {
+        ndbout_c("invalidate part: %u step: %u open for read %u",
+                 logPartPtr.i, stepNext, logFilePtr.p->fileNo);
+      }
+      logFilePtr.p->logFileStatus =
+        LogFileRecord::OPEN_SR_READ_INVALIDATE_SEARCH_FILES;
+      openFileRw(signal, logFilePtr);
+      return;
+    }
+    stepNext = 5;
   }
 
-  // Contact NDBFS. Real time break.
-  readSinglePage(signal, logPartPtr.p->invalidatePageNo); 
-  lfoPtr.p->lfoState = LogFileOperationRecord::READ_SR_INVALIDATE_PAGES;
+  if (stepNext == 5)
+  {
+    jam();
+    // Contact NDBFS. Real time break.
+    readSinglePage(signal, logPartPtr.p->invalidatePageNo);
+    lfoPtr.p->lfoState =
+      LogFileOperationRecord::READ_SR_INVALIDATE_SEARCH_FILES;
+    return;
+  }
+
+  if (stepNext == 6)
+  {
+    jam();
+    if (invalidateCloseFile
+        (signal, logPartPtr, logFilePtr,
+         LogFileRecord::CLOSE_SR_READ_INVALIDATE_SEARCH_LAST_FILE))
+    {
+      jam();
+      return;
+    }
+    stepNext = 7;
+  }
+
+  if (stepNext == 7)
+  {
+    jam();
+
+    if (logFilePtr.p->fileNo == 0)
+    {
+      jam();
+      /**
+       * We're wrapping in the log...
+       *   update logLap
+       */
+      logPartPtr.p->logLap--;
+      ndbrequire(logPartPtr.p->logLap); // Should always be > 0
+      if (DEBUG_REDO)
+      {
+        ndbout_c("invalidateLogAfterLastGCI part: %u step: %u wrap from file 0 -> logLap: %u",
+                 logPartPtr.i, stepNext, logPartPtr.p->logLap);
+      }
+    }
+
+    logFilePtr.i = logFilePtr.p->prevLogFile;
+    ptrCheckGuard(logFilePtr, clogFileFileSize, logFileRecord);
+
+    logPartPtr.p->invalidateFileNo = logFilePtr.p->fileNo;
+    // Page 0 is used for file descriptors.
+    logPartPtr.p->invalidatePageNo = 1;
+
+    if (logPartPtr.p->invalidateFileNo == logPartPtr.p->headFileNo)
+    {
+      jam();
+      logPartPtr.p->invalidatePageNo = logPartPtr.p->headPageNo;
+      readFileInInvalidate(signal, 1);
+      return;
+    }
+
+    goto stepNext_2;
+  }
+  ndbrequire(false);
 }
 
 void Dblqh::exitFromInvalidate(Signal* signal)
@@ -18383,7 +18572,7 @@ void Dblqh::readSrFourthZeroLab(Signal* 
   logPartPtr.p->invalidatePageNo = logPartPtr.p->headPageNo;
   logPartPtr.p->logExecState = LogPartRecord::LES_EXEC_LOG_INVALIDATE;
    
-  readFileInInvalidate(signal, 1);
+  readFileInInvalidate(signal, 3);
   return;
 }//Dblqh::readSrFourthZeroLab()
 
@@ -21142,6 +21331,31 @@ void Dblqh::writeNextLog(Signal* signal)
     jam();
     logPartPtr.p->m_tail_problem = true;
   }
+
+  if (ERROR_INSERTED(5058) &&
+      (twnlNextMbyte + 3 >= clogFileSize) &&
+      logFilePtr.p->fileNo != 0 &&
+      logFilePtr.p->nextLogFile != logPartPtr.p->firstLogfile)
+  {
+    jam();
+    srand(time(0));
+    Uint32 wait = 3 + (rand() % 5);
+
+    suspendFile(signal, logFilePtr, /* forever */ 0);
+    suspendFile(signal, logPartPtr.p->firstLogfile, /* forever */ 0);
+    signal->theData[0] = 9999;
+    sendSignalWithDelay(CMVMI_REF, GSN_NDB_TAMPER, signal, wait * 1000, 1);
+    CLEAR_ERROR_INSERT_VALUE;
+  }
+
+  if (ERROR_INSERTED(5059) &&
+      twnlNextMbyte == 4 &&
+      logFilePtr.p->fileNo != 0)
+  {
+    signal->theData[0] = 9999;
+    sendSignal(CMVMI_REF, GSN_NDB_TAMPER, signal, 1, JBA);
+  }
+
 }//Dblqh::writeNextLog()
 
 bool
@@ -22780,3 +22994,22 @@ Dblqh::check_ndb_versions() const
   }
   return true;
 }
+
+void
+Dblqh::suspendFile(Signal* signal, Uint32 filePtrI, Uint32 millis)
+{
+  Ptr<LogFileRecord> tmp;
+  tmp.i = filePtrI;
+  ptrCheckGuard(tmp, clogFileFileSize, logFileRecord);
+  suspendFile(signal, tmp, millis);
+}
+
+void
+Dblqh::suspendFile(Signal* signal, Ptr<LogFileRecord> logFilePtr, Uint32 millis)
+{
+  SaveSignal<FsSuspendOrd::SignalLength> tmp(signal);
+  signal->theData[0] = logFilePtr.p->fileRef;
+  signal->theData[1] = millis;
+  sendSignal(NDBFS_REF, GSN_FSSUSPENDORD, signal, 2, JBA);
+}
+

=== modified file 'storage/ndb/src/kernel/blocks/ndbfs/AsyncIoThread.cpp'
--- a/storage/ndb/src/kernel/blocks/ndbfs/AsyncIoThread.cpp	2009-12-14 22:14:34 +0000
+++ b/storage/ndb/src/kernel/blocks/ndbfs/AsyncIoThread.cpp	2010-09-20 13:09:18 +0000
@@ -28,6 +28,10 @@
 #include <signaldata/FsReadWriteReq.hpp>
 #include <Configuration.hpp>
 #include "Ndbfs.hpp"
+#include <NdbSleep.h>
+
+#include <EventLogger.hpp>
+extern EventLogger * g_eventLogger;
 
 AsyncIoThread::AsyncIoThread(class Ndbfs& fs, AsyncFile* file)
   : m_fs(fs)
@@ -202,6 +206,22 @@ AsyncIoThread::run()
     case Request::buildindx:
       buildIndxReq(request);
       break;
+    case Request::suspend:
+      if (request->par.suspend.milliseconds)
+      {
+        g_eventLogger->debug("Suspend %s %u ms",
+                             file->theFileName.c_str(),
+                             request->par.suspend.milliseconds);
+        NdbSleep_MilliSleep(request->par.suspend.milliseconds);
+        continue;
+      }
+      else
+      {
+        g_eventLogger->debug("Suspend %s",
+                             file->theFileName.c_str());
+        theStartFlag = false;
+        return;
+      }
     default:
       DEBUG(ndbout_c("Invalid Request"));
       abort();

=== modified file 'storage/ndb/src/kernel/blocks/ndbfs/AsyncIoThread.hpp'
--- a/storage/ndb/src/kernel/blocks/ndbfs/AsyncIoThread.hpp	2009-12-14 22:14:34 +0000
+++ b/storage/ndb/src/kernel/blocks/ndbfs/AsyncIoThread.hpp	2010-09-20 13:09:18 +0000
@@ -64,7 +64,8 @@ public:
     rmrf,
     readPartial,
     allocmem,
-    buildindx
+    buildindx,
+    suspend
   };
   Action action;
   union {
@@ -97,6 +98,9 @@ public:
     struct {
       struct mt_BuildIndxReq m_req;
     } build;
+    struct {
+      Uint32 milliseconds;
+    } suspend;
   } par;
   int error;
 

=== modified file 'storage/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp'
--- a/storage/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp	2010-08-23 08:46:34 +0000
+++ b/storage/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp	2010-09-20 13:09:18 +0000
@@ -83,6 +83,7 @@ Ndbfs::Ndbfs(Block_context& ctx) :
   addRecSignal(GSN_SEND_PACKED, &Ndbfs::execSEND_PACKED, true);
   addRecSignal(GSN_BUILD_INDX_IMPL_REQ, &Ndbfs::execBUILD_INDX_IMPL_REQ);
    // Set send signals
+  addRecSignal(GSN_FSSUSPENDORD, &Ndbfs::execFSSUSPENDORD);
 
   theRequestPool = new Pool<Request>;
 }
@@ -790,6 +791,34 @@ Ndbfs::execFSSYNCREQ(Signal * signal)
   ndbrequire(forward(openFile,request));
 }
 
+/*
+ * PR0: File Pointer DR0: User reference DR1: User Pointer
+ */
+void
+Ndbfs::execFSSUSPENDORD(Signal * signal)
+{
+  jamEntry();
+  Uint16 filePointer =  (Uint16)signal->theData[0];
+  Uint32 millis = signal->theData[1];
+  AsyncFile* openFile = theOpenFiles.find(filePointer);
+
+  if (openFile == NULL)
+  {
+    jam(); //file not open
+    return;
+  }
+
+  Request *request = theRequestPool->get();
+  request->error = 0;
+  request->action = Request::suspend;
+  request->set(0, 0, filePointer);
+  request->file = openFile;
+  request->theTrace = signal->getTrace();
+  request->par.suspend.milliseconds = millis;
+
+  ndbrequire(forward(openFile,request));
+}
+
 void 
 Ndbfs::execFSAPPENDREQ(Signal * signal)
 {
@@ -1133,6 +1162,7 @@ Ndbfs::report(Request * request, Signal*
     }
     
     case Request:: end: {
+    case Request:: suspend:
       // Report nothing
       break;
     }
@@ -1227,6 +1257,7 @@ Ndbfs::report(Request * request, Signal*
       break;
     }
     case Request:: end: {
+    case Request:: suspend:
       // Report nothing
       break;
     }

=== modified file 'storage/ndb/src/kernel/blocks/ndbfs/Ndbfs.hpp'
--- a/storage/ndb/src/kernel/blocks/ndbfs/Ndbfs.hpp	2009-12-14 22:14:34 +0000
+++ b/storage/ndb/src/kernel/blocks/ndbfs/Ndbfs.hpp	2010-09-20 13:09:18 +0000
@@ -59,6 +59,7 @@ protected:
   void execALLOC_MEM_REQ(Signal* signal);
   void execSEND_PACKED(Signal*);
   void execBUILD_INDX_IMPL_REQ(Signal* signal);
+  void execFSSUSPENDORD(Signal*);
 
   bool scanningInProgress;
   Uint16 newId();
@@ -129,6 +130,7 @@ protected:
   void execSTTOR(Signal* signal);
   void execALLOC_MEM_REQ(Signal*);
   void execSEND_PACKED(Signal*);
+  void execFSSUSPENDORD(Signal*);
 
 private:
   // Declared but not defined

=== modified file 'storage/ndb/src/kernel/blocks/ndbfs/VoidFs.cpp'
--- a/storage/ndb/src/kernel/blocks/ndbfs/VoidFs.cpp	2010-08-20 11:10:25 +0000
+++ b/storage/ndb/src/kernel/blocks/ndbfs/VoidFs.cpp	2010-09-20 13:09:18 +0000
@@ -53,7 +53,7 @@ VoidFs::VoidFs(Block_context & ctx) :
   addRecSignal(GSN_FSSYNCREQ, &VoidFs::execFSSYNCREQ, true);
   addRecSignal(GSN_FSAPPENDREQ, &VoidFs::execFSAPPENDREQ, true);
   addRecSignal(GSN_FSREMOVEREQ, &VoidFs::execFSREMOVEREQ, true);
-
+  addRecSignal(GSN_FSSUSPENDORD, &VoidFs::execFSSUSPENDORD, true);
    // Set send signals
 }
 
@@ -213,6 +213,15 @@ VoidFs::execFSAPPENDREQ(Signal * signal)
   sendSignal(userRef, GSN_FSAPPENDCONF, signal, 2, JBB);
 }
 
+/*
+ * PR0: File Pointer DR0: User reference DR1: User Pointer
+ */
+void
+VoidFs::execFSSUSPENDORD(Signal * signal)
+{
+  jamEntry();
+}
+
 void
 VoidFs::execDUMP_STATE_ORD(Signal* signal)
 {

=== modified file 'storage/ndb/test/include/NdbRestarter.hpp'
--- a/storage/ndb/test/include/NdbRestarter.hpp	2010-02-18 23:50:31 +0000
+++ b/storage/ndb/test/include/NdbRestarter.hpp	2010-09-20 13:09:18 +0000
@@ -96,6 +96,8 @@ public:
   int getMasterNodeVersion(int& version);
   int getNodeTypeVersionRange(ndb_mgm_node_type type, int& minVer, int& maxVer);
   
+  int getNodeStatus(int nodeId); // return NDB_MGM_NODE_STATUS_*
+
   NdbMgmHandle handle;  
 
   enum NodeSelector

=== modified file 'storage/ndb/test/ndbapi/testSystemRestart.cpp'
--- a/storage/ndb/test/ndbapi/testSystemRestart.cpp	2010-06-18 10:57:02 +0000
+++ b/storage/ndb/test/ndbapi/testSystemRestart.cpp	2010-09-23 06:22:44 +0000
@@ -2347,6 +2347,52 @@ runBug54611(NDBT_Context* ctx, NDBT_Step
   return NDBT_OK;
 }
 
+int
+runBug56961(NDBT_Context* ctx, NDBT_Step* step)
+{
+  NdbRestarter res;
+  Uint32 loops = ctx->getNumLoops();
+  Ndb* pNdb = GETNDB(step);
+  int rows = ctx->getNumRecords();
+
+  int node = res.getNode(NdbRestarter::NS_RANDOM);
+  int val2[] = { DumpStateOrd::CmvmiSetRestartOnErrorInsert, 1 };
+  HugoTransactions hugoTrans(*ctx->getTab());
+
+  for (Uint32 l = 0; l<loops; l++)
+  {
+    ndbout_c("Waiting for %d to restart (5058)", node);
+    res.dumpStateOneNode(node, val2, 2);
+    res.insertErrorInNode(node, 5058);
+
+    hugoTrans.clearTable(pNdb);
+    hugoTrans.loadTable(pNdb, rows);
+    while (hugoTrans.scanUpdateRecords(pNdb, rows) == NDBT_OK &&
+           res.getNodeStatus(node) != NDB_MGM_NODE_STATUS_NOT_STARTED &&
+           res.getNodeStatus(node) != NDB_MGM_NODE_STATUS_NO_CONTACT);
+    res.waitNodesNoStart(&node, 1);
+    res.startNodes(&node, 1);
+    ndbout_c("Waiting for %d to start", node);
+    res.waitClusterStarted();
+
+    ndbout_c("Waiting for %d to restart (5059)", node);
+    res.dumpStateOneNode(node, val2, 2);
+    res.insertErrorInNode(node, 5059);
+
+    hugoTrans.clearTable(pNdb);
+    hugoTrans.loadTable(pNdb, rows);
+    while (hugoTrans.scanUpdateRecords(pNdb, rows) == NDBT_OK &&
+           res.getNodeStatus(node) != NDB_MGM_NODE_STATUS_NOT_STARTED &&
+           res.getNodeStatus(node) != NDB_MGM_NODE_STATUS_NO_CONTACT);
+    res.waitNodesNoStart(&node, 1);
+    res.startNodes(&node, 1);
+    ndbout_c("Waiting for %d to start", node);
+    res.waitClusterStarted();
+  }
+
+  return NDBT_OK;
+}
+
 NDBT_TESTSUITE(testSystemRestart);
 TESTCASE("SR1", 
 	 "Basic system restart test. Focus on testing restart from REDO log.\n"
@@ -2695,6 +2741,11 @@ TESTCASE("Bug54611", "")
   INITIALIZER(runLoadTable);
   INITIALIZER(runBug54611);
 }
+TESTCASE("Bug56961", "")
+{
+  INITIALIZER(runLoadTable);
+  INITIALIZER(runBug56961);
+}
 NDBT_TESTSUITE_END(testSystemRestart);
 
 int main(int argc, const char** argv){

=== modified file 'storage/ndb/test/src/NdbRestarter.cpp'
--- a/storage/ndb/test/src/NdbRestarter.cpp	2010-02-18 23:50:31 +0000
+++ b/storage/ndb/test/src/NdbRestarter.cpp	2010-09-20 13:09:18 +0000
@@ -971,4 +971,18 @@ NdbRestarter::getNodeTypeVersionRange(nd
   return 0;
 }
 
+int
+NdbRestarter::getNodeStatus(int nodeid)
+{
+  if (getStatus() != 0)
+    return -1;
+
+  for (size_t n = 0; n < ndbNodes.size(); n++)
+  {
+    if (ndbNodes[n].node_id == nodeid)
+      return ndbNodes[n].node_status;
+  }
+  return -1;
+}
+
 template class Vector<ndb_mgm_node_state>;


Attachment: [text/bzr-bundle] bzr/jonas@mysql.com-20100923062943-70qeu533uw2bszqi.bundle
Thread
bzr push into mysql-5.1-telco-7.1 branch (jonas:3824 to 3825) Jonas Oreland23 Sep