List:Commits« Previous MessageNext Message »
From:jonas Date:March 13 2007 12:48pm
Subject:bk commit into 5.1 tree (jonas:1.2465)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 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, 2007-03-13 13:48:29+01:00, jonas@stripped +13 -0
  Merge perch.ndb.mysql.com:/home/jonas/src/51-telco-gca
  into  perch.ndb.mysql.com:/home/jonas/src/51-telco
  MERGE: 1.2403.26.6

  sql/ha_ndbcluster.cc@stripped, 2007-03-13 13:45:40+01:00, jonas@stripped +0 -0
    Auto merged
    MERGE: 1.397.8.2

  storage/ndb/src/kernel/blocks/ERROR_codes.txt@stripped, 2007-03-13 13:45:40+01:00, jonas@stripped +0 -0
    Auto merged
    MERGE: 1.32.1.2

  storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp@stripped, 2007-03-13 13:45:41+01:00, jonas@stripped +0 -0
    Auto merged
    MERGE: 1.112.2.2

  storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp@stripped, 2007-03-13 13:45:41+01:00, jonas@stripped +0 -0
    Auto merged
    MERGE: 1.45.2.1

  storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp@stripped, 2007-03-13 13:45:41+01:00, jonas@stripped +0 -0
    Auto merged
    MERGE: 1.129.4.5

  storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp@stripped, 2007-03-13 13:45:41+01:00, jonas@stripped +0 -0
    Auto merged
    MERGE: 1.50.2.1

  storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp@stripped, 2007-03-13 13:45:41+01:00, jonas@stripped +0 -0
    Auto merged
    MERGE: 1.35.2.1

  storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp@stripped, 2007-03-13 13:45:41+01:00, jonas@stripped +0 -0
    Auto merged
    MERGE: 1.41.3.2

  storage/ndb/src/kernel/blocks/restore.cpp@stripped, 2007-03-13 13:45:41+01:00, jonas@stripped +0 -0
    Auto merged
    MERGE: 1.11.2.1

  storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp@stripped, 2007-03-13 13:45:41+01:00, jonas@stripped +0 -0
    Auto merged
    MERGE: 1.157.3.2

  storage/ndb/src/ndbapi/ndberror.c@stripped, 2007-03-13 13:45:41+01:00, jonas@stripped +0 -0
    Auto merged
    MERGE: 1.82.2.3

  storage/ndb/test/ndbapi/testNodeRestart.cpp@stripped, 2007-03-13 13:48:27+01:00, jonas@stripped +3 -3
    merge
    MERGE: 1.36.2.4

  storage/ndb/test/run-test/daily-basic-tests.txt@stripped, 2007-03-13 13:48:27+01:00, jonas@stripped +4 -4
    merge
    MERGE: 1.61.2.3

# 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/51-telco/RESYNC

--- 1.14/storage/ndb/src/kernel/blocks/restore.cpp	2007-03-13 13:48:34 +01:00
+++ 1.15/storage/ndb/src/kernel/blocks/restore.cpp	2007-03-13 13:48:34 +01:00
@@ -1151,8 +1151,23 @@
 }
 
 void
-Restore::execLQHKEYREF(Signal*)
+Restore::execLQHKEYREF(Signal* signal)
 {
+  FilePtr file_ptr;
+  LqhKeyRef* ref = (LqhKeyRef*)signal->getDataPtr();
+  m_file_pool.getPtr(file_ptr, ref->connectPtr);
+  
+  char buf[255], name[100];
+  BaseString::snprintf(name, sizeof(name), "%u/T%dF%d",
+		       file_ptr.p->m_lcp_no,
+		       file_ptr.p->m_table_id,
+		       file_ptr.p->m_fragment_id);
+  
+  BaseString::snprintf(buf, sizeof(buf),
+		       "Error %d during restore of  %s",
+		       ref->errorCode, name);
+  
+  progError(__LINE__, NDBD_EXIT_INVALID_LCP_FILE, buf);  
   ndbrequire(false);
 }
 

--- 1.76/storage/ndb/test/run-test/daily-basic-tests.txt	2007-03-13 13:48:34 +01:00
+++ 1.77/storage/ndb/test/run-test/daily-basic-tests.txt	2007-03-13 13:48:34 +01:00
@@ -469,6 +469,10 @@
 cmd: testScan
 args: -n ScanVariants
 
+max-time: 1000
+cmd: testNodeRestart
+args: -n Bug27003 T1
+
 max-time: 500
 cmd: testNodeRestart
 args: -n Bug15587 T1

--- 1.35/storage/ndb/src/kernel/blocks/ERROR_codes.txt	2007-03-13 13:48:34 +01:00
+++ 1.36/storage/ndb/src/kernel/blocks/ERROR_codes.txt	2007-03-13 13:48:34 +01:00
@@ -1,8 +1,8 @@
 Next QMGR 1
-Next NDBCNTR 1000
+Next NDBCNTR 1001
 Next NDBFS 2000
 Next DBACC 3002
-Next DBTUP 4024
+Next DBTUP 4029
 Next DBLQH 5045
 Next DBDICT 6007
 Next DBDIH 7181
@@ -512,3 +512,12 @@
 
 4022 - addTuxEntries - fail before add of first entry
 4023 - addTuxEntries - fail add of last entry (the entry for last index)
+
+4025: Fail all inserts with out of memory
+4026: Fail one insert with oom
+4027: Fail inserts randomly with oom
+4028: Fail one random insert with oom
+
+NDBCNTR:
+
+1000: Crash insertion on SystemError::CopyFragRef

--- 1.119/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp	2007-03-13 13:48:34 +01:00
+++ 1.120/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp	2007-03-13 13:48:34 +01:00
@@ -3758,9 +3758,7 @@
       break;
     }
 
-    if(getNodeState().getSingleUserMode() &&
-       (refToNode(signal->getSendersBlockRef()) !=
-        getNodeState().getSingleUserApi()))
+    if (checkSingleUserMode(signal->getSendersBlockRef()))
     {
       jam();
       parseRecord.errorCode = CreateTableRef::SingleUser;
@@ -3959,9 +3957,7 @@
     return;
   }
   
-  if(getNodeState().getSingleUserMode() &&
-     (refToNode(signal->getSendersBlockRef()) !=
-      getNodeState().getSingleUserApi()))
+  if (checkSingleUserMode(signal->getSendersBlockRef()))
   {
     jam();
     alterTableRef(signal, req, AlterTableRef::SingleUser);
@@ -6560,9 +6556,7 @@
     return;
   }
   
-  if(getNodeState().getSingleUserMode() &&
-     (refToNode(signal->getSendersBlockRef()) !=
-      getNodeState().getSingleUserApi()))
+  if (checkSingleUserMode(signal->getSendersBlockRef()))
   {
     jam();
     dropTableRef(signal, req, DropTableRef::SingleUser);
@@ -7776,9 +7770,7 @@
         jam();
         tmperr = CreateIndxRef::Busy;
       }
-      else if(getNodeState().getSingleUserMode() &&
-              (refToNode(senderRef) !=
-               getNodeState().getSingleUserApi()))
+      else if (checkSingleUserMode(senderRef))
       {
         jam();
         tmperr = CreateIndxRef::SingleUser;
@@ -8426,9 +8418,7 @@
         jam();
         tmperr = DropIndxRef::Busy;
       }
-      else if(getNodeState().getSingleUserMode() &&
-              (refToNode(senderRef) !=
-               getNodeState().getSingleUserApi()))
+      else if (checkSingleUserMode(senderRef))
       {
         jam();
         tmperr = DropIndxRef::SingleUser;
@@ -16346,5 +16336,20 @@
   
   sendSignal(ref, GSN_DROP_FILEGROUP_REQ, signal, 
 	     DropFilegroupImplReq::SignalLength, JBB);
+}
+
+/*
+  return 1 if all of the below is true
+  a) node in single user mode
+  b) senderRef is not a db node
+  c) senderRef nodeid is not the singleUserApi
+*/
+int Dbdict::checkSingleUserMode(Uint32 senderRef)
+{
+  Uint32 nodeId = refToNode(senderRef);
+  return
+    getNodeState().getSingleUserMode() &&
+    (getNodeInfo(nodeId).m_type != NodeInfo::DB) &&
+    (nodeId != getNodeState().getSingleUserApi());
 }
 

--- 1.49/storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp	2007-03-13 13:48:34 +01:00
+++ 1.50/storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp	2007-03-13 13:48:34 +01:00
@@ -2649,6 +2649,8 @@
   void send_drop_fg(Signal*, SchemaOp*, DropFilegroupImplReq::RequestInfo);
 
   void drop_undofile_prepare_start(Signal* signal, SchemaOp*);
+
+  int checkSingleUserMode(Uint32 senderRef);
 };
 
 inline bool

--- 1.147/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp	2007-03-13 13:48:34 +01:00
+++ 1.148/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp	2007-03-13 13:48:34 +01:00
@@ -10574,6 +10574,15 @@
     closeCopyLab(signal);
     return;
   }//if
+
+  if (scanptr.p->scanState == ScanRecord::WAIT_LQHKEY_COPY &&
+      scanptr.p->scanErrorCounter)
+  {
+    jam();
+    closeCopyLab(signal);
+    return;
+  }
+  
   if (scanptr.p->scanState == ScanRecord::WAIT_LQHKEY_COPY) {
     jam();
 /*---------------------------------------------------------------------------*/
@@ -10662,13 +10671,16 @@
 void Dblqh::copyLqhKeyRefLab(Signal* signal) 
 {
   ndbrequire(tcConnectptr.p->transid[1] == signal->theData[4]);
-  tcConnectptr.p->copyCountWords -= signal->theData[3];
+  Uint32 copyWords = signal->theData[3];
   scanptr.i = tcConnectptr.p->tcScanRec;
   c_scanRecordPool.getPtr(scanptr);
   scanptr.p->scanErrorCounter++;
   tcConnectptr.p->errorCode = terrorCode;
-  closeCopyLab(signal);
-  return;
+  
+  LqhKeyConf* conf = (LqhKeyConf*)signal->getDataPtrSend();
+  conf->transId1 = copyWords;
+  conf->transId2 = tcConnectptr.p->transid[1];
+  copyCompletedLab(signal);
 }//Dblqh::copyLqhKeyRefLab()
 
 void Dblqh::closeCopyLab(Signal* signal) 
@@ -10679,6 +10691,7 @@
 // Wait until all of those have arrived until we start the
 // close process.
 /*---------------------------------------------------------------------------*/
+    scanptr.p->scanState = ScanRecord::WAIT_LQHKEY_COPY;
     jam();
     return;
   }//if

--- 1.56/storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp	2007-03-13 13:48:34 +01:00
+++ 1.57/storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp	2007-03-13 13:48:34 +01:00
@@ -1259,6 +1259,28 @@
   {  
     shrink_tuple(req_struct, sizes+2, regTabPtr, true);
   }
+
+  if (ERROR_INSERTED(4025))
+  {
+    goto mem_error;
+  }
+
+  if (ERROR_INSERTED(4026))
+  {
+    CLEAR_ERROR_INSERT_VALUE;
+    goto mem_error;
+  }
+
+  if (ERROR_INSERTED(4027) && (rand() % 100) > 25)
+  {
+    goto mem_error;
+  }
+ 
+  if (ERROR_INSERTED(4028) && (rand() % 100) > 25)
+  {
+    CLEAR_ERROR_INSERT_VALUE;
+    goto mem_error;
+  }
   
   /**
    * Alloc memory

--- 1.37/storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp	2007-03-13 13:48:34 +01:00
+++ 1.38/storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp	2007-03-13 13:48:34 +01:00
@@ -113,6 +113,7 @@
   c_no_of_pages = 0;
   
   initData();
+  CLEAR_ERROR_INSERT_VALUE;
 }//Dbtup::Dbtup()
 
 Dbtup::~Dbtup() 
@@ -264,7 +265,6 @@
   switch (startPhase) {
   case ZSTARTPHASE1:
     ljam();
-    CLEAR_ERROR_INSERT_VALUE;
     ndbrequire((c_lqh= (Dblqh*)globalData.getBlock(DBLQH)) != 0);
     ndbrequire((c_tsman= (Tsman*)globalData.getBlock(TSMAN)) != 0);
     ndbrequire((c_lgman= (Lgman*)globalData.getBlock(LGMAN)) != 0);

--- 1.52/storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp	2007-03-13 13:48:34 +01:00
+++ 1.53/storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp	2007-03-13 13:48:34 +01:00
@@ -197,6 +197,7 @@
     break;
 
   case SystemError::CopyFragRefError:
+    CRASH_INSERTION(1000);
     BaseString::snprintf(buf, sizeof(buf), 
 			 "Killed by node %d as "
 			 "copyfrag failed, error: %u",

--- 1.161/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp	2007-03-13 13:48:34 +01:00
+++ 1.162/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp	2007-03-13 13:48:34 +01:00
@@ -1753,6 +1753,7 @@
 	       m_transporter->sendSignal(sig, node));
     if(res != 0){
       DBUG_PRINT("info", ("dictSignal failed to send signal"));
+      m_error.code = 4007;
       continue;
     }    
     
@@ -1770,6 +1771,7 @@
      */
     if(ret_val == -2) //WAIT_NODE_FAILURE
     {
+      m_error.code = 4013;
       continue;
     }
     if(m_waiter.m_state == WST_WAIT_TIMEOUT)

--- 1.46/storage/ndb/test/ndbapi/testNodeRestart.cpp	2007-03-13 13:48:34 +01:00
+++ 1.47/storage/ndb/test/ndbapi/testNodeRestart.cpp	2007-03-13 13:48:34 +01:00
@@ -1415,6 +1415,58 @@
   return NDBT_OK;
 }
 
+int
+runBug27003(NDBT_Context* ctx, NDBT_Step* step)
+{
+  int result = NDBT_OK;
+  int loops = ctx->getNumLoops();
+  int records = ctx->getNumRecords();
+  NdbRestarter res;
+  
+  static const int errnos[] = { 4025, 4026, 4027, 4028, 0 };
+
+  int node = res.getRandomNotMasterNodeId(rand());
+  ndbout_c("node: %d", node);
+  if (res.restartOneDbNode(node, true, true, true))
+    return NDBT_FAILED;
+
+  Uint32 pos = 0;
+  for (Uint32 i = 0; i<loops; i++)
+  {
+    while (errnos[pos] != 0)
+    {
+      ndbout_c("Tesing err: %d", errnos[pos]);
+      
+      if (res.waitNodesNoStart(&node, 1))
+	return NDBT_FAILED;
+
+      if (res.insertErrorInNode(node, 1000))
+	return NDBT_FAILED;
+      
+      if (res.insertErrorInNode(node, errnos[pos]))
+	return NDBT_FAILED;
+      
+      int val2[] = { DumpStateOrd::CmvmiSetRestartOnErrorInsert, 3 };
+      if (res.dumpStateOneNode(node, val2, 2))
+	return NDBT_FAILED;
+      
+      res.startNodes(&node, 1);
+      res.waitNodesStartPhase(&node, 1, 2);
+      pos++;
+    }
+    pos = 0;
+  }
+
+  if (res.waitNodesNoStart(&node, 1))
+    return NDBT_FAILED;
+  
+  res.startNodes(&node, 1);
+  if (res.waitClusterStarted())
+    return NDBT_FAILED;
+  
+  return NDBT_OK;
+}
+
 NDBT_TESTSUITE(testNodeRestart);
 TESTCASE("NoLoad", 
 	 "Test that one node at a time can be stopped and then restarted "\
@@ -1762,6 +1814,9 @@
 TESTCASE("Bug26450", ""){
   INITIALIZER(runLoadTable);
   INITIALIZER(runBug26450);
+}
+TESTCASE("Bug27003", ""){
+  INITIALIZER(runBug27003);
 }
 NDBT_TESTSUITE_END(testNodeRestart);
 

--- 1.418/sql/ha_ndbcluster.cc	2007-03-13 13:48:34 +01:00
+++ 1.419/sql/ha_ndbcluster.cc	2007-03-13 13:48:34 +01:00
@@ -6163,9 +6163,16 @@
     {
       const NdbError err= dict->getNdbError();
       if (err.code == 709 || err.code == 723)
+      {
         error= -1;
+        DBUG_PRINT("info", ("ndb_error.code: %u", ndb_error.code));
+      }
       else
+      {
+        error= -1;
         ndb_error= err;
+        DBUG_PRINT("info", ("ndb_error.code: %u", ndb_error.code));
+      }
       goto err;
     }
     DBUG_PRINT("info", ("Found table %s", tab->getName()));

--- 1.89/storage/ndb/src/ndbapi/ndberror.c	2007-03-13 13:48:35 +01:00
+++ 1.90/storage/ndb/src/ndbapi/ndberror.c	2007-03-13 13:48:35 +01:00
@@ -149,10 +149,12 @@
   /**
    * Unknown result
    */
+  { 4007, DMEC, UR, "Send to ndbd node failed" },
   { 4008, DMEC, UR, "Receive from NDB failed" },
   { 4009, DMEC, UR, "Cluster Failure" },
   { 4012, DMEC, UR, 
     "Request ndbd time-out, maybe due to high load or communication problems"}, 
+  { 4013, DMEC, UR, "Request timed out in waiting for node failure"}, 
   { 4024, DMEC, UR, 
     "Time-out, most likely caused by simple read or cluster failure" }, 
   
Thread
bk commit into 5.1 tree (jonas:1.2465)jonas13 Mar