diff options
author | unknown <tomas@poseidon.ndb.mysql.com> | 2005-10-03 20:04:44 +0200 |
---|---|---|
committer | unknown <tomas@poseidon.ndb.mysql.com> | 2005-10-03 20:04:44 +0200 |
commit | b1d8aa6787323d9482a8fe53ff9e229f0cc4735e (patch) | |
tree | 6aa239494637d4dfb2fe46d86ebe29886352ab1d /ndb/include | |
parent | 257eddcb81823fd6891d01d0d8d00680f4eb9f46 (diff) | |
download | mariadb-git-b1d8aa6787323d9482a8fe53ff9e229f0cc4735e.tar.gz |
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
Diffstat (limited to 'ndb/include')
-rw-r--r-- | ndb/include/Makefile.am | 3 | ||||
-rw-r--r-- | ndb/include/kernel/signaldata/EventReport.hpp | 18 | ||||
-rw-r--r-- | ndb/include/kernel/signaldata/FsRef.hpp | 21 | ||||
-rw-r--r-- | ndb/include/mgmapi/mgmapi.h | 2 | ||||
-rw-r--r-- | ndb/include/mgmapi/ndb_logevent.h | 29 | ||||
-rw-r--r-- | ndb/include/mgmapi/ndbd_exit_codes.h | 143 |
6 files changed, 201 insertions, 15 deletions
diff --git a/ndb/include/Makefile.am b/ndb/include/Makefile.am index 10f297492e9..240101c2004 100644 --- a/ndb/include/Makefile.am +++ b/ndb/include/Makefile.am @@ -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 \ diff --git a/ndb/include/kernel/signaldata/EventReport.hpp b/ndb/include/kernel/signaldata/EventReport.hpp index 9822a0539cf..e1cdbcfd753 100644 --- a/ndb/include/kernel/signaldata/EventReport.hpp +++ b/ndb/include/kernel/signaldata/EventReport.hpp @@ -68,6 +68,8 @@ 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 @@ -75,14 +77,26 @@ public: 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 diff --git a/ndb/include/kernel/signaldata/FsRef.hpp b/ndb/include/kernel/signaldata/FsRef.hpp index 2f7038de4ec..a0e1dc55dae 100644 --- a/ndb/include/kernel/signaldata/FsRef.hpp +++ b/ndb/include/kernel/signaldata/FsRef.hpp @@ -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 }; /** diff --git a/ndb/include/mgmapi/mgmapi.h b/ndb/include/mgmapi/mgmapi.h index 924d65c2847..36dee7193c7 100644 --- a/ndb/include/mgmapi/mgmapi.h +++ b/ndb/include/mgmapi/mgmapi.h @@ -1022,6 +1022,8 @@ extern "C" { int param, const char ** value); int ndb_mgm_purge_stale_sessions(NdbMgmHandle handle, char **); int ndb_mgm_check_connection(NdbMgmHandle handle); + + int ndb_mgm_report_event(NdbMgmHandle handle, Uint32 *data, Uint32 length); #endif #ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED diff --git a/ndb/include/mgmapi/ndb_logevent.h b/ndb/include/mgmapi/ndb_logevent.h index b69379545fc..6025ff2725c 100644 --- a/ndb/include/mgmapi/ndb_logevent.h +++ b/ndb/include/mgmapi/ndb_logevent.h @@ -76,6 +76,10 @@ extern "C" { /** NDB_MGM_EVENT_CATEGORY_STARTUP */ NDB_LE_NDBStopStarted = 17, /** NDB_MGM_EVENT_CATEGORY_STARTUP */ + NDB_LE_NDBStopCompleted = 53, + /** NDB_MGM_EVENT_CATEGORY_STARTUP */ + NDB_LE_NDBStopForced = 59, + /** NDB_MGM_EVENT_CATEGORY_STARTUP */ NDB_LE_NDBStopAborted = 18, /** NDB_MGM_EVENT_CATEGORY_STARTUP */ NDB_LE_StartREDOLog = 19, @@ -148,9 +152,12 @@ extern "C" { /** NDB_MGM_EVENT_CATEGORY_INFO */ NDB_LE_InfoEvent = 49, + /* 50 used */ + /* 51 used */ + /* SINGLE USER */ NDB_LE_SingleUser = 52, - /* NDB_LE_ UNUSED = 53, */ + /* 53 used */ /** NDB_MGM_EVENT_CATEGORY_BACKUP */ NDB_LE_BackupStarted = 54, @@ -160,6 +167,13 @@ extern "C" { NDB_LE_BackupCompleted = 56, /** NDB_MGM_EVENT_CATEGORY_BACKUP */ NDB_LE_BackupAborted = 57 + + /* 58 used in 5.1 */ + /* 59 used */ + /* 60 unused */ + /* 61 unused */ + /* 62 unused */ + }; /** @@ -389,6 +403,19 @@ extern "C" { } NDBStopStarted; /** Log event specific data for for corresponding NDB_LE_ log event */ struct { + unsigned action; + unsigned signum; + } NDBStopCompleted; + /** Log event specific data for for corresponding NDB_LE_ log event */ + struct { + unsigned action; + unsigned signum; + unsigned error; + unsigned sphase; + unsigned extra; + } NDBStopForced; + /** Log event specific data for for corresponding NDB_LE_ log event */ + struct { } NDBStopAborted; /** Log event specific data for for corresponding NDB_LE_ log event */ struct { diff --git a/ndb/include/mgmapi/ndbd_exit_codes.h b/ndb/include/mgmapi/ndbd_exit_codes.h new file mode 100644 index 00000000000..30bf1c4b3fe --- /dev/null +++ b/ndb/include/mgmapi/ndbd_exit_codes.h @@ -0,0 +1,143 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef NDBD_EXIT_CODES_H +#define NDBD_EXIT_CODES_H + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL + +/** + * Exit error codes for NDBD + * + * These errorcodes should be used whenever a condition + * is detected where it's necesssary to shutdown NDB. + * + * Example: When another node fails while a NDB node are performing + * a system restart the node should be shutdown. This + * is kind of an error but the cause of the error is known + * and a proper errormessage describing the problem should + * be printed in error.log. It's therefore important to use + * the proper errorcode. + * + */ + +typedef enum +{ + ndbd_exit_st_success = 0, + ndbd_exit_st_unknown = 1, + ndbd_exit_st_permanent = 2, + ndbd_exit_st_temporary = 3, + ndbd_exit_st_temporary_i = 4, + ndbd_exit_st_bug = 5 +} ndbd_exit_status_enum; + +typedef enum +{ + ndbd_exit_cl_none = 0, + ndbd_exit_cl_unknown = 1, + ndbd_exit_cl_internal_error = 2, + ndbd_exit_cl_configuration_error = 3, + ndbd_exit_cl_arbitration_error = 4, + ndbd_exit_cl_restart_error = 5, + ndbd_exit_cl_resource_configuration_error = 6, + ndbd_exit_cl_filesystem_full_error = 7, + ndbd_exit_cl_filesystem_inconsistency_error = 8 +} ndbd_exit_classification_enum; + +typedef ndbd_exit_status_enum ndbd_exit_status; +typedef ndbd_exit_classification_enum ndbd_exit_classification; + +/* Errorcodes before block division was used */ +#define NDBD_EXIT_PRGERR 2301 +#define NDBD_EXIT_NODE_NOT_IN_CONFIG 2302 +#define NDBD_EXIT_SYSTEM_ERROR 2303 +#define NDBD_EXIT_INDEX_NOTINRANGE 2304 +#define NDBD_EXIT_ARBIT_SHUTDOWN 2305 +#define NDBD_EXIT_POINTER_NOTINRANGE 2306 +#define NDBD_EXIT_SR_OTHERNODEFAILED 2308 +#define NDBD_EXIT_NODE_NOT_DEAD 2309 +#define NDBD_EXIT_SR_REDOLOG 2310 +/* +#define NDBD_EXIT_SR_RESTARTCONFLICT 2311 +*/ +#define NDBD_EXIT_NO_MORE_UNDOLOG 2312 +#define NDBD_EXIT_SR_UNDOLOG 2313 +#define NDBD_EXIT_MEMALLOC 2327 +#define NDBD_EXIT_BLOCK_JBUFCONGESTION 2334 +#define NDBD_EXIT_TIME_QUEUE_SHORT 2335 +#define NDBD_EXIT_TIME_QUEUE_LONG 2336 +#define NDBD_EXIT_TIME_QUEUE_DELAY 2337 +#define NDBD_EXIT_TIME_QUEUE_INDEX 2338 +#define NDBD_EXIT_BLOCK_BNR_ZERO 2339 +#define NDBD_EXIT_WRONG_PRIO_LEVEL 2340 +#define NDBD_EXIT_NDBREQUIRE 2341 +#define NDBD_EXIT_ERROR_INSERT 2342 +#define NDBD_EXIT_NDBASSERT 2343 +#define NDBD_EXIT_INVALID_CONFIG 2350 +#define NDBD_EXIT_OUT_OF_LONG_SIGNAL_MEMORY 2351 + +/* VM 6000-> */ +#define NDBD_EXIT_WATCHDOG_TERMINATE 6000 +#define NDBD_EXIT_SIGNAL_LOST 6001 +#define NDBD_EXIT_SIGNAL_LOST_SEND_BUFFER_FULL 6002 +#define NDBD_EXIT_ILLEGAL_SIGNAL 6003 + +/* TC 6200-> */ +/* DIH 6300-> */ +#define NDBD_EXIT_MAX_CRASHED_REPLICAS 6300 +/* LQH 7200-> */ + + +/* Errorcodes for NDB filesystem */ +#define NDBD_EXIT_AFS_NOPATH 2801 +/* +#define NDBD_EXIT_AFS_CHANNALFULL 2802 +#define NDBD_EXIT_AFS_NOMORETHREADS 2803 +*/ +#define NDBD_EXIT_AFS_PARAMETER 2804 +#define NDBD_EXIT_AFS_INVALIDPATH 2805 +#define NDBD_EXIT_AFS_MAXOPEN 2806 +#define NDBD_EXIT_AFS_ALREADY_OPEN 2807 + +#define NDBD_EXIT_AFS_ENVIRONMENT 2808 +#define NDBD_EXIT_AFS_TEMP_NO_ACCESS 2809 +#define NDBD_EXIT_AFS_DISK_FULL 2810 +#define NDBD_EXIT_AFS_PERMISSION_DENIED 2811 +#define NDBD_EXIT_AFS_INVALID_PARAM 2812 +#define NDBD_EXIT_AFS_UNKNOWN 2813 +#define NDBD_EXIT_AFS_NO_MORE_RESOURCES 2814 +#define NDBD_EXIT_AFS_NO_SUCH_FILE 2815 +#define NDBD_EXIT_AFS_READ_UNDERFLOW 2816 + +const char * +ndbd_exit_message(int faultId, ndbd_exit_classification *cl); +const char * +ndbd_exit_classification_message(ndbd_exit_classification classification, + ndbd_exit_status *status); +const char * +ndbd_exit_status_message(ndbd_exit_status status); + +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* NDBD_EXIT_CODES_H */ |