Commit b217fd72 authored by unknown's avatar unknown

ndb - bug#32519

  Add *correct* check when a LCP is restorable
  by looking at maxGciStarted from LCP_FRAG_REP
  (for all fragments)

  bug observed by running testSystemRestart -n SR_DD_1_LCP T1
  (causes "incorrect" behaviour in 51-ndb, and crash when using 2 LCP)


storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp:
  ndb - bug#32519
    Add *correct* check when a LCP is restorable
    by looking at maxGciStarted from LCP_FRAG_REP
    (for all fragments)
parent cb4df0a2
...@@ -10678,6 +10678,12 @@ void Dbdih::execLCP_FRAG_REP(Signal* signal) ...@@ -10678,6 +10678,12 @@ void Dbdih::execLCP_FRAG_REP(Signal* signal)
Uint32 started = lcpReport->maxGciStarted; Uint32 started = lcpReport->maxGciStarted;
Uint32 completed = lcpReport->maxGciCompleted; Uint32 completed = lcpReport->maxGciCompleted;
if (started > c_lcpState.lcpStopGcp)
{
jam();
c_lcpState.lcpStopGcp = started;
}
if(tableDone){ if(tableDone){
jam(); jam();
...@@ -11218,7 +11224,12 @@ void Dbdih::allNodesLcpCompletedLab(Signal* signal) ...@@ -11218,7 +11224,12 @@ void Dbdih::allNodesLcpCompletedLab(Signal* signal)
signal->theData[0] = NDB_LE_LocalCheckpointCompleted; //Event type signal->theData[0] = NDB_LE_LocalCheckpointCompleted; //Event type
signal->theData[1] = SYSFILE->latestLCP_ID; signal->theData[1] = SYSFILE->latestLCP_ID;
sendSignal(CMVMI_REF, GSN_EVENT_REP, signal, 2, JBB); sendSignal(CMVMI_REF, GSN_EVENT_REP, signal, 2, JBB);
c_lcpState.lcpStopGcp = c_newest_restorable_gci;
if (c_newest_restorable_gci > c_lcpState.lcpStopGcp)
{
jam();
c_lcpState.lcpStopGcp = c_newest_restorable_gci;
}
/** /**
* Start checking for next LCP * Start checking for next LCP
...@@ -12088,13 +12099,12 @@ void Dbdih::findMinGci(ReplicaRecordPtr fmgReplicaPtr, ...@@ -12088,13 +12099,12 @@ 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] < c_newest_restorable_gci)
{ {
jam(); jam();
keepGci = fmgReplicaPtr.p->maxGciCompleted[lcpNo]; keepGci = fmgReplicaPtr.p->maxGciCompleted[lcpNo];
oldestRestorableGci = fmgReplicaPtr.p->maxGciStarted[lcpNo]; oldestRestorableGci = fmgReplicaPtr.p->maxGciStarted[lcpNo];
ndbrequire(((int)oldestRestorableGci) >= 0); ndbassert(fmgReplicaPtr.p->maxGciStarted[lcpNo] <c_newest_restorable_gci);
return; return;
} else { } else {
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