Commit b62d7a31 authored by jonas@perch.ndb.mysql.com's avatar jonas@perch.ndb.mysql.com
Browse files

ndb - add new testcases/error insert bug#30975

  (recommit for correct merge order)
parent 0b2c8fa3
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@ Next DBTUP 4029
Next DBLQH 5045
Next DBDICT 6007
Next DBDIH 7186
Next DBTC 8040
Next DBTC 8054
Next CMVMI 9000
Next BACKUP 10038
Next DBUTIL 11002
@@ -246,6 +246,8 @@ Delay execution of ABORTCONF signal 2 seconds to generate time-out.

8050: Send ZABORT_TIMEOUT_BREAK delayed

8053: Crash in timeOutFoundLab, state CS_WAIT_COMMIT_CONF

ERROR CODES FOR TESTING TIME-OUT HANDLING IN DBTC
-------------------------------------------------

+32 −0
Original line number Diff line number Diff line
@@ -1300,6 +1300,38 @@ Cmvmi::execDUMP_STATE_ORD(Signal* signal)
  }
#endif
#endif

  if (arg == 9999)
  {
    Uint32 delay = 1000;
    switch(signal->getLength()){
    case 1:
      break;
    case 2:
      delay = signal->theData[1];
      break;
    default:{
      Uint32 dmin = signal->theData[1];
      Uint32 dmax = signal->theData[2];
      delay = dmin + (rand() % (dmax - dmin));
      break;
    }
    }
    
    signal->theData[0] = 9999;
    if (delay == 0)
    {
      execNDB_TAMPER(signal);
    }
    else if (delay < 10)
    {
      sendSignal(reference(), GSN_NDB_TAMPER, signal, 1, JBB);
    }
    else
    {
      sendSignalWithDelay(reference(), GSN_NDB_TAMPER, signal, delay, 1);
    }
  }
}//Cmvmi::execDUMP_STATE_ORD()

void
+1 −0
Original line number Diff line number Diff line
@@ -6373,6 +6373,7 @@ void Dbtc::timeOutFoundLab(Signal* signal, Uint32 TapiConPtr, Uint32 errCode)
    return;
  case CS_WAIT_COMMIT_CONF:
    jam();
    CRASH_INSERTION(8053);
    tcConnectptr.i = apiConnectptr.p->currentTcConnect;
    ptrCheckGuard(tcConnectptr, ctcConnectFilesize, tcConnectRecord);
    arrGuard(apiConnectptr.p->currentReplicaNo, MAX_REPLICAS);
+24 −2
Original line number Diff line number Diff line
@@ -238,6 +238,13 @@ Pgman::execCONTINUEB(Signal* signal)
    }
    else
    {
      if (ERROR_INSERTED(11007))
      {
        ndbout << "No more writes..." << endl;
        SET_ERROR_INSERT_VALUE(11008);
        signal->theData[0] = 9999;
        sendSignalWithDelay(CMVMI_REF, GSN_NDB_TAMPER, signal, 10000, 1);
      }
      signal->theData[0] = m_end_lcp_req.senderData;
      sendSignal(m_end_lcp_req.senderRef, GSN_END_LCP_CONF, signal, 1, JBB);
    }
@@ -1303,6 +1310,13 @@ Pgman::process_lcp(Signal* signal)
    }
    else
    {
      if (ERROR_INSERTED(11007))
      {
        ndbout << "No more writes..." << endl;
        signal->theData[0] = 9999;
        sendSignalWithDelay(CMVMI_REF, GSN_NDB_TAMPER, signal, 10000, 1);
        SET_ERROR_INSERT_VALUE(11008);
      }
      signal->theData[0] = m_end_lcp_req.senderData;
      sendSignal(m_end_lcp_req.senderRef, GSN_END_LCP_CONF, signal, 1, JBB);
    }
@@ -1590,9 +1604,12 @@ Pgman::fswritereq(Signal* signal, Ptr<Page_entry> ptr)
  }
#endif
  
  if (!ERROR_INSERTED(11008))
  {
    sendSignal(NDBFS_REF, GSN_FSWRITEREQ, signal,
               FsReadWriteReq::FixedLength + 1, JBA);
  }
}

void
Pgman::execFSWRITECONF(Signal* signal)
@@ -2454,6 +2471,11 @@ Pgman::execDUMP_STATE_ORD(Signal* signal)
  {
    SET_ERROR_INSERT_VALUE(11006);
  }

  if (signal->theData[0] == 11007)
  {
    SET_ERROR_INSERT_VALUE(11007);
  }
}

// page cache client
+18 −0
Original line number Diff line number Diff line
@@ -36,6 +36,16 @@ public:
		int updateValue = 0,
		bool abort = false);

  int loadTableStartFrom(Ndb*, 
                         int startFrom,
                         int records,
                         int batch = 512,
                         bool allowConstraintViolation = true,
                         int doSleep = 0,
                         bool oneTrans = false,
                         int updateValue = 0,
                         bool abort = false);

  int scanReadRecords(Ndb*, 
		      int records,
		      int abort = 0,
@@ -56,6 +66,11 @@ public:
		    int batchsize = 1,
		    NdbOperation::LockMode = NdbOperation::LM_Read);
  
  int scanUpdateRecords(Ndb*, NdbScanOperation::ScanFlag, 
			int records,
			int abort = 0,
			int parallelism = 0);

  int scanUpdateRecords(Ndb*, 
			int records,
			int abort = 0,
@@ -90,9 +105,12 @@ public:
		  int records,
		  int percentToLock = 1,
		  int lockTime = 1000);

  int fillTable(Ndb*,
		int batch=512);

  int fillTableStartFrom(Ndb*, int startFrom, int batch=512);

  /**
   * Reading using UniqHashIndex with key = pk
   */
Loading