Commit 583d38f3 authored by unknown's avatar unknown

bug#9757 - ndb

  Impl. stupid mgm lock against shutting down 2 nodes simultaniously
  Add some more dump


ndb/src/kernel/blocks/dbdih/DbdihMain.cpp:
  Impl. 2 new dump 
  1) to query nf handling state
  2) that impl. sending of arbitrary signal...
     to be used with extreme care
ndb/src/kernel/main.cpp:
  enable critical and warnings in out file
ndb/src/mgmsrv/MgmtSrvr.cpp:
  call handleStopReply on nfCompleteRep instead
ndb/src/mgmsrv/MgmtSrvr.hpp:
  call handleStopReply on nfCompleteRep instead
parent 20b9946d
...@@ -69,6 +69,9 @@ ...@@ -69,6 +69,9 @@
#include <signaldata/FsOpenReq.hpp> #include <signaldata/FsOpenReq.hpp>
#include <DebuggerNames.hpp> #include <DebuggerNames.hpp>
#include <EventLogger.hpp>
extern EventLogger g_eventLogger;
#define SYSFILE ((Sysfile *)&sysfileData[0]) #define SYSFILE ((Sysfile *)&sysfileData[0])
#define RETURN_IF_NODE_NOT_ALIVE(node) \ #define RETURN_IF_NODE_NOT_ALIVE(node) \
...@@ -13103,6 +13106,48 @@ Dbdih::execDUMP_STATE_ORD(Signal* signal) ...@@ -13103,6 +13106,48 @@ Dbdih::execDUMP_STATE_ORD(Signal* signal)
} }
} }
} }
if(dumpState->args[0] == 7019 && signal->getLength() == 2)
{
char buf2[8+1];
NodeRecordPtr nodePtr;
nodePtr.i = signal->theData[1];
ptrCheckGuard(nodePtr, MAX_NDB_NODES, nodeRecord);
infoEvent("NF Node %d tc: %d lqh: %d dih: %d dict: %d recNODE_FAILREP: %d",
nodePtr.i,
nodePtr.p->dbtcFailCompleted,
nodePtr.p->dblqhFailCompleted,
nodePtr.p->dbdihFailCompleted,
nodePtr.p->dbdictFailCompleted,
nodePtr.p->recNODE_FAILREP);
infoEvent(" m_NF_COMPLETE_REP: %s m_nodefailSteps: %s",
nodePtr.p->m_NF_COMPLETE_REP.getText(),
nodePtr.p->m_nodefailSteps.getText(buf2));
}
if(dumpState->args[0] == 7020 && signal->getLength() > 3)
{
Uint32 gsn= signal->theData[1];
Uint32 block= signal->theData[2];
Uint32 length= signal->length() - 3;
memmove(signal->theData, signal->theData+3, 4*length);
sendSignal(numberToRef(block, getOwnNodeId()), gsn, signal, length, JBB);
warningEvent("-- SENDING CUSTOM SIGNAL --");
char buf[100], buf2[100];
buf2[0]= 0;
for(Uint32 i = 0; i<length; i++)
{
snprintf(buf, 100, "%s %.8x", buf2, signal->theData[i]);
snprintf(buf2, 100, "%s", buf);
}
warningEvent("gsn: %d block: %s, length: %d theData: %s",
gsn, getBlockName(block, "UNKNOWN"), length, buf);
g_eventLogger.warning("-- SENDING CUSTOM SIGNAL --");
g_eventLogger.warning("gsn: %d block: %s, length: %d theData: %s",
gsn, getBlockName(block, "UNKNOWN"), length, buf);
}
if(dumpState->args[0] == DumpStateOrd::DihDumpLCPState){ if(dumpState->args[0] == DumpStateOrd::DihDumpLCPState){
infoEvent("-- Node %d LCP STATE --", getOwnNodeId()); infoEvent("-- Node %d LCP STATE --", getOwnNodeId());
......
...@@ -58,7 +58,9 @@ int main(int argc, char** argv) ...@@ -58,7 +58,9 @@ int main(int argc, char** argv)
// Print to stdout/console // Print to stdout/console
g_eventLogger.createConsoleHandler(); g_eventLogger.createConsoleHandler();
g_eventLogger.setCategory("NDB"); g_eventLogger.setCategory("NDB");
g_eventLogger.enable(Logger::LL_ON, Logger::LL_CRITICAL);
g_eventLogger.enable(Logger::LL_ON, Logger::LL_ERROR); g_eventLogger.enable(Logger::LL_ON, Logger::LL_ERROR);
g_eventLogger.enable(Logger::LL_ON, Logger::LL_WARNING);
globalEmulatorData.create(); globalEmulatorData.create();
......
...@@ -2061,7 +2061,7 @@ MgmtSrvr::handleStopReply(NodeId nodeId, Uint32 errCode) ...@@ -2061,7 +2061,7 @@ MgmtSrvr::handleStopReply(NodeId nodeId, Uint32 errCode)
} }
void void
MgmtSrvr::handleStatus(NodeId nodeId, bool alive) MgmtSrvr::handleStatus(NodeId nodeId, bool alive, bool nfComplete)
{ {
DBUG_ENTER("MgmtSrvr::handleStatus"); DBUG_ENTER("MgmtSrvr::handleStatus");
Uint32 theData[25]; Uint32 theData[25];
...@@ -2070,9 +2070,15 @@ MgmtSrvr::handleStatus(NodeId nodeId, bool alive) ...@@ -2070,9 +2070,15 @@ MgmtSrvr::handleStatus(NodeId nodeId, bool alive)
m_started_nodes.push_back(nodeId); m_started_nodes.push_back(nodeId);
theData[0] = EventReport::Connected; theData[0] = EventReport::Connected;
} else { } else {
handleStopReply(nodeId, 0);
theData[0] = EventReport::Disconnected; theData[0] = EventReport::Disconnected;
if(nfComplete)
{
theData[0] = EventReport::NodeFailCompleted;
handleStopReply(nodeId, 0);
return;
}
} }
eventReport(_ownNodeId, theData); eventReport(_ownNodeId, theData);
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
...@@ -2097,8 +2103,7 @@ MgmtSrvr::nodeStatusNotification(void* mgmSrv, Uint32 nodeId, ...@@ -2097,8 +2103,7 @@ MgmtSrvr::nodeStatusNotification(void* mgmSrv, Uint32 nodeId,
{ {
DBUG_ENTER("MgmtSrvr::nodeStatusNotification"); DBUG_ENTER("MgmtSrvr::nodeStatusNotification");
DBUG_PRINT("enter",("nodeid= %d, alive= %d, nfComplete= %d", nodeId, alive, nfComplete)); DBUG_PRINT("enter",("nodeid= %d, alive= %d, nfComplete= %d", nodeId, alive, nfComplete));
if(!(!alive && nfComplete)) ((MgmtSrvr*)mgmSrv)->handleStatus(nodeId, alive, nfComplete);
((MgmtSrvr*)mgmSrv)->handleStatus(nodeId, alive);
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
......
...@@ -573,7 +573,7 @@ private: ...@@ -573,7 +573,7 @@ private:
// Returns: - // Returns: -
//************************************************************************** //**************************************************************************
void handleStatus(NodeId nodeId, bool alive); void handleStatus(NodeId nodeId, bool alive, bool nfComplete);
//************************************************************************** //**************************************************************************
// Description: Handle the death of a process // Description: Handle the death of a process
// Parameters: // Parameters:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment