Commit b89ef309 authored by unknown's avatar unknown
Browse files

bug #7104

+ some extra debug printouts


mysql-test/ndb/ndbcluster.sh:
  fixed debug flag in ndbcluster start script
ndb/include/debugger/EventLogger.hpp:
  bug #7104
ndb/include/kernel/LogLevel.hpp:
  bug #7104
ndb/src/common/debugger/EventLogger.cpp:
  bug #7104
ndb/src/common/portlib/NdbTCP.cpp:
  removed debug printout in Ndb_getInAddr
ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp:
  bug #7104
ndb/src/mgmapi/mgmapi.cpp:
  bug #7104
ndb/src/mgmsrv/MgmtSrvr.cpp:
  bug #7104
ndb/src/mgmsrv/MgmtSrvr.hpp:
  bug #7104
ndb/src/mgmsrv/Services.cpp:
  bug #7104
ndb/src/ndbapi/TransporterFacade.cpp:
  bug #7104
parent 189f1938
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -67,8 +67,7 @@ while test $# -gt 0; do
     initial_ndb=1
     ;;
    --debug*)
     f=`echo "$1" | sed -e "s;--debug=;;"`
     flags_ndb="$flags_ndb $f"
     flags_ndb="$flags_ndb $1"
     ;;
    --status)
     status_ndb=1
+5 −0
Original line number Diff line number Diff line
@@ -48,6 +48,11 @@ public:

  static const EventRepLogLevelMatrix matrix[];
  static const Uint32 matrixSize;
  static int
  EventLoggerBase::event_lookup(int eventType,
				LogLevel::EventCategory &cat,
				Uint32 &threshold, 
				Logger::LoggerLevel &severity);
};

/**
+8 −4
Original line number Diff line number Diff line
@@ -73,7 +73,7 @@ public:
  /**
   * Note level is valid as 0-15
   */
  void setLogLevel(EventCategory ec, Uint32 level = 7);
  int setLogLevel(EventCategory ec, Uint32 level = 7);
  
  /**
   * Get the loglevel (0-15) for a category
@@ -119,10 +119,14 @@ LogLevel::clear(){
}

inline
void
int
LogLevel::setLogLevel(EventCategory ec, Uint32 level){
  assert(ec >= 0 && (Uint32) ec < LOGLEVEL_CATEGORIES);
  if (ec >= 0 && (Uint32) ec < LOGLEVEL_CATEGORIES)
  {
    logLevelData[ec] = (Uint8)level;
    return 0;
  }
  return 1;
}

inline
+25 −10
Original line number Diff line number Diff line
@@ -1342,27 +1342,41 @@ operator<<(NdbOut& out, const LogLevel & ll)
  return out;
}

void 
EventLogger::log(int eventType, const Uint32* theData, NodeId nodeId,
		 const LogLevel* ll)
int
EventLoggerBase::event_lookup(int eventType,
			      LogLevel::EventCategory &cat,
			      Uint32 &threshold, 
			      Logger::LoggerLevel &severity)
{
  Uint32 threshold = 0;
  Logger::LoggerLevel severity = Logger::LL_WARNING;
  LogLevel::EventCategory cat= LogLevel::llInvalid;

  for(unsigned i = 0; i<EventLoggerBase::matrixSize; i++){
    if(EventLoggerBase::matrix[i].eventType == eventType){
      cat = EventLoggerBase::matrix[i].eventCategory;
      threshold = EventLoggerBase::matrix[i].threshold;
      severity = EventLoggerBase::matrix[i].severity;
      break;
      return 0;
    }
  }
  return 1;
}

  if (cat == LogLevel::llInvalid)
    return;
void 
EventLogger::log(int eventType, const Uint32* theData, NodeId nodeId,
		 const LogLevel* ll)
{
  Uint32 threshold = 0;
  Logger::LoggerLevel severity = Logger::LL_WARNING;
  LogLevel::EventCategory cat= LogLevel::llInvalid;

  DBUG_ENTER("EventLogger::log");
  DBUG_PRINT("enter",("eventType=%d, nodeid=%d", eventType, nodeId));

  if (EventLoggerBase::event_lookup(eventType,cat,threshold,severity))
    DBUG_VOID_RETURN;
  
  Uint32 set = ll?ll->getLogLevel(cat) : m_logLevel.getLogLevel(cat);
  DBUG_PRINT("info",("threshold=%d, set=%d", threshold, set));
  if (ll)
    DBUG_PRINT("info",("m_logLevel.getLogLevel=%d", m_logLevel.getLogLevel(cat)));
  if (threshold <= set){
    switch (severity){
    case Logger::LL_ALERT:
@@ -1401,6 +1415,7 @@ EventLogger::log(int eventType, const Uint32* theData, NodeId nodeId,
      break;
    }
  } // if (..
  DBUG_VOID_RETURN;
}

int
+6 −6
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@
extern "C"
int 
Ndb_getInAddr(struct in_addr * dst, const char *address) {
  DBUG_ENTER("Ndb_getInAddr");
  //  DBUG_ENTER("Ndb_getInAddr");
  {
    int tmp_errno;
    struct hostent tmp_hostent, *hp;
@@ -33,7 +33,7 @@ Ndb_getInAddr(struct in_addr * dst, const char *address) {
    {
      memcpy(dst, hp->h_addr, min(sizeof(*dst), (size_t) hp->h_length));
      my_gethostbyname_r_free();
      DBUG_RETURN(0);
      return 0; //DBUG_RETURN(0);
    }
    my_gethostbyname_r_free();
  }
@@ -47,11 +47,11 @@ Ndb_getInAddr(struct in_addr * dst, const char *address) {
#endif
      )
  {
    DBUG_RETURN(0);
    return 0; //DBUG_RETURN(0);
  }
  DBUG_PRINT("error",("inet_addr(%s) - %d - %s",
		      address, errno, strerror(errno)));
  DBUG_RETURN(-1);
  //  DBUG_PRINT("error",("inet_addr(%s) - %d - %s",
  //		      address, errno, strerror(errno)));
  return -1; //DBUG_RETURN(-1);
}

#if 0
Loading