Commit b1d8aa67 authored by unknown's avatar unknown
Browse files

added structured ndbd exit codes


BitKeeper/deleted/.del-ErrorMessages.hpp~9ab815d55a13433a:
  Delete: ndb/src/kernel/error/ErrorMessages.hpp
config/ac-macros/ha_ndbcluster.m4:
  add ndb mgmapi to ndbcluster_includes
extra/perror.c:
  perror to print also ndbd exit codes
ndb/include/Makefile.am:
  added new ndbd exit code include file to src distribution
ndb/include/kernel/signaldata/EventReport.hpp:
  backported from 5.1, included node id in event report signal
ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp:
  backported from 5.1, included node id in event report signal
parent 257eddcb
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -140,7 +140,7 @@ AC_DEFUN([MYSQL_CHECK_NDBCLUSTER], [
      AC_MSG_RESULT([Using NDB Cluster])
      AC_DEFINE([HAVE_NDBCLUSTER_DB], [1], [Using Ndb Cluster DB])
      have_ndbcluster="yes"
      ndbcluster_includes="-I../ndb/include -I../ndb/include/ndbapi"
      ndbcluster_includes="-I../ndb/include -I../ndb/include/ndbapi -I../ndb/include/mgmapi"
      ndbcluster_libs="\$(top_builddir)/ndb/src/.libs/libndbclient.a"
      ndbcluster_system_libs=""
      ndb_mgmclient_libs="\$(top_builddir)/ndb/src/mgmclient/libndbmgmclient.la"
+6 −2
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@
#include <my_getopt.h>
#ifdef HAVE_NDBCLUSTER_DB
#include "../ndb/src/ndbapi/ndberror.c"
#include "../ndb/src/kernel/error/ndbd_exit_codes.c"
#endif

static my_bool verbose, print_all_codes;
@@ -235,8 +236,11 @@ int main(int argc,char *argv[])
#ifdef HAVE_NDBCLUSTER_DB
      if (ndb_code)
      {
	if (ndb_error_string(code, ndb_string,  sizeof(ndb_string)) < 0)
	if ((ndb_error_string(code, ndb_string, sizeof(ndb_string)) < 0) &&
	    (ndbd_exit_string(code, ndb_string, sizeof(ndb_string)) < 0))
	{
	    msg= 0;
	}
	else
	  msg= ndb_string;
      }
+2 −1
Original line number Diff line number Diff line
@@ -33,7 +33,8 @@ mgmapi/mgmapi.h \
mgmapi/mgmapi_debug.h \
mgmapi/mgmapi_config_parameters.h \
mgmapi/mgmapi_config_parameters_debug.h \
mgmapi/ndb_logevent.h
mgmapi/ndb_logevent.h \
mgmapi/ndbd_exit_codes.h

noinst_HEADERS = \
ndb_global.h \
+16 −2
Original line number Diff line number Diff line
@@ -68,21 +68,35 @@ public:
     4) Add SentHeartbeat in EventLogger::getText()

   */
  void setNodeId(Uint32 nodeId);
  Uint32 getNodeId() const;
  void setEventType(Ndb_logevent_type type);
  Ndb_logevent_type getEventType() const;
  UintR eventType;    // DATA 0
};

inline
void
EventReport::setNodeId(Uint32 nodeId){
  eventType = (nodeId << 16) | (eventType & 0xFFFF);
}

inline
Uint32
EventReport::getNodeId() const {
  return eventType >> 16;
}

inline
void
EventReport::setEventType(Ndb_logevent_type type){
  eventType = (UintR) type;
  eventType = (eventType & 0xFFFF0000) | (((UintR) type) & 0xFFFF);
}

inline
Ndb_logevent_type
EventReport::getEventType() const {
  return (Ndb_logevent_type)eventType;
  return (Ndb_logevent_type)(eventType & 0xFFFF);
}

#endif
+10 −11
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
#ifndef FS_REF_H
#define FS_REF_H

#include <ndbd_exit_codes.h>
#include "SignalData.hpp"

/**
@@ -37,17 +38,15 @@ struct FsRef {
 */
  enum NdbfsErrorCodeType {
    fsErrNone=0,
    fsErrHardwareFailed=1,
    fsErrUserError=2,
    fsErrEnvironmentError=3,
    fsErrTemporaryNotAccessible=4,
    fsErrNoSpaceLeftOnDevice=5,
    fsErrPermissionDenied=6,
    fsErrInvalidParameters=7,
    fsErrUnknown=8,
    fsErrNoMoreResources=9,
    fsErrFileDoesNotExist=10,
    fsErrReadUnderflow = 11,
    fsErrEnvironmentError=NDBD_EXIT_AFS_ENVIRONMENT,
    fsErrTemporaryNotAccessible=NDBD_EXIT_AFS_TEMP_NO_ACCESS,
    fsErrNoSpaceLeftOnDevice=NDBD_EXIT_AFS_DISK_FULL,
    fsErrPermissionDenied=NDBD_EXIT_AFS_PERMISSION_DENIED,
    fsErrInvalidParameters=NDBD_EXIT_AFS_INVALID_PARAM,
    fsErrUnknown=NDBD_EXIT_AFS_UNKNOWN,
    fsErrNoMoreResources=NDBD_EXIT_AFS_NO_MORE_RESOURCES,
    fsErrFileDoesNotExist=NDBD_EXIT_AFS_NO_SUCH_FILE,
    fsErrReadUnderflow = NDBD_EXIT_AFS_READ_UNDERFLOW,
    fsErrMax
  };
  /**
Loading