Commit 20ee9cea authored by unknown's avatar unknown

ndb -

  Snapup testBackup XXXerror


storage/ndb/src/kernel/blocks/backup/Backup.cpp:
  Snapup testBackup XXXerror
storage/ndb/src/kernel/blocks/backup/Backup.hpp:
  Snapup testBackup XXXerror
parent c93a7fa1
......@@ -223,6 +223,7 @@ Backup::execCONTINUEB(Signal* signal)
}
case BackupContinueB::BACKUP_FRAGMENT_INFO:
{
jam();
const Uint32 ptr_I = Tdata1;
Uint32 tabPtr_I = Tdata2;
Uint32 fragPtr_I = signal->theData[3];
......@@ -231,6 +232,10 @@ Backup::execCONTINUEB(Signal* signal)
c_backupPool.getPtr(ptr, ptr_I);
TablePtr tabPtr;
ptr.p->tables.getPtr(tabPtr, tabPtr_I);
if (fragPtr_I != tabPtr.p->fragments.getSize())
{
jam();
FragmentPtr fragPtr;
tabPtr.p->fragments.getPtr(fragPtr, fragPtr_I);
......@@ -259,6 +264,8 @@ Backup::execCONTINUEB(Signal* signal)
filePtr.p->operation.dataBuffer.updateWritePtr(sz);
fragPtr_I++;
}
if (fragPtr_I == tabPtr.p->fragments.getSize())
{
signal->theData[0] = tabPtr.p->tableId;
......@@ -269,10 +276,12 @@ Backup::execCONTINUEB(Signal* signal)
ptr.p->tables.next(tabPtr);
if ((tabPtr_I = tabPtr.i) == RNIL)
{
jam();
closeFiles(signal, ptr);
return;
}
}
signal->theData[0] = BackupContinueB::BACKUP_FRAGMENT_INFO;
signal->theData[1] = ptr_I;
signal->theData[2] = tabPtr_I;
......@@ -2037,14 +2046,21 @@ Backup::sendDropTrig(Signal* signal, BackupRecordPtr ptr)
{
TablePtr tabPtr;
ptr.p->tables.first(tabPtr);
if (ptr.p->tables.first(tabPtr))
{
jam();
signal->theData[0] = BackupContinueB::BACKUP_FRAGMENT_INFO;
signal->theData[1] = ptr.i;
signal->theData[2] = tabPtr.i;
signal->theData[3] = 0;
sendSignal(BACKUP_REF, GSN_CONTINUEB, signal, 4, JBB);
}
else
{
jam();
closeFiles(signal, ptr);
}
}
}
}
}
......@@ -2362,19 +2378,10 @@ Backup::defineBackupRef(Signal* signal, BackupRecordPtr ptr, Uint32 errCode)
{
jam();
ndbrequire(! (filePtr.p->m_flags & BackupFile::BF_FILE_THREAD));
ndbrequire(! (filePtr.p->m_flags & BackupFile::BF_CLOSING));
filePtr.p->m_flags &= ~(Uint32)BackupFile::BF_LCP_META;
if (filePtr.p->m_flags & BackupFile::BF_OPEN)
{
filePtr.p->m_flags |= BackupFile::BF_CLOSING;
FsCloseReq * req = (FsCloseReq *)signal->getDataPtrSend();
req->filePointer = filePtr.p->filePointer;
req->userPointer = filePtr.i;
req->userReference = reference();
req->fileFlag = 0;
FsCloseReq::setRemoveFileFlag(req->fileFlag, 1);
sendSignal(NDBFS_REF, GSN_FSCLOSEREQ, signal,
FsCloseReq::SignalLength, JBA);
closeFile(signal, ptr, filePtr);
return;
}
}
......@@ -4080,29 +4087,10 @@ Backup::checkFile(Signal* signal, BackupFilePtr filePtr)
ndbrequire(flags & BackupFile::BF_OPEN);
ndbrequire(flags & BackupFile::BF_FILE_THREAD);
ndbrequire(! (flags & BackupFile::BF_CLOSING));
filePtr.p->m_flags |= BackupFile::BF_CLOSING;
FsCloseReq * req = (FsCloseReq *)signal->getDataPtrSend();
req->filePointer = filePtr.p->filePointer;
req->userPointer = filePtr.i;
req->userReference = reference();
req->fileFlag = 0;
BackupRecordPtr ptr;
c_backupPool.getPtr(ptr, filePtr.p->backupPtr);
if (ptr.p->errorCode)
{
FsCloseReq::setRemoveFileFlag(req->fileFlag, 1);
}
#ifdef DEBUG_ABORT
ndbout_c("***** a FSCLOSEREQ filePtr.i = %u run=%d cl=%d", filePtr.i,
running, closing);
#endif
sendSignal(NDBFS_REF, GSN_FSCLOSEREQ, signal, FsCloseReq::SignalLength, JBA);
closeFile(signal, ptr, filePtr);
}
......@@ -4367,7 +4355,7 @@ Backup::closeFiles(Signal* sig, BackupRecordPtr ptr)
else
{
jam();
checkFile(sig, filePtr); // make sure we write everything before closing
closeFile(sig, ptr, filePtr);
}
}
......@@ -4377,6 +4365,33 @@ Backup::closeFiles(Signal* sig, BackupRecordPtr ptr)
}//if
}
void
Backup::closeFile(Signal* signal, BackupRecordPtr ptr, BackupFilePtr filePtr)
{
ndbrequire(filePtr.p->m_flags & BackupFile::BF_OPEN);
ndbrequire(! (filePtr.p->m_flags & BackupFile::BF_OPENING));
ndbrequire(! (filePtr.p->m_flags & BackupFile::BF_CLOSING));
filePtr.p->m_flags |= BackupFile::BF_CLOSING;
FsCloseReq * req = (FsCloseReq *)signal->getDataPtrSend();
req->filePointer = filePtr.p->filePointer;
req->userPointer = filePtr.i;
req->userReference = reference();
req->fileFlag = 0;
if (ptr.p->errorCode)
{
FsCloseReq::setRemoveFileFlag(req->fileFlag, 1);
}
#ifdef DEBUG_ABORT
ndbout_c("***** a FSCLOSEREQ filePtr.i = %u flags: %x",
filePtr.i, filePtr.p->m_flags);
#endif
sendSignal(NDBFS_REF, GSN_FSCLOSEREQ, signal, FsCloseReq::SignalLength, JBA);
}
void
Backup::execFSCLOSEREF(Signal* signal)
{
......
......@@ -582,6 +582,7 @@ public:
void openFiles(Signal* signal, BackupRecordPtr ptr);
void openFilesReply(Signal*, BackupRecordPtr ptr, BackupFilePtr);
void closeFiles(Signal*, BackupRecordPtr ptr);
void closeFile(Signal*, BackupRecordPtr, BackupFilePtr);
void closeFilesDone(Signal*, BackupRecordPtr ptr);
void sendDefineBackupReq(Signal *signal, BackupRecordPtr ptr);
......
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