Commit 253c2808 authored by unknown's avatar unknown

ndb - bug#28726

  make sure to remove LCP files aswell if specifying --initial


storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp:
  Add removal of LCP/X directories
parent c8e0d0db
...@@ -2761,16 +2761,34 @@ void Ndbcntr::execSTART_ORD(Signal* signal){ ...@@ -2761,16 +2761,34 @@ void Ndbcntr::execSTART_ORD(Signal* signal){
c_missra.execSTART_ORD(signal); c_missra.execSTART_ORD(signal);
} }
#define CLEAR_DX 13
#define CLEAR_LCP 3
void void
Ndbcntr::clearFilesystem(Signal* signal){ Ndbcntr::clearFilesystem(Signal* signal)
{
const Uint32 lcp = c_fsRemoveCount >= CLEAR_DX;
FsRemoveReq * req = (FsRemoveReq *)signal->getDataPtrSend(); FsRemoveReq * req = (FsRemoveReq *)signal->getDataPtrSend();
req->userReference = reference(); req->userReference = reference();
req->userPointer = 0; req->userPointer = 0;
req->directory = 1; req->directory = 1;
req->ownDirectory = 1; req->ownDirectory = 1;
FsOpenReq::setVersion(req->fileNumber, 3);
FsOpenReq::setSuffix(req->fileNumber, FsOpenReq::S_CTL); // Can by any... if (lcp == 0)
FsOpenReq::v1_setDisk(req->fileNumber, c_fsRemoveCount); {
FsOpenReq::setVersion(req->fileNumber, 3);
FsOpenReq::setSuffix(req->fileNumber, FsOpenReq::S_CTL); // Can by any...
FsOpenReq::v1_setDisk(req->fileNumber, c_fsRemoveCount);
}
else
{
FsOpenReq::setVersion(req->fileNumber, 5);
FsOpenReq::setSuffix(req->fileNumber, FsOpenReq::S_DATA);
FsOpenReq::v5_setLcpNo(req->fileNumber, c_fsRemoveCount - CLEAR_DX);
FsOpenReq::v5_setTableId(req->fileNumber, 0);
FsOpenReq::v5_setFragmentId(req->fileNumber, 0);
}
sendSignal(NDBFS_REF, GSN_FSREMOVEREQ, signal, sendSignal(NDBFS_REF, GSN_FSREMOVEREQ, signal,
FsRemoveReq::SignalLength, JBA); FsRemoveReq::SignalLength, JBA);
c_fsRemoveCount++; c_fsRemoveCount++;
...@@ -2779,12 +2797,12 @@ Ndbcntr::clearFilesystem(Signal* signal){ ...@@ -2779,12 +2797,12 @@ Ndbcntr::clearFilesystem(Signal* signal){
void void
Ndbcntr::execFSREMOVECONF(Signal* signal){ Ndbcntr::execFSREMOVECONF(Signal* signal){
jamEntry(); jamEntry();
if(c_fsRemoveCount == 13){ if(c_fsRemoveCount == CLEAR_DX + CLEAR_LCP){
jam(); jam();
sendSttorry(signal); sendSttorry(signal);
} else { } else {
jam(); jam();
ndbrequire(c_fsRemoveCount < 13); ndbrequire(c_fsRemoveCount < CLEAR_DX + CLEAR_LCP);
clearFilesystem(signal); clearFilesystem(signal);
}//if }//if
} }
......
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