Commit a6094108 authored by unknown's avatar unknown
Browse files

ndb - bug#27003

  Handle random(not in order) LQHKEYREQ failures during node-restart


ndb/src/kernel/blocks/ERROR_codes.txt:
  Document new error codes
ndb/src/kernel/blocks/dblqh/DblqhMain.cpp:
  Handle random(not in order) LQHKEYREQ failures during node-restart
ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp:
  Error codes for various oom problems
ndb/src/kernel/blocks/dbtup/DbtupGen.cpp:
  move CLEAR_ERROR_INSERT_VALUE to constructor so that it's reasonable to use it for
  restart testing
ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp:
  Add error insert for CopyFragRef
ndb/test/ndbapi/testNodeRestart.cpp:
  Testprg for bug#27003
ndb/test/run-test/daily-basic-tests.txt:
  add testprg
parent b5b3c616
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -489,3 +489,15 @@ Dbdict:
6003 Crash in participant @ CreateTabReq::Prepare
6004 Crash in participant @ CreateTabReq::Commit
6005 Crash in participant @ CreateTabReq::CreateDrop

TUP:
----

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
+16 −3
Original line number Diff line number Diff line
@@ -9641,6 +9641,15 @@ void Dblqh::copyCompletedLab(Signal* signal)
    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();
/*---------------------------------------------------------------------------*/
@@ -9717,13 +9726,16 @@ void Dblqh::continueCopyAfterBlockedLab(Signal* signal)
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) 
@@ -9734,6 +9746,7 @@ void Dblqh::closeCopyLab(Signal* signal)
// Wait until all of those have arrived until we start the
// close process.
/*---------------------------------------------------------------------------*/
    scanptr.p->scanState = ScanRecord::WAIT_LQHKEY_COPY;
    jam();
    return;
  }//if
+24 −0
Original line number Diff line number Diff line
@@ -213,6 +213,30 @@ void Dbtup::execTUP_ALLOCREQ(Signal* signal)
//---------------------------------------------------
  PagePtr pagePtr;
  Uint32 pageOffset;

  if (ERROR_INSERTED(4025))
  {
    signal->theData[0] = 827;
    return;
  }
  if (ERROR_INSERTED(4026))
  {
    CLEAR_ERROR_INSERT_VALUE;
    signal->theData[0] = 827;
    return;
  }
  if (ERROR_INSERTED(4027) && (rand() % 100) > 25)
  {
    signal->theData[0] = 827;
    return;
  }
  if (ERROR_INSERTED(4028) && (rand() % 100) > 25)
  {
    CLEAR_ERROR_INSERT_VALUE;
    signal->theData[0] = 827;
    return;
  }
  
  if (!allocTh(regFragPtr.p,
               regTabPtr.p,
               NORMAL_PAGE,
+1 −1
Original line number Diff line number Diff line
@@ -66,6 +66,7 @@ void Dbtup::initData()
  undoPage = 0;
  totNoOfPagesAllocated = 0;
  cnoOfAllocatedPages = 0;
  CLEAR_ERROR_INSERT_VALUE;
  
  // Records with constant sizes
}//Dbtup::initData()
@@ -570,7 +571,6 @@ void Dbtup::execSTTOR(Signal* signal)
  switch (startPhase) {
  case ZSTARTPHASE1:
    ljam();
    CLEAR_ERROR_INSERT_VALUE;
    cownref = calcTupBlockRef(0);
    break;
  default:
+1 −0
Original line number Diff line number Diff line
@@ -180,6 +180,7 @@ void Ndbcntr::execSYSTEM_ERROR(Signal* signal)
    break;

  case SystemError::CopyFragRefError:
    CRASH_INSERTION(1000);
    BaseString::snprintf(buf, sizeof(buf), 
			 "Killed by node %d as "
			 "copyfrag failed, error: %u",
Loading