Commit a54801ee authored by unknown's avatar unknown
Browse files

NDB ndb_mgm: fix dump and signal log (more to do)


ndb/include/mgmapi/mgmapi.h:
  ndb_mgm: fix dump and signal log (more to do)
ndb/src/common/debugger/signaldata/SignalNames.cpp:
  ndb_mgm: fix dump and signal log (more to do)
ndb/src/mgmapi/mgmapi.cpp:
  ndb_mgm: fix dump and signal log (more to do)
ndb/src/mgmclient/CommandInterpreter.cpp:
  ndb_mgm: fix dump and signal log (more to do)
parent 9addd5f7
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -122,7 +122,10 @@ extern "C" {

    /* Service errors - Single User Mode */
    NDB_MGM_COULD_NOT_ENTER_SINGLE_USER_MODE = 4001,
    NDB_MGM_COULD_NOT_EXIT_SINGLE_USER_MODE = 4002
    NDB_MGM_COULD_NOT_EXIT_SINGLE_USER_MODE = 4002,

    /* Usage errors */
    NDB_MGM_USAGE_ERROR = 5001
  };

  struct Ndb_Mgm_Error_Msg {
@@ -158,7 +161,11 @@ extern "C" {
    { NDB_MGM_COULD_NOT_ENTER_SINGLE_USER_MODE, 
      "Could not enter single user mode" },
    { NDB_MGM_COULD_NOT_EXIT_SINGLE_USER_MODE, 
      "Could not exit single user mode" }
      "Could not exit single user mode" },

    /* Usage errors */
    { NDB_MGM_USAGE_ERROR,
      "Usage error" }
  };
  
  const int ndb_mgm_noOfErrorMsgs = 
+2 −0
Original line number Diff line number Diff line
@@ -446,6 +446,8 @@ const GsnName SignalNames [] = {

  ,{ GSN_STOP_REQ,               "STOP_REQ" }
  ,{ GSN_STOP_REF,               "STOP_REF" }
  ,{ GSN_API_VERSION_REQ,        "API_VERSION_REQ" }
  ,{ GSN_API_VERSION_CONF,       "API_VERSION_CONF" }

  ,{ GSN_ABORT_ALL_REQ,          "ABORT_ALL_REQ" }
  ,{ GSN_ABORT_ALL_REF,          "ABORT_ALL_REF" }
+6 −3
Original line number Diff line number Diff line
@@ -1153,11 +1153,14 @@ ndb_mgm_dump_state(NdbMgmHandle handle, int nodeId, int* _args,
  CHECK_CONNECTED(handle, -1);

  char buf[256];
  char buf2[6];
  buf[0] = 0;
  for (int i = 0; i < _num_args; i++){
    snprintf(buf2, 6, "%d ",  _args[i]);
    strncat(buf, buf2, 256);
    unsigned n = strlen(buf);
    if (n + 20 > sizeof(buf)) {
      SET_ERROR(handle, NDB_MGM_USAGE_ERROR, "arguments too long");
      return -1;
    }
    sprintf(buf + n, "%s%d", i ? " " : "", _args[i]);
  }

  Properties args;
+21 −62
Original line number Diff line number Diff line
@@ -1363,36 +1363,29 @@ CommandInterpreter::executeLog(int processId,
  if (! parseBlockSpecification(parameters, blocks)) {
    return;
  }
  int len=0;  
  int len=1;
  Uint32 i;
  for(i=0; i<blocks.size(); i++) {
    ndbout_c("blocks %s %d",blocks[i], strlen(blocks[i]));
    len +=  strlen(blocks[i]);
    len += strlen(blocks[i]) + 1;
  }
  len += blocks.size()*2;
  char * blockNames = (char*)my_malloc(len,MYF(MY_WME));
  My_auto_ptr<char> ap1(blockNames);
  
  blockNames[0] = 0;
  for(i=0; i<blocks.size(); i++) {
    strcat(blockNames, blocks[i]);
    strcat(blockNames, "|");
  }
  strcat(blockNames, "\0");
  ndbout_c("blocknames %s", blockNames);
  
  /*int res =*/ndb_mgm_log_signals(m_mgmsrv,
  int result = ndb_mgm_log_signals(m_mgmsrv,
				   processId, 
				   NDB_MGM_SIGNAL_LOG_MODE_INOUT, 
				   blockNames,
				   &reply);

#if 0  
  int result = 
    _mgmtSrvr.setSignalLoggingMode(processId, MgmtSrvr::InOut, blocks);
  if (result != 0) {
    ndbout << _mgmtSrvr.getErrorText(result) << endl;
    ndbout_c("Execute LOG on node %d failed.", processId);
    printError();
  }
#endif
}

//*****************************************************************************
@@ -1401,17 +1394,7 @@ void
CommandInterpreter::executeLogIn(int /* processId */,
				 const char* parameters, bool /* all */) 
{
  Vector<const char*> blocks;
  if (! parseBlockSpecification(parameters, blocks)) {
    return;
  }
  
#if 0
  int result = _mgmtSrvr.setSignalLoggingMode(processId, MgmtSrvr::In, blocks);
  if (result != 0) {
    ndbout << _mgmtSrvr.getErrorText(result) << endl;
  }
#endif
  ndbout << "Command LOGIN not implemented." << endl;
}

//*****************************************************************************
@@ -1420,19 +1403,7 @@ void
CommandInterpreter::executeLogOut(int /*processId*/, 
				  const char* parameters, bool /*all*/) 
{
  Vector<const char*> blocks;
  if (! parseBlockSpecification(parameters, blocks)) {
    return;
  }


#if 0
  int result = _mgmtSrvr.setSignalLoggingMode(processId, MgmtSrvr::Out, 
					      blocks);
  if (result != 0) {
    ndbout << _mgmtSrvr.getErrorText(result) << endl;
  }
#endif
  ndbout << "Command LOGOUT not implemented." << endl;
}

//*****************************************************************************
@@ -1441,57 +1412,45 @@ void
CommandInterpreter::executeLogOff(int /*processId*/,
				  const char* parameters, bool /*all*/) 
{
  Vector<const char*> blocks;
  if (! parseBlockSpecification(parameters, blocks)) {
    return;
  }

  
#if 0
  int result = _mgmtSrvr.setSignalLoggingMode(processId, MgmtSrvr::Off, 
					      blocks);
  if (result != 0) {
    ndbout << _mgmtSrvr.getErrorText(result) << endl;
  }
#endif
  ndbout << "Command LOGOFF not implemented." << endl;
}

//*****************************************************************************
//*****************************************************************************
void 
CommandInterpreter::executeTestOn(int /*processId*/, 
CommandInterpreter::executeTestOn(int processId,
				  const char* parameters, bool /*all*/) 
{
  if (! emptyString(parameters)) {
    ndbout << "No parameters expected to this command." << endl;
    return;
  }

#if 0
  int result = _mgmtSrvr.startSignalTracing(processId);
  connect();
  struct ndb_mgm_reply reply;
  int result = ndb_mgm_start_signallog(m_mgmsrv, processId, &reply);
  if (result != 0) {
    ndbout << _mgmtSrvr.getErrorText(result) << endl;
    ndbout_c("Execute TESTON failed.");
    printError();
  }
#endif
}

//*****************************************************************************
//*****************************************************************************
void 
CommandInterpreter::executeTestOff(int /*processId*/, 
CommandInterpreter::executeTestOff(int processId,
				   const char* parameters, bool /*all*/) 
{
  if (! emptyString(parameters)) {
    ndbout << "No parameters expected to this command." << endl;
    return;
  }

#if 0
  int result = _mgmtSrvr.stopSignalTracing(processId);
  connect();
  struct ndb_mgm_reply reply;
  int result = ndb_mgm_stop_signallog(m_mgmsrv, processId, &reply);
  if (result != 0) {
    ndbout << _mgmtSrvr.getErrorText(result) << endl;
    ndbout_c("Execute TESTOFF failed.");
    printError();
  }
#endif
}