Commit 7056f0b3 authored by unknown's avatar unknown

ndb - bug #10987

  make sure not to cut log to early 
  (specificly not use LCP with maxGciStarted that has not yet completed)


ndb/include/kernel/signaldata/SignalData.hpp:
  Add signal data printer for START_FRAG_REQ
ndb/include/kernel/signaldata/StartFragReq.hpp:
  Add signal data printer for START_FRAG_REQ
ndb/src/common/debugger/signaldata/SignalDataPrint.cpp:
  Add signal data printer for START_FRAG_REQ
ndb/src/common/debugger/signaldata/StartRec.cpp:
  Add signal data printer for START_FRAG_REQ
ndb/src/kernel/blocks/dbdih/DbdihMain.cpp:
  Add maxGciStarted/Completed to event report
  bug: dont use LCP for calcKeepGci in maxGciSTarted is not completed
parent 1b6fdf86
...@@ -215,5 +215,6 @@ GSN_PRINT_SIGNATURE(printSCAN_FRAGREQ); ...@@ -215,5 +215,6 @@ GSN_PRINT_SIGNATURE(printSCAN_FRAGREQ);
GSN_PRINT_SIGNATURE(printCONTINUEB_NDBFS); GSN_PRINT_SIGNATURE(printCONTINUEB_NDBFS);
GSN_PRINT_SIGNATURE(printCONTINUEB_DBDIH); GSN_PRINT_SIGNATURE(printCONTINUEB_DBDIH);
GSN_PRINT_SIGNATURE(printSTART_FRAG_REQ);
#endif #endif
...@@ -32,6 +32,8 @@ class StartFragReq { ...@@ -32,6 +32,8 @@ class StartFragReq {
public: public:
STATIC_CONST( SignalLength = 19 ); STATIC_CONST( SignalLength = 19 );
friend bool printSTART_FRAG_REQ(FILE *, const Uint32 *, Uint32, Uint16);
private: private:
Uint32 userPtr; Uint32 userPtr;
Uint32 userRef; Uint32 userRef;
......
...@@ -195,6 +195,7 @@ SignalDataPrintFunctions[] = { ...@@ -195,6 +195,7 @@ SignalDataPrintFunctions[] = {
,{ GSN_ACC_LOCKREQ, printACC_LOCKREQ } ,{ GSN_ACC_LOCKREQ, printACC_LOCKREQ }
,{ GSN_LQH_TRANSCONF, printLQH_TRANSCONF } ,{ GSN_LQH_TRANSCONF, printLQH_TRANSCONF }
,{ GSN_SCAN_FRAGREQ, printSCAN_FRAGREQ } ,{ GSN_SCAN_FRAGREQ, printSCAN_FRAGREQ }
,{ GSN_START_FRAGREQ, printSTART_FRAG_REQ }
,{ 0, 0 } ,{ 0, 0 }
}; };
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include <RefConvert.hpp> #include <RefConvert.hpp>
#include <signaldata/StartRec.hpp> #include <signaldata/StartRec.hpp>
#include <signaldata/StartFragReq.hpp>
bool bool
printSTART_REC_REQ(FILE * output, printSTART_REC_REQ(FILE * output,
...@@ -50,3 +51,27 @@ printSTART_REC_CONF(FILE * output, ...@@ -50,3 +51,27 @@ printSTART_REC_CONF(FILE * output,
return true; return true;
} }
bool
printSTART_FRAG_REQ(FILE * output,
const Uint32 * theData,
Uint32 len,
Uint16 recBlockNo)
{
StartFragReq* sig = (StartFragReq*)theData;
fprintf(output, " table: %d frag: %d lcpId: %d lcpNo: %d #nodes: %d \n",
sig->tableId, sig->fragId, sig->lcpId, sig->lcpNo,
sig->noOfLogNodes);
for(Uint32 i = 0; i<sig->noOfLogNodes; i++)
{
fprintf(output, " (node: %d startGci: %d lastGci: %d)",
sig->lqhLogNode[i],
sig->startGci[i],
sig->lastGci[i]);
}
fprintf(output, "\n");
return true;
}
...@@ -9641,6 +9641,9 @@ void Dbdih::execLCP_FRAG_REP(Signal* signal) ...@@ -9641,6 +9641,9 @@ void Dbdih::execLCP_FRAG_REP(Signal* signal)
bool tableDone = reportLcpCompletion(lcpReport); bool tableDone = reportLcpCompletion(lcpReport);
Uint32 started = lcpReport->maxGciStarted;
Uint32 completed = lcpReport->maxGciCompleted;
if(tableDone){ if(tableDone){
jam(); jam();
...@@ -9673,7 +9676,9 @@ void Dbdih::execLCP_FRAG_REP(Signal* signal) ...@@ -9673,7 +9676,9 @@ void Dbdih::execLCP_FRAG_REP(Signal* signal)
signal->theData[1] = nodeId; signal->theData[1] = nodeId;
signal->theData[2] = tableId; signal->theData[2] = tableId;
signal->theData[3] = fragId; signal->theData[3] = fragId;
sendSignal(CMVMI_REF, GSN_EVENT_REP, signal, 4, JBB); signal->theData[4] = started;
signal->theData[5] = completed;
sendSignal(CMVMI_REF, GSN_EVENT_REP, signal, 6, JBB);
#endif #endif
bool ok = false; bool ok = false;
...@@ -10790,7 +10795,9 @@ void Dbdih::findMinGci(ReplicaRecordPtr fmgReplicaPtr, ...@@ -10790,7 +10795,9 @@ void Dbdih::findMinGci(ReplicaRecordPtr fmgReplicaPtr,
lcpNo = fmgReplicaPtr.p->nextLcp; lcpNo = fmgReplicaPtr.p->nextLcp;
do { do {
ndbrequire(lcpNo < MAX_LCP_STORED); ndbrequire(lcpNo < MAX_LCP_STORED);
if (fmgReplicaPtr.p->lcpStatus[lcpNo] == ZVALID) { if (fmgReplicaPtr.p->lcpStatus[lcpNo] == ZVALID &&
fmgReplicaPtr.p->maxGciStarted[lcpNo] <= coldgcp)
{
jam(); jam();
keepGci = fmgReplicaPtr.p->maxGciCompleted[lcpNo]; keepGci = fmgReplicaPtr.p->maxGciCompleted[lcpNo];
oldestRestorableGci = fmgReplicaPtr.p->maxGciStarted[lcpNo]; oldestRestorableGci = fmgReplicaPtr.p->maxGciStarted[lcpNo];
...@@ -10798,7 +10805,6 @@ void Dbdih::findMinGci(ReplicaRecordPtr fmgReplicaPtr, ...@@ -10798,7 +10805,6 @@ void Dbdih::findMinGci(ReplicaRecordPtr fmgReplicaPtr,
return; return;
} else { } else {
jam(); jam();
ndbrequire(fmgReplicaPtr.p->lcpStatus[lcpNo] == ZINVALID);
if (fmgReplicaPtr.p->createGci[0] == fmgReplicaPtr.p->initialGci) { if (fmgReplicaPtr.p->createGci[0] == fmgReplicaPtr.p->initialGci) {
jam(); jam();
/*------------------------------------------------------------------- /*-------------------------------------------------------------------
......
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