summaryrefslogtreecommitdiff
path: root/ndb/src/common/debugger
diff options
context:
space:
mode:
Diffstat (limited to 'ndb/src/common/debugger')
-rw-r--r--ndb/src/common/debugger/EventLogger.cpp55
-rw-r--r--ndb/src/common/debugger/signaldata/FsRef.cpp33
2 files changed, 57 insertions, 31 deletions
diff --git a/ndb/src/common/debugger/EventLogger.cpp b/ndb/src/common/debugger/EventLogger.cpp
index 9a1dcb8a3e1..f785cda5215 100644
--- a/ndb/src/common/debugger/EventLogger.cpp
+++ b/ndb/src/common/debugger/EventLogger.cpp
@@ -25,6 +25,8 @@
#include <NodeState.hpp>
#include <version.h>
+#include <ndbd_exit_codes.h>
+
//
// PUBLIC
//
@@ -84,6 +86,57 @@ void getTextNDBStopStarted(QQQQ) {
"%s shutdown initiated",
(theData[1] == 1 ? "Cluster" : "Node"));
}
+void getRestartAction(Uint32 action, BaseString &str)
+{
+ if (action == 0)
+ return;
+ str.appfmt(", restarting");
+ if (action & 2)
+ str.appfmt(", no start");
+ if (action & 4)
+ str.appfmt(", initial");
+}
+void getTextNDBStopCompleted(QQQQ) {
+ BaseString action_str("");
+ BaseString signum_str("");
+ getRestartAction(theData[1], action_str);
+ if (theData[2])
+ signum_str.appfmt(" Initiated by signal %d.", theData[2]);
+ BaseString::snprintf(m_text, m_text_len,
+ "Node shutdown completed%s.%s",
+ action_str.c_str(),
+ signum_str.c_str());
+}
+void getTextNDBStopForced(QQQQ) {
+ BaseString action_str("");
+ BaseString reason_str("");
+ BaseString sphase_str("");
+ int signum = theData[2];
+ int error = theData[3];
+ int sphase = theData[4];
+ int extra = theData[5];
+ getRestartAction(theData[1],action_str);
+ if (signal)
+ reason_str.appfmt(" Initiated by signal %d.", signum);
+ if (error)
+ {
+ ndbd_exit_classification cl;
+ ndbd_exit_status st;
+ const char *msg = ndbd_exit_message(error, &cl);
+ const char *cl_msg = ndbd_exit_classification_message(cl, &st);
+ const char *st_msg = ndbd_exit_status_message(st);
+ reason_str.appfmt(" Caused by error %d: \'%s(%s). %s\'.",
+ error, msg, cl_msg, st_msg);
+ if (extra != 0)
+ reason_str.appfmt(" (extra info %d)", extra);
+ }
+ if (sphase < 255)
+ sphase_str.appfmt(" Occured during startphase %u.", sphase);
+ BaseString::snprintf(m_text, m_text_len,
+ "Forced node shutdown completed%s.%s%s",
+ action_str.c_str(), sphase_str.c_str(),
+ reason_str.c_str());
+}
void getTextNDBStopAborted(QQQQ) {
BaseString::snprintf(m_text, m_text_len,
"Node shutdown aborted");
@@ -696,6 +749,8 @@ const EventLoggerBase::EventRepLogLevelMatrix EventLoggerBase::matrix[] = {
ROW(CM_REGREF, LogLevel::llStartUp, 8, Logger::LL_INFO ),
ROW(FIND_NEIGHBOURS, LogLevel::llStartUp, 8, Logger::LL_INFO ),
ROW(NDBStopStarted, LogLevel::llStartUp, 1, Logger::LL_INFO ),
+ ROW(NDBStopCompleted, LogLevel::llStartUp, 1, Logger::LL_INFO ),
+ ROW(NDBStopForced, LogLevel::llStartUp, 1, Logger::LL_ALERT ),
ROW(NDBStopAborted, LogLevel::llStartUp, 1, Logger::LL_INFO ),
ROW(StartREDOLog, LogLevel::llStartUp, 10, Logger::LL_INFO ),
ROW(StartLog, LogLevel::llStartUp, 10, Logger::LL_INFO ),
diff --git a/ndb/src/common/debugger/signaldata/FsRef.cpp b/ndb/src/common/debugger/signaldata/FsRef.cpp
index ccf3d6da9c8..ff659208d20 100644
--- a/ndb/src/common/debugger/signaldata/FsRef.cpp
+++ b/ndb/src/common/debugger/signaldata/FsRef.cpp
@@ -30,42 +30,13 @@ printFSREF(FILE * output, const Uint32 * theData,
sig->userPointer);
fprintf(output, " ErrorCode: %d, ", sig->errorCode);
+ ndbd_exit_classification cl;
switch (sig->getErrorCode(sig->errorCode)){
case FsRef::fsErrNone:
fprintf(output, "No error");
break;
- case FsRef::fsErrHardwareFailed:
- fprintf(output, "Hardware failure!");
- break;
- case FsRef::fsErrUserError:
- fprintf(output, "User error!");
- break;
- case FsRef::fsErrEnvironmentError:
- fprintf(output, "Environment error!");
- break;
- case FsRef::fsErrTemporaryNotAccessible:
- fprintf(output, "Temporary not accesible!");
- break;
- case FsRef::fsErrNoSpaceLeftOnDevice:
- fprintf(output, "No space left on device!");
- break;
- case FsRef::fsErrPermissionDenied:
- fprintf(output, "Permission denied!");
- break;
- case FsRef::fsErrInvalidParameters:
- fprintf(output, "Invalid parameters!");
- break;
- case FsRef::fsErrNoMoreResources:
- fprintf(output, "No more resources!");
- break;
- case FsRef::fsErrFileDoesNotExist:
- fprintf(output, "File does not exist!");
- break;
-
- case FsRef::fsErrUnknown:
default:
- fprintf(output, "Unknown!");
- ret = false;
+ fprintf(output, ndbd_exit_message(sig->getErrorCode(sig->errorCode), &cl));
break;
}
fprintf(output, "\n");