List:Commits« Previous MessageNext Message »
From:Jonas Oreland Date:October 28 2010 12:40pm
Subject:bzr commit into mysql-5.1-telco-6.3 branch (jonas:3325) Bug#57767
View as plain text  
#At file:///home/jonas/src/telco-6.3/ based on revid:jonas@stripped

 3325 Jonas Oreland	2010-10-28
      ndb - bug#57767 - Handle out of tupkey buffer "gracefully" (kill starting node instead of self) during node-recovery

    modified:
      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/test/ndbapi/testNodeRestart.cpp
      storage/ndb/test/run-test/daily-basic-tests.txt
=== modified file 'storage/ndb/src/kernel/blocks/ERROR_codes.txt'
--- a/storage/ndb/src/kernel/blocks/ERROR_codes.txt	2010-10-21 11:45:41 +0000
+++ b/storage/ndb/src/kernel/blocks/ERROR_codes.txt	2010-10-28 12:40:39 +0000
@@ -3,7 +3,7 @@ Next NDBCNTR 1002
 Next NDBFS 2000
 Next DBACC 3002
 Next DBTUP 4032
-Next DBLQH 5060
+Next DBLQH 5061
 Next DBDICT 6026
 Next DBDIH 7229
 Next DBTC 8088

=== modified file 'storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp'
--- a/storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp	2010-09-20 12:44:28 +0000
+++ b/storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp	2010-10-28 12:40:39 +0000
@@ -2509,7 +2509,7 @@ private:
   void nextScanConfScanLab(Signal* signal);
   void nextScanConfCopyLab(Signal* signal);
   void continueScanNextReqLab(Signal* signal);
-  void keyinfoLab(const Uint32 * src, const Uint32 * end);
+  Uint32 keyinfoLab(const Uint32 * src, const Uint32 * end);
   void copySendTupkeyReqLab(Signal* signal);
   void storedProcConfScanLab(Signal* signal);
   void storedProcConfCopyLab(Signal* signal);

=== modified file 'storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp'
--- a/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp	2010-10-20 08:17:33 +0000
+++ b/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp	2010-10-28 12:40:39 +0000
@@ -9773,17 +9773,23 @@ Dblqh::next_scanconf_tupkeyreq(Signal* s
  * -------------------------------------------------------------------------
  *       PRECONDITION:   SCAN_STATE = WAIT_SCAN_KEYINFO
  * ------------------------------------------------------------------------- */
-void 
+Uint32
 Dblqh::keyinfoLab(const Uint32 * src, const Uint32 * end) 
 {
   do {
     jam();
+    if (cfirstfreeDatabuf == RNIL || ERROR_INSERTED_CLEAR(5060))
+    {
+      jam();
+      return ZGET_DATAREC_ERROR;
+    }//if
     seizeTupkeybuf(0);
     databufptr.p->data[0] = * src ++;
     databufptr.p->data[1] = * src ++;
     databufptr.p->data[2] = * src ++;
     databufptr.p->data[3] = * src ++;
   } while (src < end);
+  return 0;
 }//Dblqh::keyinfoLab()
 
 Uint32
@@ -11215,7 +11221,18 @@ void Dblqh::copyTupkeyConfLab(Signal* si
   // Move into databuffer to make packLqhkeyreqLab happy
   memcpy(tcConP->tupkeyData, tmp, 4*4);
   if(len > 4)
-    keyinfoLab(tmp+4, tmp + len);
+  {
+    Uint32 res = keyinfoLab(tmp+4, tmp + len);
+    if (unlikely(res != 0))
+    {
+      jam();
+      scanptr.p->scanErrorCounter++;
+      tcConP->errorCode= ZGET_DATAREC_ERROR;
+      scanptr.p->scanCompletedStatus= ZTRUE;
+      closeCopyLab(signal);
+      return;
+    }
+  }
   LqhKeyReq::setKeyLen(tcConP->reqinfo, len);
 
 /*---------------------------------------------------------------------------*/

=== modified file 'storage/ndb/test/ndbapi/testNodeRestart.cpp'
--- a/storage/ndb/test/ndbapi/testNodeRestart.cpp	2010-10-19 18:26:17 +0000
+++ b/storage/ndb/test/ndbapi/testNodeRestart.cpp	2010-10-28 12:40:39 +0000
@@ -3919,6 +3919,31 @@ runBug56044(NDBT_Context* ctx, NDBT_Step
 }
 
 int
+runBug57767(NDBT_Context* ctx, NDBT_Step* step)
+{
+  NdbRestarter res;
+
+  if (res.getNumDbNodes() < 2)
+    return NDBT_OK;
+
+  int node0 = res.getNode(NdbRestarter::NS_RANDOM);
+  int node1 = res.getRandomNodeSameNodeGroup(node0, rand());
+  ndbout_c("%u %u", node0, node1);
+
+  res.restartOneDbNode(node0, false, true, true);
+  res.waitNodesNoStart(&node0, 1);
+  res.insertErrorInNode(node0, 1000);
+
+  HugoTransactions hugoTrans(*ctx->getTab());
+  hugoTrans.scanUpdateRecords(GETNDB(step), 0);
+
+  res.insertErrorInNode(node1, 5060);
+  res.startNodes(&node0, 1);
+  res.waitClusterStarted();
+  return NDBT_OK;
+}
+
+int
 runBug57522(NDBT_Context* ctx, NDBT_Step* step)
 {
   int loops = ctx->getNumLoops();
@@ -4460,6 +4485,11 @@ TESTCASE("Bug56044", "")
 {
   INITIALIZER(runBug56044);
 }
+TESTCASE("Bug57767", "")
+{
+  INITIALIZER(runLoadTable);
+  INITIALIZER(runBug57767)
+}
 TESTCASE("Bug57522", "")
 {
   INITIALIZER(runBug57522);

=== modified file 'storage/ndb/test/run-test/daily-basic-tests.txt'
--- a/storage/ndb/test/run-test/daily-basic-tests.txt	2010-10-19 18:26:17 +0000
+++ b/storage/ndb/test/run-test/daily-basic-tests.txt	2010-10-28 12:40:39 +0000
@@ -1438,6 +1438,10 @@ max-time: 600
 cmd: testNodeRestart
 args: -n Bug56044 T1
 
+max-time: 600
+cmd: testNodeRestart
+args: -n Bug57767 T2
+
 max-time: 300
 cmd: testSystemRestart
 args: -n Bug45154 D1


Attachment: [text/bzr-bundle] bzr/jonas@mysql.com-20101028124039-udjlkla6iwmczkti.bundle
Thread
bzr commit into mysql-5.1-telco-6.3 branch (jonas:3325) Bug#57767Jonas Oreland28 Oct