List:Commits« Previous MessageNext Message »
From:gni Date:September 6 2007 1:36am
Subject:bk commit into 5.0 tree (gni:1.2473) BUG#17788
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of gni. When gni does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2007-09-06 09:36:12+08:00, gni@stripped +11 -0
  BUG#17788 LCP should start on out of Redo, ndb_restore should retry more.

  ndb/include/kernel/GlobalSignalNumbers.h@stripped, 2007-09-06 09:36:09+08:00, gni@stripped +4 -3
    add global signal number for starting LCP immediately

  ndb/include/kernel/signaldata/LCP.hpp@stripped, 2007-09-06 09:36:09+08:00, gni@stripped +56 -0
    add signal data for GSN_START_LCPIMME_REQ,GSN_START_LCPIMME_CONF,GSN_START_LCPIMME_REF.

  ndb/src/common/debugger/signaldata/SignalNames.cpp@stripped, 2007-09-06 09:36:09+08:00, gni@stripped +3 -0
    add singal name for GSN_START_LCPIMME_REQ, GSN_START_LCPIMME_CONF, GSN_START_LCPIMMEREF

  ndb/src/kernel/blocks/dbdih/Dbdih.hpp@stripped, 2007-09-06 09:36:09+08:00, gni@stripped +1 -0
    add processing function for GSN_START_LCPIMME_REQ signal.

  ndb/src/kernel/blocks/dbdih/DbdihInit.cpp@stripped, 2007-09-06 09:36:09+08:00, gni@stripped +2 -1
    add processing function for GSN_START_LCPIMME_REQ signal.

  ndb/src/kernel/blocks/dbdih/DbdihMain.cpp@stripped, 2007-09-06 09:36:09+08:00, gni@stripped +26 -0
    implement processing function for GSN_START_LCPIMME_REQ signal.

  ndb/src/kernel/blocks/dblqh/Dblqh.hpp@stripped, 2007-09-06 09:36:09+08:00, gni@stripped +5 -0
    add member variable and processing function for GSN_START_LCPIMME_CONF and GSN_START_LCPIMME_REF.

  ndb/src/kernel/blocks/dblqh/DblqhInit.cpp@stripped, 2007-09-06 09:36:09+08:00, gni@stripped +6 -1
    add member variable and processing function for GSN_START_LCPIMME_CONF and GSN_START_LCPIMME_REF.

  ndb/src/kernel/blocks/dblqh/DblqhMain.cpp@stripped, 2007-09-06 09:36:10+08:00, gni@stripped +60 -3
    when redo log is full and lqh block doesn't start lcp now, send GSN_START_LCPIMME_REQ to master DIH.
    implement processing fucntion for GSN_START_LCPIMME_CONF and GSN_START_LCPIMME_REF.

  ndb/test/ndbapi/Makefile.am@stripped, 2007-09-06 09:36:10+08:00, gni@stripped +2 -1
    Add new test case

  ndb/tools/restore/consumer_restore.cpp@stripped, 2007-09-06 09:36:10+08:00, gni@stripped +3 -1
    define a new const variable to increase the retries.

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	gni
# Host:	dev3-221.dev.cn.tlan
# Root:	/home/ngb/mysql/mysql-5.0/bug17788

--- 1.20/ndb/include/kernel/GlobalSignalNumbers.h	2007-09-06 09:36:17 +08:00
+++ 1.21/ndb/include/kernel/GlobalSignalNumbers.h	2007-09-06 09:36:17 +08:00
@@ -424,9 +424,10 @@
 #define GSN_READ_CONFIG_REQ             334 /* new name for sizealt, local */
 #define GSN_READ_CONFIG_CONF            335 /* new name for sizealt, local */
 
-/* 336 unused */
-/* 337 unused */
-/* 338 unused */
+#define GSN_START_LCPIMME_REQ           336
+#define GSN_START_LCPIMME_CONF          337
+#define GSN_START_LCPIMME_REF           338
+
 #define GSN_OPEN_COMCONF                339
 #define GSN_OPEN_COMREF                 340
 #define GSN_OPEN_COMREQ                 341

--- 1.2/ndb/include/kernel/signaldata/LCP.hpp	2007-09-06 09:36:17 +08:00
+++ 1.3/ndb/include/kernel/signaldata/LCP.hpp	2007-09-06 09:36:17 +08:00
@@ -150,4 +150,60 @@
   Uint32 lcpId;
 };
 
+class StartLcpImmediatelyReq {
+  /**
+   * Sender(s)
+  */
+  friend class Dblqh;
+
+  /**
+   * Receiver(s)
+  */
+  friend class Dbdih;
+public:
+  STATIC_CONST( SignalLength = 1 );  
+
+private:
+  Uint32 senderRef;
+};
+
+class StartLcpImmediatelyConf {
+  /**
+   * Sender(s)
+  */
+  friend class Dbdih;
+
+  /**
+   * Receiver(s)
+  */
+  friend class Dblqh;
+public:
+  STATIC_CONST( SignalLength = 1 );
+
+private:
+  Uint32 masterId;
+};
+
+class StartLcpImmediatelyRef {
+  /**
+   * Sender(s)
+  */
+  friend class Dbdih;
+
+  /**
+   * Receiver(s)
+  */
+  friend class Dblqh;
+public:
+  STATIC_CONST( SignalLength = 1 );
+
+  enum ErrorCode {
+   InProgress = 255,
+   NotMaster = 702
+  };
+
+private:
+  Uint32 errorCode;
+};
+
 #endif

--- 1.13/ndb/src/common/debugger/signaldata/SignalNames.cpp	2007-09-06 09:36:17 +08:00
+++ 1.14/ndb/src/common/debugger/signaldata/SignalNames.cpp	2007-09-06 09:36:17 +08:00
@@ -298,6 +298,9 @@
   ,{ GSN_SHRINKCHECK2,           "SHRINKCHECK2" }
   ,{ GSN_READ_CONFIG_REQ,        "READ_CONFIG_REQ" }
   ,{ GSN_READ_CONFIG_CONF,       "READ_CONFIG_CONF" }
+  ,{ GSN_START_LCPIMME_REQ,      "START_LCPIMME_REQ" }
+  ,{ GSN_START_LCPIMME_CONF,     "START_LCPIMME_CONF" }
+  ,{ GSN_START_LCPIMME_REF,       "START_LCPIMME_REF" }
   ,{ GSN_SR_FRAGIDCONF,          "SR_FRAGIDCONF" }
   ,{ GSN_SR_FRAGIDREF,           "SR_FRAGIDREF" }
   ,{ GSN_SR_FRAGIDREQ,           "SR_FRAGIDREQ" }

--- 1.20/ndb/src/kernel/blocks/dbdih/Dbdih.hpp	2007-09-06 09:36:17 +08:00
+++ 1.21/ndb/src/kernel/blocks/dbdih/Dbdih.hpp	2007-09-06 09:36:17 +08:00
@@ -634,6 +634,7 @@
   void execLCP_FRAG_REP(Signal *);
   void execLCP_COMPLETE_REP(Signal *);
   void execSTART_LCP_REQ(Signal *);
+  void execSTART_LCPIMME_REQ(Signal *);
   void execSTART_LCP_CONF(Signal *);
   MutexHandle2<DIH_START_LCP_MUTEX> c_startLcpMutexHandle;
   void startLcpMutex_locked(Signal* signal, Uint32, Uint32);

--- 1.16/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp	2007-09-06 09:36:17 +08:00
+++ 1.17/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp	2007-09-06 09:36:17 +08:00
@@ -182,7 +182,8 @@
   addRecSignal(GSN_LCP_FRAG_REP, &Dbdih::execLCP_FRAG_REP);
   addRecSignal(GSN_START_LCP_REQ, &Dbdih::execSTART_LCP_REQ);
   addRecSignal(GSN_START_LCP_CONF, &Dbdih::execSTART_LCP_CONF);
-  
+  addRecSignal(GSN_START_LCPIMME_REQ, &Dbdih::execSTART_LCPIMME_REQ);
+
   addRecSignal(GSN_READ_CONFIG_REQ, &Dbdih::execREAD_CONFIG_REQ, true);
   addRecSignal(GSN_UNBLO_DICTCONF, &Dbdih::execUNBLO_DICTCONF);
   addRecSignal(GSN_COPY_ACTIVECONF, &Dbdih::execCOPY_ACTIVECONF);

--- 1.72/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp	2007-09-06 09:36:18 +08:00
+++ 1.73/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp	2007-09-06 09:36:18 +08:00
@@ -9433,6 +9433,32 @@
   }//if
 }//Dbdih::execCOPY_TABCONF()
 
+void Dbdih::execSTART_LCPIMME_REQ(Signal *signal)
+{
+  Uint32 tData0 = signal->theData[0];
+
+  StartLcpImmediatelyReq* req = (StartLcpImmediatelyReq*)signal->getDataPtr();
+  BlockReference senderRef = req->senderRef;
+
+  if (!isMaster()) {
+    StartLcpImmediatelyRef*
+      ref = (StartLcpImmediatelyRef*)signal->getDataPtrSend();
+    ref->errorCode = StartLcpImmediatelyRef::NotMaster;
+    sendSignal(senderRef, GSN_START_LCPIMME_REF,
+               signal, StartLcpImmediatelyRef::SignalLength, JBB);
+    signal->theData[0] = tData0;
+    return;
+  }
+  c_lcpState.ctimer += (1 << c_lcpState.clcpDelay);
+  StartLcpImmediatelyConf*
+    conf = (StartLcpImmediatelyConf*)signal->getDataPtrSend();
+  conf->masterId = getOwnNodeId();
+  sendSignal(senderRef, GSN_START_LCPIMME_CONF,
+             signal, StartLcpImmediatelyConf::SignalLength, JBB);
+  signal->theData[0] = tData0;
+  return;
+}
+
 /*
   3.13   L O C A L   C H E C K P O I N T  (M A S T E R)
   ****************************************************

--- 1.46/ndb/src/kernel/blocks/dblqh/Dblqh.hpp	2007-09-06 09:36:18 +08:00
+++ 1.47/ndb/src/kernel/blocks/dblqh/Dblqh.hpp	2007-09-06 09:36:18 +08:00
@@ -2228,6 +2228,8 @@
   void execTUX_ADD_ATTRCONF(Signal* signal);
   void execTUX_ADD_ATTRREF(Signal* signal);
 
+  void execSTART_LCPIMME_CONF(Signal* signal);
+  void execSTART_LCPIMME_REF(Signal* signal);
   // Statement blocks
 
   void init_acc_ptr_list(ScanRecord*);
@@ -2749,6 +2751,9 @@
 /*OF A LOCAL CHECKPOINT ROUND.                                               */
 /* ------------------------------------------------------------------------- */
   LcpCloseState clcpCompletedState;
+/*WHETHER THE NEW ROUND LCP IS STARTED AFTER SEND GSN_START_LCPIMME_REQ 
+*/
+  bool lcpStartImmeResponded;
 /* ------------------------------------------------------------------------- */
 /*DURING CONNECTION PROCESSES IN SYSTEM RESTART THESE VARIABLES KEEP TRACK   */
 /*OF HOW MANY CONNECTIONS AND RELEASES THAT ARE TO BE PERFORMED.             */

--- 1.18/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp	2007-09-06 09:36:18 +08:00
+++ 1.19/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp	2007-09-06 09:36:18 +08:00
@@ -57,7 +57,7 @@
   tablerec = 0;
   tcConnectionrec = 0;
   tcNodeFailRecord = 0;
-  
+  lcpStartImmeResponded = true; 
   // Records with constant sizes
 
   cLqhTimeOutCount = 0;
@@ -336,6 +336,11 @@
   addRecSignal(GSN_UPDATE_FRAG_DIST_KEY_ORD, 
 	       &Dblqh::execUPDATE_FRAG_DIST_KEY_ORD);
   
+  addRecSignal(GSN_START_LCPIMME_CONF,
+               &Dblqh::execSTART_LCPIMME_CONF);
+  addRecSignal(GSN_START_LCPIMME_REF,
+               &Dblqh::execSTART_LCPIMME_REF);
+
   initData();
 
 #ifdef VM_TRACE

--- 1.104/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp	2007-09-06 09:36:18 +08:00
+++ 1.105/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp	2007-09-06 09:36:18 +08:00
@@ -56,6 +56,9 @@
 #include <signaldata/LCP.hpp>
 #include <KeyDescriptor.hpp>
 
+#include <EventLogger.hpp>
+extern EventLogger g_eventLogger;
+
 // Use DEBUG to print messages that should be
 // seen only when we debug the product
 #ifdef VM_TRACE
@@ -4295,8 +4298,21 @@
       signal->theData[1] = logPartPtr.i;
       sendSignal(cownref, GSN_CONTINUEB, signal, 2, JBB);
     }//if
-    
     terrorCode = ZTAIL_PROBLEM_IN_LOG_ERROR;
+    NodeId masterId = refToNode(cmasterDihBlockref);
+    if ((globalData.m_nodeInfo[masterId].m_version >= MAKE_VERSION(5,0,42)) &&
+        clcpCompletedState == LCP_IDLE &&
+        lcpStartImmeResponded) {
+      Uint32 Tdata0 = signal->theData[0];
+      StartLcpImmediatelyReq*
+        req = (StartLcpImmediatelyReq*)signal->getDataPtr();
+      req->senderRef = reference();
+      sendSignal(cmasterDihBlockref, GSN_START_LCPIMME_REQ,
+               signal, StartLcpImmediatelyReq::SignalLength, JBB);
+      lcpStartImmeResponded = false;
+      g_eventLogger.info("Node %d sends GSN_START_LCPIMME_REQ to Node %d due to out of redo log\n",getOwnNodeId(),masterId);
+      signal->theData[0] = Tdata0;
+    }
     abortErrorLab(signal);
     return;
   }
@@ -4327,6 +4343,21 @@
     if (regLogPartPtr->logPartState == LogPartRecord::TAIL_PROBLEM) {
       jam();
       terrorCode = ZTAIL_PROBLEM_IN_LOG_ERROR;
+      NodeId masterId = refToNode(cmasterDihBlockref);
+      if ((globalData.m_nodeInfo[masterId].m_version >= MAKE_VERSION(5,0,42)) && 
+          clcpCompletedState == LCP_IDLE && 
+          lcpStartImmeResponded) {
+        Uint32 Tdata0 = signal->theData[0];
+        StartLcpImmediatelyReq*
+          req = (StartLcpImmediatelyReq*)signal->getDataPtr();
+        req->senderRef = reference();
+        sendSignal(cmasterDihBlockref, GSN_START_LCPIMME_REQ,
+                 signal, StartLcpImmediatelyReq::SignalLength, JBB);
+        lcpStartImmeResponded = false;
+        g_eventLogger.info("Node %d sends GSN_START_LCPIMME_REQ to Node %d due to out of redo log\n",getOwnNodeId(),masterId);
+        signal->theData[0] = Tdata0;
+      }
+
     } else {
       ndbrequire(regLogPartPtr->logPartState == LogPartRecord::FILE_CHANGE_PROBLEM);
       jam();
@@ -6671,6 +6702,13 @@
 
   TnoOfNodes = nodeFail->noOfNodes;
   UintR index = 0;
+
+  Uint32 newMasterId = nodeFail->masterNodeId;
+  Uint32 oldMasterId = refToNode(cmasterDihBlockref); 
+  if (oldMasterId != newMasterId){
+    cmasterDihBlockref = calcDihBlockRef(newMasterId);
+    lcpStartImmeResponded = true;
+  }
   for (i = 1; i < MAX_NDB_NODES; i++) {
     jam();
     if(NodeBitmask::get(nodeFail->theNodes, i)){
@@ -11565,7 +11603,6 @@
     {
       UintR ToldTailFileNo = sltLogPartPtr.p->logTailFileNo;
       UintR ToldTailMByte = sltLogPartPtr.p->logTailMbyte;
-
       arrGuard(tsltMbyte, 16);
       sltLogPartPtr.p->logTailFileNo = 
          sltLogFilePtr.p->logLastPrepRef[tsltMbyte] >> 16;
@@ -18488,6 +18525,26 @@
   }//if
 }//Dblqh::writeNextLog()
 
+void Dblqh::execSTART_LCPIMME_CONF(Signal* signal)
+{
+  jamEntry();
+  lcpStartImmeResponded = true;
+  return;
+}
+
+void Dblqh::execSTART_LCPIMME_REF(Signal* signal)
+{
+  jamEntry();
+  lcpStartImmeResponded = true;
+  StartLcpImmediatelyRef*
+    ref = (StartLcpImmediatelyRef*)signal->getDataPtrSend();
+  if (ref->errorCode == StartLcpImmediatelyRef::InProgress 
+      || ref->errorCode == StartLcpImmediatelyRef::NotMaster){
+    ndbout_c("LQH:LCP started or START_LCPIMME_REQ to non-master DIH\n");
+  }
+  return;
+}
+
 void
 Dblqh::execDUMP_STATE_ORD(Signal* signal)
 {
@@ -18706,7 +18763,7 @@
       do
       {
 	ptrCheckGuard(logFilePtr, clogFileFileSize, logFileRecord);
-	ndbout_c("  file %d(%d) FileChangeState: %d logFileStatus: %d currentMbyte: %d currentFilepage", 
+	ndbout_c("  file %d(%d) FileChangeState: %d logFileStatus: %d currentMbyte: %d currentFilepage: %d", 
 		 logFilePtr.p->fileNo,
 		 logFilePtr.i,
 		 logFilePtr.p->fileChangeState,

--- 1.29/ndb/test/ndbapi/Makefile.am	2007-09-06 09:36:18 +08:00
+++ 1.30/ndb/test/ndbapi/Makefile.am	2007-09-06 09:36:18 +08:00
@@ -46,7 +46,7 @@
 testTimeout \
 testTransactions \
 testDeadlock \
-ndbapi_slow_select testReadPerf testLcp \
+ndbapi_slow_select testReadPerf testLcp testRedoFileFull\
 testPartitioning \
 testBitfield \
 DbCreate DbAsyncGenerator \
@@ -95,6 +95,7 @@
 ndbapi_slow_select_SOURCES = slow_select.cpp
 testReadPerf_SOURCES = testReadPerf.cpp
 testLcp_SOURCES = testLcp.cpp
+testRedoFileFull_SOURCES = testRedoFileFull.cpp
 testPartitioning_SOURCES = testPartitioning.cpp
 testBitfield_SOURCES = testBitfield.cpp
 DbCreate_SOURCES = bench/mainPopulate.cpp bench/dbPopulate.cpp bench/userInterface.cpp bench/dbPopulate.h bench/userInterface.h bench/testData.h bench/testDefinitions.h bench/ndb_schema.hpp bench/ndb_error.hpp

--- 1.29/ndb/tools/restore/consumer_restore.cpp	2007-09-06 09:36:18 +08:00
+++ 1.30/ndb/tools/restore/consumer_restore.cpp	2007-09-06 09:36:18 +08:00
@@ -28,6 +28,8 @@
 extern const char * g_connect_string;
 extern BaseString g_options;
 
+static int MAX_RETRIES = 100;
+
 bool
 BackupRestore::init()
 {
@@ -340,7 +342,7 @@
 
 void BackupRestore::tuple_a(restore_callback_t *cb)
 {
-  while (cb->retries < 10) 
+  while (cb->retries < MAX_RETRIES) 
   {
     /**
      * start transactions
Thread
bk commit into 5.0 tree (gni:1.2473) BUG#17788gni6 Sep