Commit 6caa2495 authored by unknown's avatar unknown
Browse files

Merge perch.ndb.mysql.com:/home/jonas/src/mysql-4.1

into  perch.ndb.mysql.com:/home/jonas/src/41-work

parents 00cfd1a7 b96e8d7a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -64,6 +64,7 @@ public:
    // 19 NDBFS Fipple with O_SYNC, O_CREATE etc.
    // 20-24 BACKUP
    NdbcntrTestStopOnError = 25,
    NdbcntrStopNodes = 70,
    // 100-105 TUP and ACC  
    // 200-240 UTIL
    // 300-305 TRIX
+13 −3
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@
#define FAIL_REP_HPP

#include "SignalData.hpp"
#include <NodeBitmask.hpp>

/**
 * 
@@ -27,6 +28,7 @@ class FailRep {
   * Sender(s) & Reciver(s)
   */
  friend class Qmgr;
  friend class Ndbcntr;
  
  /**
   * For printing
@@ -35,6 +37,7 @@ class FailRep {

public:
  STATIC_CONST( SignalLength = 2 );
  STATIC_CONST( ExtraLength = 1 + NdbNodeBitmask::Size );
  
  enum FailCause {
    ZOWN_FAILURE=0,
@@ -43,13 +46,20 @@ public:
    ZSTART_IN_REGREQ=3,
    ZHEARTBEAT_FAILURE=4,
    ZLINK_FAILURE=5,
    ZOTHERNODE_FAILED_DURING_START=6
    ZOTHERNODE_FAILED_DURING_START=6,
    ZMULTI_NODE_SHUTDOWN = 7,
    ZPARTITIONED_CLUSTER = 8
  };
  
private:
  
  Uint32 failNodeId;
  Uint32 failCause;
  /**
   * Used when failCause == ZPARTITIONED_CLUSTER
   */
  Uint32 president;
  Uint32 partition[NdbNodeBitmask::Size];
};


+22 −16
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@ class StopReq
  friend class MgmtSrvr;

public:
  STATIC_CONST( SignalLength = 9 );
  STATIC_CONST( SignalLength = 9 + NdbNodeBitmask::Size);
  
public:
  Uint32 senderRef;
@@ -49,29 +49,34 @@ public:
  Int32 readOperationTimeout; // Timeout before read operations are aborted
  Int32 operationTimeout;     // Timeout before all operations are aborted

  Uint32 nodes[NdbNodeBitmask::Size];

  static void setSystemStop(Uint32 & requestInfo, bool value);
  static void setPerformRestart(Uint32 & requestInfo, bool value);
  static void setNoStart(Uint32 & requestInfo, bool value);
  static void setInitialStart(Uint32 & requestInfo, bool value);
  static void setEscalateOnNodeFail(Uint32 & requestInfo, bool value);
  /**
   * Don't perform "graceful" shutdown/restart...
   */
  static void setStopAbort(Uint32 & requestInfo, bool value);
  static void setStopNodes(Uint32 & requestInfo, bool value);

  static bool getSystemStop(const Uint32 & requestInfo);
  static bool getPerformRestart(const Uint32 & requestInfo);
  static bool getNoStart(const Uint32 & requestInfo);
  static bool getInitialStart(const Uint32 & requestInfo);
  static bool getEscalateOnNodeFail(const Uint32 & requestInfo);
  static bool getStopAbort(const Uint32 & requestInfo);
  static bool getStopNodes(const Uint32 & requestInfo);
};

struct StopConf
{
  STATIC_CONST( SignalLength = 2 );
  Uint32 senderData;
  union {
    Uint32 nodeState;
    Uint32 nodeId;
  };
};

class StopRef 
@@ -94,7 +99,9 @@ public:
    NodeShutdownInProgress = 1,
    SystemShutdownInProgress = 2,
    NodeShutdownWouldCauseSystemCrash = 3,
    TransactionAbortFailed = 4
    TransactionAbortFailed = 4,
    UnsupportedNodeShutdown = 5,
    MultiNodeShutdownNotMaster = 6
  };
  
public:
@@ -132,16 +139,16 @@ StopReq::getInitialStart(const Uint32 & requestInfo)

inline
bool
StopReq::getEscalateOnNodeFail(const Uint32 & requestInfo)
StopReq::getStopAbort(const Uint32 & requestInfo)
{
  return requestInfo & 16;
  return requestInfo & 32;
}

inline
bool
StopReq::getStopAbort(const Uint32 & requestInfo)
StopReq::getStopNodes(const Uint32 & requestInfo)
{
  return requestInfo & 32;
  return requestInfo & 64;
}


@@ -187,24 +194,23 @@ StopReq::setInitialStart(Uint32 & requestInfo, bool value)

inline
void
StopReq::setEscalateOnNodeFail(Uint32 & requestInfo, bool value)
StopReq::setStopAbort(Uint32 & requestInfo, bool value)
{
  if(value)
    requestInfo |= 16;
    requestInfo |= 32;
  else
    requestInfo &= ~16;
    requestInfo &= ~32;
}

inline
void
StopReq::setStopAbort(Uint32 & requestInfo, bool value)
StopReq::setStopNodes(Uint32 & requestInfo, bool value)
{
  if(value)
    requestInfo |= 32;
    requestInfo |= 64;
  else
    requestInfo &= ~32;
    requestInfo &= ~64;
}


#endif
+5 −2
Original line number Diff line number Diff line
@@ -46,7 +46,9 @@ public:
    Complete = 1,           ///< Wait for a GCP to complete
    CompleteForceStart = 2, ///< Wait for a GCP to complete start one if needed
    CompleteIfRunning = 3,  ///< Wait for ongoing GCP
    CurrentGCI        = 8   ///< Immediately return current GCI
    CurrentGCI        = 8,  ///< Immediately return current GCI
    BlockStartGcp     = 9,
    UnblockStartGcp   = 10
  };

  Uint32 senderRef;
@@ -70,11 +72,12 @@ class WaitGCPConf {
  //friend class Grep::PSCoord;

public:
  STATIC_CONST( SignalLength = 2 );
  STATIC_CONST( SignalLength = 3 );
  
public:
  Uint32 senderData;
  Uint32 gcp;
  Uint32 blockStatus;
};

class WaitGCPRef {
+53 −13
Original line number Diff line number Diff line
@@ -133,6 +133,9 @@ Cmvmi::~Cmvmi()
{
}

#ifdef ERROR_INSERT
NodeBitmask c_error_9000_nodes_mask;
#endif

void Cmvmi::execNDB_TAMPER(Signal* signal) 
{
@@ -390,6 +393,11 @@ void Cmvmi::execOPEN_COMREQ(Signal* signal)

  const Uint32 len = signal->getLength();
  if(len == 2){

#ifdef ERROR_INSERT
    if (! (ERROR_INSERTED(9000) && c_error_9000_nodes_mask.get(tStartingNode)))
#endif
    {
      globalTransporterRegistry.do_connect(tStartingNode);
      globalTransporterRegistry.setIOState(tStartingNode, HaltIO);
      
@@ -400,11 +408,18 @@ void Cmvmi::execOPEN_COMREQ(Signal* signal)
      signal->theData[1] = tStartingNode;
      sendSignal(CMVMI_REF, GSN_EVENT_REP, signal, 2, JBB);
      //-----------------------------------------------------
    }
  } else {
    for(unsigned int i = 1; i < MAX_NODES; i++ ) {
      jam();
      if (i != getOwnNodeId() && getNodeInfo(i).m_type == tData2){
	jam();

#ifdef ERROR_INSERT
	if (ERROR_INSERTED(9000) && c_error_9000_nodes_mask.get(i))
	  continue;
#endif
	
	globalTransporterRegistry.do_connect(i);
	globalTransporterRegistry.setIOState(i, HaltIO);
	
@@ -1010,7 +1025,8 @@ Cmvmi::execDUMP_STATE_ORD(Signal* signal)
  }

  DumpStateOrd * const & dumpState = (DumpStateOrd *)&signal->theData[0];
  if (dumpState->args[0] == DumpStateOrd::CmvmiDumpConnections){
  Uint32 arg = dumpState->args[0];
  if (arg == DumpStateOrd::CmvmiDumpConnections){
    for(unsigned int i = 1; i < MAX_NODES; i++ ){
      const char* nodeTypeStr = "";
      switch(getNodeInfo(i).m_type){
@@ -1043,13 +1059,13 @@ Cmvmi::execDUMP_STATE_ORD(Signal* signal)
    }
  }
  
  if (dumpState->args[0] == DumpStateOrd::CmvmiDumpLongSignalMemory){
  if (arg == DumpStateOrd::CmvmiDumpLongSignalMemory){
    infoEvent("Cmvmi: g_sectionSegmentPool size: %d free: %d",
	      g_sectionSegmentPool.getSize(),
	      g_sectionSegmentPool.getNoOfFree());
  }
  
  if (dumpState->args[0] == DumpStateOrd::CmvmiSetRestartOnErrorInsert)
  if (arg == DumpStateOrd::CmvmiSetRestartOnErrorInsert)
  {
    if(signal->getLength() == 1)
    {
@@ -1069,7 +1085,7 @@ Cmvmi::execDUMP_STATE_ORD(Signal* signal)
    }
  }

  if (dumpState->args[0] == DumpStateOrd::CmvmiTestLongSigWithDelay) {
  if (arg == DumpStateOrd::CmvmiTestLongSigWithDelay) {
    unsigned i;
    Uint32 loopCount = dumpState->args[1];
    const unsigned len0 = 11;
@@ -1097,6 +1113,30 @@ Cmvmi::execDUMP_STATE_ORD(Signal* signal)
    sendSignal(reference(), GSN_TESTSIG, signal, 8, JBB, ptr, 2);
  }

#ifdef ERROR_INSERT
  if (arg == 9000)
  {
    SET_ERROR_INSERT_VALUE(9000);
    for (Uint32 i = 1; i<signal->getLength(); i++)
      c_error_9000_nodes_mask.set(signal->theData[i]);
  }
  
  if (arg == 9001)
  {
    CLEAR_ERROR_INSERT_VALUE;
    for (Uint32 i = 0; i<MAX_NODES; i++)
    {
      if (c_error_9000_nodes_mask.get(i))
      {
	signal->theData[0] = 0;
	signal->theData[1] = i;
	EXECUTE_DIRECT(CMVMI, GSN_OPEN_COMREQ, signal, 2);
      }
    }
    c_error_9000_nodes_mask.clear();
  }
#endif

#ifdef VM_TRACE
#if 0
  {
Loading