Commit a0933646 authored by unknown's avatar unknown
Browse files

Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.0-ndb

into  poseidon.mysql.com:/home/tomas/mysql-5.0-ndb

parents b0879d73 659d3f4e
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@ Next DBACC 3002
Next DBTUP 4014
Next DBLQH 5043
Next DBDICT 6007
Next DBDIH 7178
Next DBDIH 7181
Next DBTC 8039
Next CMVMI 9000
Next BACKUP 10022
@@ -71,6 +71,8 @@ Delay GCP_SAVEREQ by 10 secs

7177: Delay copying of sysfileData in execCOPY_GCIREQ

7180: Crash master during master-take-over in execMASTER_LCPCONF

ERROR CODES FOR TESTING NODE FAILURE, LOCAL CHECKPOINT HANDLING:
-----------------------------------------------------------------

+1 −0
Original line number Diff line number Diff line
@@ -1366,6 +1366,7 @@ private:
  Uint32 csystemnodes;
  Uint32 currentgcp;
  Uint32 c_newest_restorable_gci;
  Uint32 c_set_initial_start_flag;

  enum GcpMasterTakeOverState {
    GMTOS_IDLE = 0,
+1 −0
Original line number Diff line number Diff line
@@ -74,6 +74,7 @@ void Dbdih::initData()
  c_blockCommit    = false;
  c_blockCommitNo  = 1;
  cntrlblockref    = RNIL;
  c_set_initial_start_flag = FALSE;
}//Dbdih::initData()

void Dbdih::initRecords() 
+48 −1
Original line number Diff line number Diff line
@@ -666,6 +666,12 @@ void Dbdih::execCOPY_GCIREQ(Signal* signal)
  {
    jam();
    memcpy(sysfileData, cdata, sizeof(sysfileData));

    if (c_set_initial_start_flag)
    {
      jam();
      Sysfile::setInitialStartOngoing(SYSFILE->systemRestartBits);
    }
  }

  c_copyGCISlave.m_copyReason = reason;
@@ -1259,6 +1265,11 @@ void Dbdih::execNDB_STTOR(Signal* signal)
    // The permission is given by the master node in the alive set.  
    /*-----------------------------------------------------------------------*/
    createMutexes(signal, 0);
    if (cstarttype == NodeState::ST_INITIAL_NODE_RESTART)
    {
      jam();
      c_set_initial_start_flag = TRUE; // In sysfile...
    }
    break;
    
  case ZNDB_SPH3:
@@ -4612,6 +4623,8 @@ void
Dbdih::startLcpMasterTakeOver(Signal* signal, Uint32 nodeId){
  jam();

  Uint32 oldNode = c_lcpMasterTakeOverState.failedNodeId;

  c_lcpMasterTakeOverState.minTableId = ~0;
  c_lcpMasterTakeOverState.minFragId = ~0;
  c_lcpMasterTakeOverState.failedNodeId = nodeId;
@@ -4630,7 +4643,20 @@ Dbdih::startLcpMasterTakeOver(Signal* signal, Uint32 nodeId){
    /**
     * Node failure during master take over...
     */
    g_eventLogger.info("Nodefail during master take over");
    g_eventLogger.info("Nodefail during master take over (old: %d)", oldNode);
  }
  
  NodeRecordPtr nodePtr;
  nodePtr.i = oldNode;
  if (oldNode > 0 && oldNode < MAX_NDB_NODES)
  {
    jam();
    ptrCheckGuard(nodePtr, MAX_NDB_NODES, nodeRecord);
    if (nodePtr.p->m_nodefailSteps.get(NF_LCP_TAKE_OVER))
    {
      jam();
      checkLocalNodefailComplete(signal, oldNode, NF_LCP_TAKE_OVER);
    }
  }
  
  setLocalNodefailHandling(signal, nodeId, NF_LCP_TAKE_OVER);
@@ -5647,6 +5673,14 @@ void Dbdih::execMASTER_LCPREQ(Signal* signal)
  jamEntry();
  const BlockReference newMasterBlockref = req->masterRef;

  if (newMasterBlockref != cmasterdihref)
  {
    jam();
    ndbout_c("resending GSN_MASTER_LCPREQ");
    sendSignalWithDelay(reference(), GSN_MASTER_LCPREQ, signal,
			signal->getLength(), 50);
    return;
  }
  Uint32 failedNodeId = req->failedNodeId;

  /**
@@ -5947,6 +5981,8 @@ void Dbdih::execMASTER_LCPCONF(Signal* signal)
  ptrCheckGuard(nodePtr, MAX_NDB_NODES, nodeRecord);
  nodePtr.p->lcpStateAtTakeOver = lcpState;

  CRASH_INSERTION(7180);
  
#ifdef VM_TRACE
  g_eventLogger.info("MASTER_LCPCONF");
  printMASTER_LCP_CONF(stdout, &signal->theData[0], 0, 0);
@@ -10259,6 +10295,17 @@ Dbdih::sendLCP_COMPLETE_REP(Signal* signal){
  
  sendSignal(c_lcpState.m_masterLcpDihRef, GSN_LCP_COMPLETE_REP, signal, 
	     LcpCompleteRep::SignalLength, JBB);

  /**
   * Say that an initial node restart does not need to be redone
   *   once node has been part of first LCP
   */
  if (c_set_initial_start_flag &&
      c_lcpState.m_participatingLQH.get(getOwnNodeId()))
  {
    jam();
    c_set_initial_start_flag = FALSE;
  }
}

/*-------------------------------------------------------------------------- */
+2 −1
Original line number Diff line number Diff line
@@ -11672,7 +11672,8 @@ void Dblqh::execGCP_SAVEREQ(Signal* signal)
    return;
  }
  if(getNodeState().getNodeRestartInProgress()){
  if(getNodeState().getNodeRestartInProgress() && cstartRecReq == ZFALSE)
  {
    GCPSaveRef * const saveRef = (GCPSaveRef*)&signal->theData[0];
    saveRef->dihPtr = dihPtr;
    saveRef->nodeId = getOwnNodeId();
Loading