18 #include <ndb_global.h>
19 #include <ndbd_exit_codes.h>
23 ndbd_exit_classification classification;
31 #define XST_S ndbd_exit_st_success
32 #define XST_U ndbd_exit_st_unknown
33 #define XST_P ndbd_exit_st_permanent
34 #define XST_R ndbd_exit_st_temporary
35 #define XST_I ndbd_exit_st_filesystem_error
37 #define XNE ndbd_exit_cl_none
38 #define XUE ndbd_exit_cl_unknown
39 #define XIE ndbd_exit_cl_internal_error
40 #define XCE ndbd_exit_cl_configuration_error
41 #define XAE ndbd_exit_cl_arbitration_error
42 #define XRE ndbd_exit_cl_restart_error
43 #define XCR ndbd_exit_cl_resource_configuration_error
44 #define XFF ndbd_exit_cl_filesystem_full_error
45 #define XFI ndbd_exit_cl_filesystem_inconsistency_error
46 #define XFL ndbd_exit_cl_filesystem_limit
50 {NDBD_EXIT_GENERIC, XRE,
"Generic error"},
51 {NDBD_EXIT_PRGERR, XIE,
"Assertion"},
52 {NDBD_EXIT_NODE_NOT_IN_CONFIG, XCE,
53 "node id in the configuration has the wrong type, (i.e. not an NDB node)"},
54 {NDBD_EXIT_SYSTEM_ERROR, XIE,
55 "System error, node killed during node restart by other node"},
56 {NDBD_EXIT_INDEX_NOTINRANGE, XIE,
"Array index out of range"},
57 {NDBD_EXIT_ARBIT_SHUTDOWN, XAE,
"Node lost connection to other nodes and "
58 "can not form a unpartitioned cluster, please investigate if there are "
59 "error(s) on other node(s)"},
60 {NDBD_EXIT_PARTITIONED_SHUTDOWN, XAE,
"Partitioned cluster detected. "
61 "Please check if cluster is already running"},
62 {NDBD_EXIT_NODE_DECLARED_DEAD, XAE,
63 "Node declared dead. See error log for details"},
64 {NDBD_EXIT_POINTER_NOTINRANGE, XIE,
"Pointer too large"},
65 {NDBD_EXIT_SR_OTHERNODEFAILED, XRE,
"Another node failed during system "
66 "restart, please investigate error(s) on other node(s)"},
67 {NDBD_EXIT_NODE_NOT_DEAD, XRE,
"Internal node state conflict, "
68 "most probably resolved by restarting node again"},
69 {NDBD_EXIT_SR_REDOLOG, XFI,
"Error while reading the REDO log"},
70 {NDBD_EXIT_SR_SCHEMAFILE, XFI,
"Error while reading the schema file"},
72 {2311, XIE,
"Conflict when selecting restart type"},
73 {NDBD_EXIT_NO_MORE_UNDOLOG, XCR,
74 "No more free UNDO log, increase UndoIndexBuffer"},
75 {NDBD_EXIT_SR_UNDOLOG, XFI,
76 "Error while reading the datapages and UNDO log"},
77 {NDBD_EXIT_SINGLE_USER_MODE, XRE,
"Data node is not allowed to get added "
78 "to the cluster while it is in single user mode"},
79 {NDBD_EXIT_MEMALLOC, XCE,
"Memory allocation failure, "
80 "please decrease some configuration parameters"},
81 {NDBD_EXIT_BLOCK_JBUFCONGESTION, XIE,
"Job buffer congestion"},
82 {NDBD_EXIT_TIME_QUEUE_SHORT, XIE,
"Error in short time queue"},
83 {NDBD_EXIT_TIME_QUEUE_LONG, XIE,
"Error in long time queue"},
84 {NDBD_EXIT_TIME_QUEUE_DELAY, XIE,
"Error in time queue, too long delay"},
85 {NDBD_EXIT_TIME_QUEUE_INDEX, XIE,
"Time queue index out of range"},
86 {NDBD_EXIT_BLOCK_BNR_ZERO, XIE,
"Send signal error"},
87 {NDBD_EXIT_WRONG_PRIO_LEVEL, XIE,
"Wrong priority level when sending signal"},
88 {NDBD_EXIT_NDBREQUIRE, XIE,
"Internal program error (failed ndbrequire)"},
89 {NDBD_EXIT_NDBASSERT, XIE,
"Internal program error (failed ndbassert)"},
90 {NDBD_EXIT_ERROR_INSERT, XNE,
"Error insert executed" },
92 {NDBD_EXIT_INVALID_CONFIG, XCE,
93 "Invalid configuration received from Management Server"},
95 {NDBD_EXIT_RESOURCE_ALLOC_ERROR, XCE,
96 "Resource allocation error, please review the configuration"},
98 {NDBD_EXIT_NO_MORE_REDOLOG, XCR,
99 "Fatal error due to end of REDO log. Increase NoOfFragmentLogFiles or FragmentLogFileSize" },
104 {NDBD_EXIT_OS_SIGNAL_RECEIVED, XIE,
"Error OS signal received"},
106 {NDBD_EXIT_SR_RESTARTCONFLICT, XRE,
107 "Partial system restart causing conflicting file systems"},
110 {NDBD_EXIT_OUT_OF_LONG_SIGNAL_MEMORY, XCR,
111 "Signal lost, out of long signal memory, please increase LongMessageBuffer"},
112 {NDBD_EXIT_WATCHDOG_TERMINATE, XIE,
"WatchDog terminate, internal error "
113 "or massive overload on the machine running this node"},
114 {NDBD_EXIT_SIGNAL_LOST_SEND_BUFFER_FULL, XCR,
115 "Signal lost, out of send buffer memory, please increase SendBufferMemory or lower the load"},
116 {NDBD_EXIT_SIGNAL_LOST, XIE,
"Signal lost (unknown reason)"},
117 {NDBD_EXIT_ILLEGAL_SIGNAL, XIE,
118 "Illegal signal (version mismatch a possibility)"},
119 {NDBD_EXIT_CONNECTION_SETUP_FAILED, XCE,
"Connection setup failed"},
122 {NDBD_EXIT_RESTART_TIMEOUT, XCE,
123 "Total restart time too long, consider increasing StartFailureTimeout "
124 "or investigate error(s) on other node(s)"},
125 {NDBD_EXIT_RESTART_DURING_SHUTDOWN, XRE,
126 "Node started while node shutdown in progress. "
127 "Please wait until shutdown complete before starting node"},
130 {NDBD_EXIT_MAX_CRASHED_REPLICAS, XFL,
131 "Too many crashed replicas (8 consecutive node restart failures)"},
132 {NDBD_EXIT_MASTER_FAILURE_DURING_NR, XRE,
133 "Unhandled master failure during node restart"},
134 {NDBD_EXIT_LOST_NODE_GROUP, XAE,
135 "All nodes in a node group are unavailable"},
136 {NDBD_EXIT_NO_RESTORABLE_REPLICA, XFI,
137 "Unable to find a restorable replica"},
140 {NDBD_EXIT_SR_OUT_OF_INDEXMEMORY, XCR,
141 "Out of index memory during system restart, please increase IndexMemory"},
144 {NDBD_EXIT_SR_OUT_OF_DATAMEMORY, XCR,
145 "Out of data memory during system restart, please increase DataMemory"},
149 {NDBD_EXIT_AFS_NOPATH, XIE,
"No file system path"},
150 {2802, XIE,
"Channel is full"},
151 {2803, XIE,
"No more threads"},
152 {NDBD_EXIT_AFS_PARAMETER, XIE,
"Bad parameter"},
153 {NDBD_EXIT_AFS_INVALIDPATH, XCE,
"Illegal file system path"},
154 {NDBD_EXIT_AFS_MAXOPEN, XCR,
155 "Max number of open files exceeded, please increase MaxNoOfOpenFiles"},
156 {NDBD_EXIT_AFS_ALREADY_OPEN, XIE,
"File has already been opened"},
158 {NDBD_EXIT_AFS_ENVIRONMENT , XIE,
"Environment error using file"},
159 {NDBD_EXIT_AFS_TEMP_NO_ACCESS , XIE,
"Temporary on access to file"},
160 {NDBD_EXIT_AFS_DISK_FULL , XFF,
"The file system is full"},
161 {NDBD_EXIT_AFS_PERMISSION_DENIED , XCE,
"Received permission denied for file"},
162 {NDBD_EXIT_AFS_INVALID_PARAM , XCE,
"Invalid parameter for file"},
163 {NDBD_EXIT_AFS_UNKNOWN , XIE,
"Unknown file system error"},
164 {NDBD_EXIT_AFS_NO_MORE_RESOURCES , XIE,
165 "System reports no more file system resources"},
166 {NDBD_EXIT_AFS_NO_SUCH_FILE , XFI,
"File not found"},
167 {NDBD_EXIT_AFS_READ_UNDERFLOW , XFI,
"Read underflow"},
169 {NDBD_EXIT_INVALID_LCP_FILE, XFI,
"Invalid LCP" },
170 {NDBD_EXIT_INSUFFICENT_NODES, XRE,
"Insufficent nodes for system restart" },
172 {NDBD_EXIT_UNSUPPORTED_VERSION, XRE,
"Unsupported version" },
174 {NDBD_EXIT_RESTORE_SCHEMA, XCR,
"Failure to restore schema" },
176 {NDBD_EXIT_GRACEFUL_SHUTDOWN_ERROR, XNE,
177 "Graceful shutdown not 100% possible due to mixed ndbd versions" },
181 "No message slogan found (please report a bug if you get this error code)"}
185 ndbd_exit_status status;
190 ndbd_exit_status status;
191 ndbd_exit_classification classification;
203 { XST_P,
"Permanent error, external action needed"},
204 { XST_R,
"Temporary error, restart node"},
205 { XST_I,
"Ndbd file system error, restart node initial"}
215 { XST_S, XNE,
"No error"},
216 { XST_U, XUE,
"Unknown"},
217 { XST_R, XIE,
"Internal error, programming error or missing error message, "
218 "please report a bug"},
219 { XST_P, XCE,
"Configuration error"},
220 { XST_R, XAE,
"Arbitration error"},
221 { XST_R, XRE,
"Restart error"},
222 { XST_P, XCR,
"Resource configuration error"},
223 { XST_P, XFF,
"File system full"},
224 { XST_I, XFI,
"Ndbd file system inconsistency error, please report a bug"},
225 { XST_I, XFL,
"Ndbd file system limit exceeded"}
228 static const int NbExitClassification =
231 const char *ndbd_exit_message(
int faultId, ndbd_exit_classification *cl)
234 while (errArray[i].faultId != faultId && errArray[i].faultId != 0)
236 *cl = errArray[
i].classification;
237 return errArray[
i].text;
240 static const char* empty_xstring =
"";
243 char *ndbd_exit_classification_message(ndbd_exit_classification classification,
244 ndbd_exit_status *status)
247 for (i= 0; i < NbExitClassification; i++)
249 if (StatusExitClassificationMapping[i].classification == classification)
251 *status = StatusExitClassificationMapping[
i].status;
252 return StatusExitClassificationMapping[
i].message;
256 return empty_xstring;
259 const char *ndbd_exit_status_message(ndbd_exit_status status)
262 for (i= 0; i < NbExitStatus; i++)
263 if (StatusExitMessageMapping[i].status == status)
264 return StatusExitMessageMapping[
i].message;
265 return empty_xstring;
268 int ndbd_exit_string(
int err_no,
char *str,
unsigned int size)
272 ndbd_exit_classification cl;
274 const char *
msg = ndbd_exit_message(err_no, &cl);
275 if (msg[0] !=
'\0' && cl != XUE)
277 const char *cl_msg = ndbd_exit_classification_message(cl, &st);
278 const char *st_msg = ndbd_exit_status_message(st);
280 len = my_snprintf(str, size-1,
"%s: %s: %s", msg, st_msg, cl_msg);