Commit 058019f6 authored by unknown's avatar unknown

ndb - bug#18118

  timeslice DUMP(7015)


ndb/include/kernel/signaldata/DumpStateOrd.hpp:
  doc...
ndb/src/kernel/blocks/dbdih/DbdihMain.cpp:
  timeslice DUMP(7015)
parent 8ed36cb6
...@@ -126,6 +126,9 @@ public: ...@@ -126,6 +126,9 @@ public:
DihAllAllowNodeStart = 7016, DihAllAllowNodeStart = 7016,
DihMinTimeBetweenLCP = 7017, DihMinTimeBetweenLCP = 7017,
DihMaxTimeBetweenLCP = 7018, DihMaxTimeBetweenLCP = 7018,
// 7019
// 7020
// 7021
EnableUndoDelayDataWrite = 7080, // DIH+ACC+TUP EnableUndoDelayDataWrite = 7080, // DIH+ACC+TUP
DihSetTimeBetweenGcp = 7090, DihSetTimeBetweenGcp = 7090,
DihStartLcpImmediately = 7099, DihStartLcpImmediately = 7099,
......
...@@ -5983,6 +5983,7 @@ void Dbdih::MASTER_LCPhandling(Signal* signal, Uint32 failedNodeId) ...@@ -5983,6 +5983,7 @@ void Dbdih::MASTER_LCPhandling(Signal* signal, Uint32 failedNodeId)
execDUMP_STATE_ORD(signal); execDUMP_STATE_ORD(signal);
signal->theData[0] = 7015; signal->theData[0] = 7015;
signal->theData[1] = 0;
execDUMP_STATE_ORD(signal); execDUMP_STATE_ORD(signal);
c_lcpMasterTakeOverState.set(LMTOS_IDLE, __LINE__); c_lcpMasterTakeOverState.set(LMTOS_IDLE, __LINE__);
...@@ -13036,7 +13037,8 @@ void ...@@ -13036,7 +13037,8 @@ void
Dbdih::execDUMP_STATE_ORD(Signal* signal) Dbdih::execDUMP_STATE_ORD(Signal* signal)
{ {
DumpStateOrd * const & dumpState = (DumpStateOrd *)&signal->theData[0]; DumpStateOrd * const & dumpState = (DumpStateOrd *)&signal->theData[0];
if (dumpState->args[0] == DumpStateOrd::DihDumpNodeRestartInfo) { Uint32 arg = dumpState->args[0];
if (arg == DumpStateOrd::DihDumpNodeRestartInfo) {
infoEvent("c_nodeStartMaster.blockLcp = %d, c_nodeStartMaster.blockGcp = %d, c_nodeStartMaster.wait = %d", infoEvent("c_nodeStartMaster.blockLcp = %d, c_nodeStartMaster.blockGcp = %d, c_nodeStartMaster.wait = %d",
c_nodeStartMaster.blockLcp, c_nodeStartMaster.blockGcp, c_nodeStartMaster.wait); c_nodeStartMaster.blockLcp, c_nodeStartMaster.blockGcp, c_nodeStartMaster.wait);
infoEvent("cstartGcpNow = %d, cgcpStatus = %d", infoEvent("cstartGcpNow = %d, cgcpStatus = %d",
...@@ -13046,7 +13048,7 @@ Dbdih::execDUMP_STATE_ORD(Signal* signal) ...@@ -13046,7 +13048,7 @@ Dbdih::execDUMP_STATE_ORD(Signal* signal)
infoEvent("cgcpOrderBlocked = %d, cgcpStartCounter = %d", infoEvent("cgcpOrderBlocked = %d, cgcpStartCounter = %d",
cgcpOrderBlocked, cgcpStartCounter); cgcpOrderBlocked, cgcpStartCounter);
}//if }//if
if (dumpState->args[0] == DumpStateOrd::DihDumpNodeStatusInfo) { if (arg == DumpStateOrd::DihDumpNodeStatusInfo) {
NodeRecordPtr localNodePtr; NodeRecordPtr localNodePtr;
infoEvent("Printing nodeStatus of all nodes"); infoEvent("Printing nodeStatus of all nodes");
for (localNodePtr.i = 1; localNodePtr.i < MAX_NDB_NODES; localNodePtr.i++) { for (localNodePtr.i = 1; localNodePtr.i < MAX_NDB_NODES; localNodePtr.i++) {
...@@ -13058,7 +13060,7 @@ Dbdih::execDUMP_STATE_ORD(Signal* signal) ...@@ -13058,7 +13060,7 @@ Dbdih::execDUMP_STATE_ORD(Signal* signal)
}//for }//for
}//if }//if
if (dumpState->args[0] == DumpStateOrd::DihPrintFragmentation){ if (arg == DumpStateOrd::DihPrintFragmentation){
infoEvent("Printing fragmentation of all tables --"); infoEvent("Printing fragmentation of all tables --");
for(Uint32 i = 0; i<ctabFileSize; i++){ for(Uint32 i = 0; i<ctabFileSize; i++){
TabRecordPtr tabPtr; TabRecordPtr tabPtr;
...@@ -13233,7 +13235,7 @@ Dbdih::execDUMP_STATE_ORD(Signal* signal) ...@@ -13233,7 +13235,7 @@ Dbdih::execDUMP_STATE_ORD(Signal* signal)
} }
} }
if(dumpState->args[0] == 7019 && signal->getLength() == 2) if(arg == 7019 && signal->getLength() == 2)
{ {
char buf2[8+1]; char buf2[8+1];
NodeRecordPtr nodePtr; NodeRecordPtr nodePtr;
...@@ -13251,7 +13253,7 @@ Dbdih::execDUMP_STATE_ORD(Signal* signal) ...@@ -13251,7 +13253,7 @@ Dbdih::execDUMP_STATE_ORD(Signal* signal)
nodePtr.p->m_nodefailSteps.getText(buf2)); nodePtr.p->m_nodefailSteps.getText(buf2));
} }
if(dumpState->args[0] == 7020 && signal->getLength() > 3) if(arg == 7020 && signal->getLength() > 3)
{ {
Uint32 gsn= signal->theData[1]; Uint32 gsn= signal->theData[1];
Uint32 block= signal->theData[2]; Uint32 block= signal->theData[2];
...@@ -13275,7 +13277,7 @@ Dbdih::execDUMP_STATE_ORD(Signal* signal) ...@@ -13275,7 +13277,7 @@ Dbdih::execDUMP_STATE_ORD(Signal* signal)
gsn, getBlockName(block, "UNKNOWN"), length, buf); gsn, getBlockName(block, "UNKNOWN"), length, buf);
} }
if(dumpState->args[0] == DumpStateOrd::DihDumpLCPState){ if(arg == DumpStateOrd::DihDumpLCPState){
infoEvent("-- Node %d LCP STATE --", getOwnNodeId()); infoEvent("-- Node %d LCP STATE --", getOwnNodeId());
infoEvent("lcpStatus = %d (update place = %d) ", infoEvent("lcpStatus = %d (update place = %d) ",
c_lcpState.lcpStatus, c_lcpState.lcpStatusUpdatedPlace); c_lcpState.lcpStatus, c_lcpState.lcpStatusUpdatedPlace);
...@@ -13291,7 +13293,7 @@ Dbdih::execDUMP_STATE_ORD(Signal* signal) ...@@ -13291,7 +13293,7 @@ Dbdih::execDUMP_STATE_ORD(Signal* signal)
infoEvent("-- Node %d LCP STATE --", getOwnNodeId()); infoEvent("-- Node %d LCP STATE --", getOwnNodeId());
} }
if(dumpState->args[0] == DumpStateOrd::DihDumpLCPMasterTakeOver){ if(arg == DumpStateOrd::DihDumpLCPMasterTakeOver){
infoEvent("-- Node %d LCP MASTER TAKE OVER STATE --", getOwnNodeId()); infoEvent("-- Node %d LCP MASTER TAKE OVER STATE --", getOwnNodeId());
infoEvent infoEvent
("c_lcpMasterTakeOverState.state = %d updatePlace = %d failedNodeId = %d", ("c_lcpMasterTakeOverState.state = %d updatePlace = %d failedNodeId = %d",
...@@ -13306,52 +13308,25 @@ Dbdih::execDUMP_STATE_ORD(Signal* signal) ...@@ -13306,52 +13308,25 @@ Dbdih::execDUMP_STATE_ORD(Signal* signal)
infoEvent("-- Node %d LCP MASTER TAKE OVER STATE --", getOwnNodeId()); infoEvent("-- Node %d LCP MASTER TAKE OVER STATE --", getOwnNodeId());
} }
if (signal->theData[0] == 7015){ if (signal->theData[0] == 7015)
for(Uint32 i = 0; i<ctabFileSize; i++){ {
TabRecordPtr tabPtr; if (signal->getLength() == 1)
tabPtr.i = i; {
ptrCheckGuard(tabPtr, ctabFileSize, tabRecord); signal->theData[1] = 0;
}
if(tabPtr.p->tabStatus != TabRecord::TS_ACTIVE)
continue;
infoEvent
("Table %d: TabCopyStatus: %d TabUpdateStatus: %d TabLcpStatus: %d",
tabPtr.i,
tabPtr.p->tabCopyStatus,
tabPtr.p->tabUpdateState,
tabPtr.p->tabLcpStatus);
FragmentstorePtr fragPtr; Uint32 tableId = signal->theData[1];
for (Uint32 fid = 0; fid < tabPtr.p->totalfragments; fid++) { if (tableId < ctabFileSize)
jam(); {
getFragstore(tabPtr.p, fid, fragPtr); signal->theData[0] = 7021;
execDUMP_STATE_ORD(signal);
char buf[100], buf2[100]; signal->theData[0] = 7015;
BaseString::snprintf(buf, sizeof(buf), " Fragment %d: noLcpReplicas==%d ", signal->theData[1] = tableId + 1;
fid, fragPtr.p->noLcpReplicas); sendSignal(reference(), GSN_DUMP_STATE_ORD, signal, 2, JBB);
Uint32 num=0;
ReplicaRecordPtr replicaPtr;
replicaPtr.i = fragPtr.p->storedReplicas;
do {
ptrCheckGuard(replicaPtr, creplicaFileSize, replicaRecord);
BaseString::snprintf(buf2, sizeof(buf2), "%s %d(on %d)=%d(%s)",
buf, num,
replicaPtr.p->procNode,
replicaPtr.p->lcpIdStarted,
replicaPtr.p->lcpOngoingFlag ? "Ongoing" : "Idle");
BaseString::snprintf(buf, sizeof(buf), "%s", buf2);
num++;
replicaPtr.i = replicaPtr.p->nextReplica;
} while (replicaPtr.i != RNIL);
infoEvent(buf);
}
} }
} }
if(dumpState->args[0] == DumpStateOrd::EnableUndoDelayDataWrite){ if(arg == DumpStateOrd::EnableUndoDelayDataWrite){
ndbout << "Dbdih:: delay write of datapages for table = " ndbout << "Dbdih:: delay write of datapages for table = "
<< dumpState->args[1]<< endl; << dumpState->args[1]<< endl;
// Send this dump to ACC and TUP // Send this dump to ACC and TUP
...@@ -13381,7 +13356,7 @@ Dbdih::execDUMP_STATE_ORD(Signal* signal) ...@@ -13381,7 +13356,7 @@ Dbdih::execDUMP_STATE_ORD(Signal* signal)
return; return;
} }
if(dumpState->args[0] == 7098){ if(arg == 7098){
if(signal->length() == 3){ if(signal->length() == 3){
jam(); jam();
infoEvent("startLcpRoundLoopLab(tabel=%d, fragment=%d)", infoEvent("startLcpRoundLoopLab(tabel=%d, fragment=%d)",
...@@ -13394,12 +13369,12 @@ Dbdih::execDUMP_STATE_ORD(Signal* signal) ...@@ -13394,12 +13369,12 @@ Dbdih::execDUMP_STATE_ORD(Signal* signal)
} }
} }
if(dumpState->args[0] == DumpStateOrd::DihStartLcpImmediately){ if(arg == DumpStateOrd::DihStartLcpImmediately){
c_lcpState.ctimer += (1 << c_lcpState.clcpDelay); c_lcpState.ctimer += (1 << c_lcpState.clcpDelay);
return; return;
} }
if (dumpState->args[0] == DumpStateOrd::DihSetTimeBetweenGcp) if (arg == DumpStateOrd::DihSetTimeBetweenGcp)
{ {
if (signal->getLength() == 1) if (signal->getLength() == 1)
{ {
...@@ -13414,6 +13389,53 @@ Dbdih::execDUMP_STATE_ORD(Signal* signal) ...@@ -13414,6 +13389,53 @@ Dbdih::execDUMP_STATE_ORD(Signal* signal)
} }
ndbout_c("Setting time between gcp : %d", cgcpDelay); ndbout_c("Setting time between gcp : %d", cgcpDelay);
} }
if (arg == 7021 && signal->getLength() == 2)
{
TabRecordPtr tabPtr;
tabPtr.i = signal->theData[1];
if (tabPtr.i >= ctabFileSize)
return;
ptrCheckGuard(tabPtr, ctabFileSize, tabRecord);
if(tabPtr.p->tabStatus != TabRecord::TS_ACTIVE)
return;
infoEvent
("Table %d: TabCopyStatus: %d TabUpdateStatus: %d TabLcpStatus: %d",
tabPtr.i,
tabPtr.p->tabCopyStatus,
tabPtr.p->tabUpdateState,
tabPtr.p->tabLcpStatus);
FragmentstorePtr fragPtr;
for (Uint32 fid = 0; fid < tabPtr.p->totalfragments; fid++) {
jam();
getFragstore(tabPtr.p, fid, fragPtr);
char buf[100], buf2[100];
BaseString::snprintf(buf, sizeof(buf), " Fragment %d: noLcpReplicas==%d ",
fid, fragPtr.p->noLcpReplicas);
Uint32 num=0;
ReplicaRecordPtr replicaPtr;
replicaPtr.i = fragPtr.p->storedReplicas;
do {
ptrCheckGuard(replicaPtr, creplicaFileSize, replicaRecord);
BaseString::snprintf(buf2, sizeof(buf2), "%s %d(on %d)=%d(%s)",
buf, num,
replicaPtr.p->procNode,
replicaPtr.p->lcpIdStarted,
replicaPtr.p->lcpOngoingFlag ? "Ongoing" : "Idle");
BaseString::snprintf(buf, sizeof(buf), "%s", buf2);
num++;
replicaPtr.i = replicaPtr.p->nextReplica;
} while (replicaPtr.i != RNIL);
infoEvent(buf);
}
}
}//Dbdih::execDUMP_STATE_ORD() }//Dbdih::execDUMP_STATE_ORD()
void void
......
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