List:Commits« Previous MessageNext Message »
From:jonas Date:December 1 2006 9:06am
Subject:bk commit into 5.0 tree (jonas:1.2273) BUG#24717
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of jonas. When jonas 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, 2006-12-01 09:06:01+01:00, jonas@stripped +10 -0
  ndb - bug#24717
    5.0 version
    Add some extra state to try to prevent sending committedread to node too early

  ndb/src/kernel/blocks/dbdih/Dbdih.hpp@stripped, 2006-12-01 09:05:59+01:00,
jonas@stripped +1 -1
    remove extra virtual-indirection

  ndb/src/kernel/blocks/dbdih/DbdihInit.cpp@stripped, 2006-12-01 09:05:59+01:00,
jonas@stripped +2 -1
    remove extra virtual-indirection

  ndb/src/kernel/blocks/dbdih/DbdihMain.cpp@stripped, 2006-12-01 09:05:59+01:00,
jonas@stripped +1 -1
    remove extra virtual-indirection

  ndb/src/kernel/blocks/dblqh/Dblqh.hpp@stripped, 2006-12-01 09:05:59+01:00,
jonas@stripped +2 -0
    Add retry mechanism to send TCKEYREF
      (as extra safety)

  ndb/src/kernel/blocks/dblqh/DblqhMain.cpp@stripped, 2006-12-01 09:05:59+01:00,
jonas@stripped +41 -3
    Add retry mechanism to send TCKEYREF
      (as extra safety)

  ndb/src/kernel/blocks/dbtc/Dbtc.hpp@stripped, 2006-12-01 09:05:59+01:00,
jonas@stripped +3 -1
    Add extra state to prevent sending committed reads to node to early
      (before connection establishment)

  ndb/src/kernel/blocks/dbtc/DbtcInit.cpp@stripped, 2006-12-01 09:05:59+01:00,
jonas@stripped +2 -1
    Add extra state to prevent sending committed reads to node to early
      (before connection establishment)

  ndb/src/kernel/blocks/dbtc/DbtcMain.cpp@stripped, 2006-12-01 09:05:59+01:00,
jonas@stripped +35 -1
    Add extra state to prevent sending committed reads to node to early
      (before connection establishment)

  ndb/src/kernel/vm/SimulatedBlock.cpp@stripped, 2006-12-01 09:05:59+01:00,
jonas@stripped +0 -9
    remove extra virtual-indirection

  ndb/src/kernel/vm/SimulatedBlock.hpp@stripped, 2006-12-01 09:05:59+01:00,
jonas@stripped +0 -1
    remove extra virtual-indirection

# 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:	jonas
# Host:	perch.ndb.mysql.com
# Root:	/home/jonas/src/50-work

--- 1.13/ndb/src/kernel/blocks/dbdih/Dbdih.hpp	2006-12-01 09:06:05 +01:00
+++ 1.14/ndb/src/kernel/blocks/dbdih/Dbdih.hpp	2006-12-01 09:06:05 +01:00
@@ -1602,7 +1602,7 @@
   void startInfoReply(Signal *, Uint32 nodeId);
 
   // DIH specifics for execNODE_START_REP (sendDictUnlockOrd)
-  void exec_node_start_rep(Signal* signal);
+  void execNODE_START_REP(Signal* signal);
 
   /*
    * Lock master DICT.  Only current use is by starting node

--- 1.11/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp	2006-12-01 09:06:05 +01:00
+++ 1.12/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp	2006-12-01 09:06:05 +01:00
@@ -269,7 +269,8 @@
 
   addRecSignal(GSN_DICT_LOCK_CONF, &Dbdih::execDICT_LOCK_CONF);
   addRecSignal(GSN_DICT_LOCK_REF, &Dbdih::execDICT_LOCK_REF);
-
+  addRecSignal(GSN_NODE_START_REP, &Dbdih::execNODE_START_REP);
+  
   apiConnectRecord = 0;  
   connectRecord = 0;  
   fileRecord = 0;  

--- 1.64/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp	2006-12-01 09:06:05 +01:00
+++ 1.65/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp	2006-12-01 09:06:05 +01:00
@@ -1390,7 +1390,7 @@
 }//Dbdih::execNDB_STTOR()
 
 void
-Dbdih::exec_node_start_rep(Signal* signal)
+Dbdih::execNODE_START_REP(Signal* signal)
 {
   /*
    * Send DICT_UNLOCK_ORD when this node is SL_STARTED.

--- 1.40/ndb/src/kernel/blocks/dblqh/Dblqh.hpp	2006-12-01 09:06:05 +01:00
+++ 1.41/ndb/src/kernel/blocks/dblqh/Dblqh.hpp	2006-12-01 09:06:05 +01:00
@@ -236,6 +236,7 @@
 #define ZOPERATION_EVENT_REP 19
 #define ZPREP_DROP_TABLE 20
 #define ZENABLE_EXPAND_CHECK 21
+#define ZRETRY_TCKEYREF 22
 
 /* ------------------------------------------------------------------------- */
 /*        NODE STATE DURING SYSTEM RESTART, VARIABLES CNODES_SR_STATE        */
@@ -2276,6 +2277,7 @@
   void releaseScanrec(Signal* signal);
   void seizeScanrec(Signal* signal);
   Uint32 sendKeyinfo20(Signal* signal, ScanRecord *, TcConnectionrec *);
+  void sendTCKEYREF(Signal*, Uint32 dst, Uint32 route, Uint32 cnt);
   void sendScanFragConf(Signal* signal, Uint32 scanCompleted);
   void initCopyrec(Signal* signal);
   void initCopyTc(Signal* signal);

--- 1.96/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp	2006-12-01 09:06:05 +01:00
+++ 1.97/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp	2006-12-01 09:06:05 +01:00
@@ -464,6 +464,22 @@
       return;
     }
   }
+  case ZRETRY_TCKEYREF:
+  {
+    jam();
+    Uint32 cnt = signal->theData[1];
+    Uint32 ref = signal->theData[2];
+    if (cnt < (10 * 60 * 5))
+    {
+      jam();
+      /**
+       * Only retry for 5 minutes...then hope that API has handled it..somehow
+       */
+      memmove(signal->theData, signal->theData+3, 4*TcKeyRef::SignalLength);
+      sendTCKEYREF(signal, ref, 0, cnt);
+    }
+    return;
+  }
   default:
     ndbrequire(false);
     break;
@@ -2370,7 +2386,7 @@
     tcKeyRef->transId[0] = transid1;
     tcKeyRef->transId[1] = transid2;
     tcKeyRef->errorCode = errCode;
-    sendSignal(apiRef, GSN_TCKEYREF, signal, TcKeyRef::SignalLength, JBB);
+    sendTCKEYREF(signal, apiRef, signal->getSendersBlockRef(), 0);
   } else {
     jam();
 
@@ -6576,8 +6592,7 @@
     tcKeyRef->transId[0] = regTcPtr->transid[0];
     tcKeyRef->transId[1] = regTcPtr->transid[1];
     tcKeyRef->errorCode = regTcPtr->errorCode;
-    sendSignal(regTcPtr->applRef, 
-               GSN_TCKEYREF, signal, TcKeyRef::SignalLength, JBB);
+    sendTCKEYREF(signal, regTcPtr->applRef, regTcPtr->clientBlockref, 0);
     cleanUp(signal);
     return;
   }//if
@@ -6611,6 +6626,29 @@
   }//if
   cleanUp(signal);
 }//Dblqh::continueAfterLogAbortWriteLab()
+
+void
+Dblqh::sendTCKEYREF(Signal* signal, Uint32 ref, Uint32 routeRef, Uint32 cnt)
+{
+  const Uint32 nodeId = refToNode(ref);
+  const bool connectedToNode = getNodeInfo(nodeId).m_connected;
+  
+  if (likely(connectedToNode))
+  {
+    jam();
+    sendSignal(ref, GSN_TCKEYREF, signal, TcKeyRef::SignalLength, JBB);
+  }
+  else
+  {
+    jam();
+    memmove(signal->theData + 3, signal->theData, 4*TcKeyRef::SignalLength);
+    signal->theData[0] = ZRETRY_TCKEYREF;
+    signal->theData[1] = cnt + 1;
+    signal->theData[2] = ref;
+    sendSignalWithDelay(reference(), GSN_CONTINUEB, signal, 100,
+			TcKeyRef::SignalLength + 3);
+  }
+}
 
 /* ########################################################################## 
  * #######                       MODULE TO HANDLE TC FAILURE          ####### 

--- 1.35/ndb/src/kernel/blocks/dbtc/Dbtc.hpp	2006-12-01 09:06:05 +01:00
+++ 1.36/ndb/src/kernel/blocks/dbtc/Dbtc.hpp	2006-12-01 09:06:05 +01:00
@@ -942,7 +942,8 @@
       NF_CHECK_SCAN        = 0x2,
       NF_CHECK_TRANSACTION = 0x4,
       NF_CHECK_DROP_TAB    = 0x8,
-      NF_NODE_FAIL_BITS    = 0xF // All bits...
+      NF_NODE_FAIL_BITS    = 0xF, // All bits...
+      NF_STARTED           = 0x10
     };
     Uint32 m_nf_bits;
     NdbNodeBitmask m_lqh_trans_conf;
@@ -1319,6 +1320,7 @@
   void execCOMMITCONF(Signal* signal);
   void execABORTCONF(Signal* signal);
   void execNODE_FAILREP(Signal* signal);
+  void execNODE_START_REP(Signal* signal);
   void execINCL_NODEREQ(Signal* signal);
   void execTIME_SIGNAL(Signal* signal);
   void execAPI_FAILREQ(Signal* signal);

--- 1.12/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp	2006-12-01 09:06:05 +01:00
+++ 1.13/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp	2006-12-01 09:06:05 +01:00
@@ -290,7 +290,8 @@
   addRecSignal(GSN_WAIT_DROP_TAB_CONF, &Dbtc::execWAIT_DROP_TAB_CONF);
   
   addRecSignal(GSN_ALTER_TAB_REQ, &Dbtc::execALTER_TAB_REQ);
-
+  addRecSignal(GSN_NODE_START_REP, &Dbtc::execNODE_START_REP, true);
+  
   cacheRecord = 0;
   apiConnectRecord = 0;
   tcConnectRecord = 0;

--- 1.99/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp	2006-12-01 09:06:05 +01:00
+++ 1.100/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp	2006-12-01 09:06:05 +01:00
@@ -3068,7 +3068,28 @@
 	  }//if
 	}//for
       }
-    }//if
+
+      if (regTcPtr->tcNodedata[0] != getOwnNodeId())
+      {
+	jam();
+	for (Uint32 i = 0; i < tnoOfBackup + 1; i++)
+	{
+	  HostRecordPtr hostPtr;
+	  hostPtr.i = regTcPtr->tcNodedata[i];
+	  ptrCheckGuard(hostPtr, chostFilesize, hostRecord);
+	  if (hostPtr.p->m_nf_bits & HostRecord::NF_STARTED)
+	  {
+	    jam();
+	    if (i != 0)
+	    {
+	      jam();
+	      regTcPtr->tcNodedata[0] = hostPtr.i;
+	    }
+	    break;
+	  }
+	}
+      }//if
+    }
     jam();
     regTcPtr->lastReplicaNo = 0;
     regTcPtr->noOfNodes = 1;
@@ -7001,6 +7022,19 @@
     nodeFailCheckTransactions(signal, 0, hostptr.i);
   }
 }//Dbtc::execNODE_FAILREP()
+
+void
+Dbtc::execNODE_START_REP(Signal* signal)
+{
+  Uint32 nodeId = signal->theData[0];
+  hostptr.i = nodeId;
+  ptrCheckGuard(hostptr, chostFilesize, hostRecord);
+  if (hostptr.p->m_nf_bits == 0)
+  {
+    jam();
+    hostptr.p->m_nf_bits |= HostRecord::NF_STARTED;
+  }
+}
 
 void
 Dbtc::checkNodeFailComplete(Signal* signal, 

--- 1.25/ndb/src/kernel/vm/SimulatedBlock.cpp	2006-12-01 09:06:05 +01:00
+++ 1.26/ndb/src/kernel/vm/SimulatedBlock.cpp	2006-12-01 09:06:05 +01:00
@@ -917,15 +917,6 @@
 void
 SimulatedBlock::execNODE_START_REP(Signal* signal)
 {
-  // common stuff for all blocks
-
-  // block specific stuff by virtual method override (default empty)
-  exec_node_start_rep(signal);
-}
-
-void
-SimulatedBlock::exec_node_start_rep(Signal* signal)
-{
 }
 
 #ifdef VM_TRACE_TIME

--- 1.18/ndb/src/kernel/vm/SimulatedBlock.hpp	2006-12-01 09:06:05 +01:00
+++ 1.19/ndb/src/kernel/vm/SimulatedBlock.hpp	2006-12-01 09:06:05 +01:00
@@ -424,7 +424,6 @@
   void execSIGNAL_DROPPED_REP(Signal* signal);
   void execCONTINUE_FRAGMENTED(Signal* signal);
   void execNODE_START_REP(Signal* signal);
-  virtual void exec_node_start_rep(Signal* signal);
 
   Uint32 c_fragmentIdCounter;
   ArrayPool<FragmentInfo> c_fragmentInfoPool;
Thread
bk commit into 5.0 tree (jonas:1.2273) BUG#24717jonas1 Dec