Commit aaeb2b38 authored by unknown's avatar unknown
Browse files

Merge mysql.com:/home/stewart/Documents/MySQL/4.1/main

into  mysql.com:/home/stewart/Documents/MySQL/5.0/main


ndb/src/kernel/blocks/qmgr/QmgrMain.cpp:
  Auto merged
ndb/src/mgmclient/CommandInterpreter.cpp:
  Auto merged
ndb/src/mgmsrv/MgmtSrvr.hpp:
  Auto merged
ndb/src/mgmsrv/Services.cpp:
  Auto merged
ndb/src/mgmsrv/Services.hpp:
  Auto merged
ndb/include/kernel/signaldata/EventReport.hpp:
  merge
ndb/src/common/debugger/EventLogger.cpp:
  merge
ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp:
  merge
ndb/src/mgmsrv/MgmtSrvr.cpp:
  merge
parents d5c647f2 80b98425
Loading
Loading
Loading
Loading
+1 −9
Original line number Diff line number Diff line
@@ -553,7 +553,6 @@ extern const GlobalSignalNumber NO_OF_SIGNAL_NAMES;
#define GSN_STATISTICS_CONF             454

#define GSN_START_ORD                   455
/* 456 unused */
/* 457 unused */

#define GSN_EVENT_SUBSCRIBE_REQ         458
@@ -835,14 +834,6 @@ extern const GlobalSignalNumber NO_OF_SIGNAL_NAMES;
/* Start Global Replication */
#define GSN_GREP_REQ                    656

/**
 * Management server
 */
#define GSN_MGM_LOCK_CONFIG_REQ		657
#define GSN_MGM_LOCK_CONFIG_REP		658
#define GSN_MGM_UNLOCK_CONFIG_REQ	659
#define GSN_MGM_UNLOCK_CONFIG_REP	660

#define GSN_UTIL_CREATE_LOCK_REQ        132
#define GSN_UTIL_CREATE_LOCK_REF        133
#define GSN_UTIL_CREATE_LOCK_CONF       188
@@ -900,6 +891,7 @@ extern const GlobalSignalNumber NO_OF_SIGNAL_NAMES;
#define GSN_RESUME_REQ                  682
#define GSN_STOP_REQ                    443
#define GSN_STOP_REF                    444
#define GSN_STOP_CONF                   456
#define GSN_API_VERSION_REQ             697
#define GSN_API_VERSION_CONF            698

+2 −3
Original line number Diff line number Diff line
@@ -49,12 +49,11 @@ class ApiVersionConf {
   */
  friend class MgmtSrv;  
public:
  STATIC_CONST( SignalLength = 3 );
  STATIC_CONST( SignalLength = 4 );
  Uint32 senderRef; 
  Uint32 nodeId; //api node id
  Uint32 version; // Version of API node

  
  Uint32 inet_addr;
};

#endif
+9 −1
Original line number Diff line number Diff line
@@ -67,6 +67,13 @@ public:
  static bool getStopAbort(const Uint32 & requestInfo);
};

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

class StopRef 
{
  /**
@@ -86,7 +93,8 @@ public:
    OK = 0,
    NodeShutdownInProgress = 1,
    SystemShutdownInProgress = 2,
    NodeShutdownWouldCauseSystemCrash = 3
    NodeShutdownWouldCauseSystemCrash = 3,
    TransactionAbortFailed = 4
  };
  
public:
+47 −18
Original line number Diff line number Diff line
@@ -1962,6 +1962,11 @@ Ndbcntr::execRESUME_REQ(Signal* signal){
  //ResumeRef * const ref = (ResumeRef *)&signal->theData[0];
  
  jamEntry();

  signal->theData[0] = EventReport::SingleUser;
  signal->theData[1] = 2;
  sendSignal(CMVMI_REF, GSN_EVENT_REP, signal, 2, JBB);

  //Uint32 senderData = req->senderData;
  //BlockReference senderRef = req->senderRef;
  NodeState newState(NodeState::SL_STARTED);		  
@@ -2000,12 +2005,11 @@ Ndbcntr::execSTOP_REQ(Signal* signal){
    return;
  }

  if(c_stopRec.stopReq.senderRef != 0 && !singleuser){
    jam();
  if(c_stopRec.stopReq.senderRef != 0){
    /**
     * Requested a system shutdown
     */
    if(StopReq::getSystemStop(req->requestInfo)){
    if(!singleuser && StopReq::getSystemStop(req->requestInfo)){
      jam();
      sendSignalWithDelay(reference(), GSN_STOP_REQ, signal, 100,
			  StopReq::SignalLength);
@@ -2027,22 +2031,27 @@ Ndbcntr::execSTOP_REQ(Signal* signal){
  c_stopRec.stopReq = * req;
  c_stopRec.stopInitiatedTime = NdbTick_CurrentMillisecond();
  
  if(StopReq::getSystemStop(c_stopRec.stopReq.requestInfo) && !singleuser) {
  if(!singleuser) {
    if(StopReq::getSystemStop(c_stopRec.stopReq.requestInfo)) {
      jam();
      if(StopReq::getPerformRestart(c_stopRec.stopReq.requestInfo)){
	((Configuration&)theConfiguration).stopOnError(false);
      }
    }
  if(!singleuser) {
    if(!c_stopRec.checkNodeFail(signal)){
      jam();
      return;
    }
  }
  
    signal->theData[0] = NDB_LE_NDBStopStarted;
    signal->theData[1] = StopReq::getSystemStop(c_stopRec.stopReq.requestInfo) ? 1 : 0;
    sendSignal(CMVMI_REF, GSN_EVENT_REP, signal, 2, JBB);
  }
  else
  {
    signal->theData[0] = NDB_LE_SingleUser;
    signal->theData[1] = 0;
    sendSignal(CMVMI_REF, GSN_EVENT_REP, signal, 2, JBB);
  }

  NodeState newState(NodeState::SL_STOPPING_1, 
		     StopReq::getSystemStop(c_stopRec.stopReq.requestInfo));
@@ -2125,9 +2134,11 @@ Ndbcntr::StopRecord::checkNodeFail(Signal* signal){
  
  stopReq.senderRef = 0;

  if (cntr.getNodeState().startLevel != NodeState::SL_SINGLEUSER)
  {
    NodeState newState(NodeState::SL_STARTED); 

    cntr.updateNodeState(signal, newState);
  }

  signal->theData[0] = NDB_LE_NDBStopAborted;
  cntr.sendSignal(CMVMI_REF, GSN_EVENT_REP, signal, 1, JBB);
@@ -2223,12 +2234,24 @@ void Ndbcntr::execABORT_ALL_CONF(Signal* signal){
  jamEntry();
  if(c_stopRec.stopReq.singleuser) {
    jam();

    NodeState newState(NodeState::SL_SINGLEUSER);    
    newState.setSingleUser(true);
    newState.setSingleUserApi(c_stopRec.stopReq.singleUserApi);
    updateNodeState(signal, newState);    
    c_stopRec.stopInitiatedTime = NdbTick_CurrentMillisecond();

    StopConf * const stopConf = (StopConf *)&signal->theData[0];
    stopConf->senderData = c_stopRec.stopReq.senderData;
    stopConf->nodeState  = (Uint32) NodeState::SL_SINGLEUSER;
    sendSignal(c_stopRec.stopReq.senderRef, GSN_STOP_CONF, signal, StopConf::SignalLength, JBB);

    c_stopRec.stopReq.senderRef = 0; // the command is done

    signal->theData[0] = EventReport::SingleUser;
    signal->theData[1] = 1;
    signal->theData[2] = c_stopRec.stopReq.singleUserApi;
    sendSignal(CMVMI_REF, GSN_EVENT_REP, signal, 3, JBB);
  }
  else 
    {
@@ -2246,7 +2269,13 @@ void Ndbcntr::execABORT_ALL_CONF(Signal* signal){

void Ndbcntr::execABORT_ALL_REF(Signal* signal){
  jamEntry();
  ndbrequire(false);
  AbortAllRef *abortAllRef = (AbortAllRef *)&signal->theData[0];
  AbortAllRef::ErrorCode errorCode = (AbortAllRef::ErrorCode) abortAllRef->errorCode;

  StopRef * const stopRef = (StopRef *)&signal->theData[0];
  stopRef->senderData = c_stopRec.stopReq.senderData;
  stopRef->errorCode = StopRef::TransactionAbortFailed;
  sendSignal(c_stopRec.stopReq.senderRef, GSN_STOP_REF, signal, StopRef::SignalLength, JBB);
}

void
+2 −0
Original line number Diff line number Diff line
@@ -2013,6 +2013,8 @@ Qmgr::execAPI_VERSION_REQ(Signal * signal) {
  else
    conf->version =  0;
  conf->nodeId = nodeId;
  struct in_addr in= globalTransporterRegistry.get_connect_address(nodeId);
  conf->inet_addr= in.s_addr;

  sendSignal(senderRef, 
	     GSN_API_VERSION_CONF,
Loading