#include <Backup.hpp>
Inheritance diagram for Backup:

Definition at line 39 of file Backup.hpp.
|
|
Definition at line 182 of file Backup.hpp. |
|
|
Definition at line 337 of file Backup.hpp. |
|
|
Definition at line 495 of file Backup.hpp. |
|
|
Definition at line 191 of file Backup.hpp. |
|
|
Definition at line 161 of file Backup.hpp. |
|
|
Definition at line 168 of file Backup.hpp. |
|
|
Definition at line 213 of file Backup.hpp. |
|
|
Definition at line 311 of file Backup.hpp. |
|
|
State for BackupRecord Definition at line 343 of file Backup.hpp. 00343 { 00344 INITIAL, 00345 DEFINING, // Defining backup content and parameters 00346 DEFINED, // DEFINE_BACKUP_CONF sent in slave, received all in master 00347 STARTED, // Creating triggers 00348 SCANNING, // Scanning fragments 00349 STOPPING, // Closing files 00350 CLEANING, // Cleaning resources 00351 ABORTING // Aborting backup 00352 };
|
|
|
|
Definition at line 203 of file BackupInit.cpp.
|
|
||||||||||||
|
Definition at line 2181 of file Backup.cpp. References AbortBackupOrd::AbortScan, BACKUP, AbortBackupOrd::backupId, AbortBackupOrd::backupPtr, Signal::getDataPtrSend(), Array< T >::getSize(), GSN_ABORT_BACKUP_ORD, Ptr< T >::i, jam, JBB, numberToRef(), Ptr< T >::p, AbortBackupOrd::requestType, RNIL, AbortBackupOrd::senderData, and SimulatedBlock::sendSignal(). Referenced by execABORT_BACKUP_ORD(). 02182 { 02183 AbortBackupOrd *ord = (AbortBackupOrd*)signal->getDataPtrSend(); 02184 ord->backupId = ptr.p->backupId; 02185 ord->backupPtr = ptr.i; 02186 ord->senderData= ptr.i; 02187 ord->requestType = AbortBackupOrd::AbortScan; 02188 02189 TablePtr tabPtr; 02190 ptr.p->tables.first(tabPtr); 02191 for(; tabPtr.i != RNIL; ptr.p->tables.next(tabPtr)) { 02192 jam(); 02193 FragmentPtr fragPtr; 02194 Array<Fragment> & frags = tabPtr.p->fragments; 02195 const Uint32 fragCount = frags.getSize(); 02196 02197 for(Uint32 i = 0; i<fragCount; i++) { 02198 jam(); 02199 tabPtr.p->fragments.getPtr(fragPtr, i); 02200 const Uint32 nodeId = fragPtr.p->node; 02201 if(fragPtr.p->scanning != 0 && ptr.p->nodes.get(nodeId)) { 02202 jam(); 02203 02204 const BlockReference ref = numberToRef(BACKUP, nodeId); 02205 sendSignal(ref, GSN_ABORT_BACKUP_ORD, signal, 02206 AbortBackupOrd::SignalLength, JBB); 02207 02208 } 02209 } 02210 } 02211 }
|
|
||||||||||||||||
|
|
|
||||||||||||||||
|
|
|
||||||||||||
|
Definition at line 1601 of file Backup.cpp. References CRASH_INSERTION, GSN_ALTER_TRIG_REQ, jam, masterAbort(), ndbrequire, Ptr< T >::p, SimulatedBlock::reference(), and sendAlterTrig(). Referenced by execALTER_TRIG_CONF(), and execALTER_TRIG_REF(). 01602 { 01603 01604 CRASH_INSERTION((10005)); 01605 01606 ndbrequire(ptr.p->masterRef == reference()); 01607 ndbrequire(ptr.p->masterData.gsn == GSN_ALTER_TRIG_REQ); 01608 ndbrequire(ptr.p->masterData.sendCounter.done() == false); 01609 01610 ptr.p->masterData.sendCounter--; 01611 01612 if(ptr.p->masterData.sendCounter.done() == false){ 01613 jam(); 01614 return; 01615 }//if 01616 01617 if(ptr.p->checkError()){ 01618 jam(); 01619 masterAbort(signal, ptr); 01620 return; 01621 }//if 01622 01623 sendAlterTrig(signal, ptr); 01624 }
|
|
||||||||||||
|
Get all tables from dict Definition at line 2393 of file Backup.cpp. References DBDICT_REF, Signal::getDataPtrSend(), GSN_LIST_TABLES_REQ, Ptr< T >::i, JBB, SimulatedBlock::reference(), ListTablesReq::requestData, ListTablesReq::senderData, ListTablesReq::senderRef, and SimulatedBlock::sendSignal(). Referenced by execDEFINE_BACKUP_REQ(). 02394 { 02398 ListTablesReq * req = (ListTablesReq*)signal->getDataPtrSend(); 02399 req->senderRef = reference(); 02400 req->senderData = ptr.i; 02401 req->requestData = 0; 02402 sendSignal(DBDICT_REF, GSN_LIST_TABLES_REQ, signal, 02403 ListTablesReq::SignalLength, JBB); 02404 }
|
|
||||||||||||
|
Definition at line 3567 of file Backup.cpp. References BackupFragmentRef::backupId, BackupFragmentRef::backupPtr, c_backupPool, BackupFragmentRef::errorCode, Signal::getDataPtrSend(), SimulatedBlock::getOwnNodeId(), ArrayPool< T >::getPtr(), GSN_BACKUP_FRAGMENT_REF, Ptr< T >::i, JBB, BackupFragmentRef::nodeId, Ptr< T >::p, and SimulatedBlock::sendSignal(). Referenced by execSCAN_FRAGREF(), and fragmentCompleted(). 03568 { 03569 BackupRecordPtr ptr; 03570 c_backupPool.getPtr(ptr, filePtr.p->backupPtr); 03571 03572 ptr.p->m_gsn = GSN_BACKUP_FRAGMENT_REF; 03573 03574 BackupFragmentRef * ref = (BackupFragmentRef*)signal->getDataPtrSend(); 03575 ref->backupId = ptr.p->backupId; 03576 ref->backupPtr = ptr.i; 03577 ref->nodeId = getOwnNodeId(); 03578 ref->errorCode = ptr.p->errorCode; 03579 sendSignal(ptr.p->masterRef, GSN_BACKUP_FRAGMENT_REF, signal, 03580 BackupFragmentRef::SignalLength, JBB); 03581 }
|
|
|
|
|
|
Definition at line 3759 of file Backup.cpp. References mask. Referenced by execDI_FCOUNTCONF(). 03760 { 03761 Uint32 mask = 1; 03762 while (mask < count) mask <<= 1; 03763 mask -= 1; 03764 return mask; 03765 }
|
|
|
|
|
||||||||||||
|
Definition at line 3687 of file Backup.cpp. References BACKUP_REF, BackupContinueB::BUFFER_UNDERFLOW, c_startOfPages, Backup::OperationRecord::dataBuffer, FsCloseReq::fileFlag, FsCloseReq::filePointer, FsAppendReq::filePointer, Signal::getDataPtrSend(), FsBuffer::getReadPtr(), GSN_CONTINUEB, GSN_FSAPPENDREQ, GSN_FSCLOSEREQ, Ptr< T >::i, jam, JBA, NDBFS_REF, ndbout_c(), FsAppendReq::offset, op, Ptr< T >::p, SimulatedBlock::reference(), SimulatedBlock::sendSignal(), SimulatedBlock::sendSignalWithDelay(), FsAppendReq::size, Signal::theData, FsCloseReq::userPointer, FsAppendReq::userPointer, FsCloseReq::userReference, FsAppendReq::userReference, and FsAppendReq::varIndex. Referenced by execCONTINUEB(), execFSAPPENDCONF(), and execFSAPPENDREF(). 03688 { 03689 03690 #ifdef DEBUG_ABORT 03691 // ndbout_c("---- check file filePtr.i = %u", filePtr.i); 03692 #endif 03693 03694 OperationRecord & op = filePtr.p->operation; 03695 03696 Uint32 * tmp, sz; bool eof; 03697 if(op.dataBuffer.getReadPtr(&tmp, &sz, &eof)) 03698 { 03699 jam(); 03700 03701 jam(); 03702 FsAppendReq * req = (FsAppendReq *)signal->getDataPtrSend(); 03703 req->filePointer = filePtr.p->filePointer; 03704 req->userPointer = filePtr.i; 03705 req->userReference = reference(); 03706 req->varIndex = 0; 03707 req->offset = tmp - c_startOfPages; 03708 req->size = sz; 03709 03710 sendSignal(NDBFS_REF, GSN_FSAPPENDREQ, signal, 03711 FsAppendReq::SignalLength, JBA); 03712 return; 03713 } 03714 03715 if(!eof) { 03716 jam(); 03717 signal->theData[0] = BackupContinueB::BUFFER_UNDERFLOW; 03718 signal->theData[1] = filePtr.i; 03719 sendSignalWithDelay(BACKUP_REF, GSN_CONTINUEB, signal, 50, 2); 03720 return; 03721 }//if 03722 03723 if(sz > 0) { 03724 jam(); 03725 FsAppendReq * req = (FsAppendReq *)signal->getDataPtrSend(); 03726 req->filePointer = filePtr.p->filePointer; 03727 req->userPointer = filePtr.i; 03728 req->userReference = reference(); 03729 req->varIndex = 0; 03730 req->offset = tmp - c_startOfPages; 03731 req->size = sz; // Avrunda uppot 03732 03733 sendSignal(NDBFS_REF, GSN_FSAPPENDREQ, signal, 03734 FsAppendReq::SignalLength, JBA); 03735 return; 03736 }//if 03737 03738 filePtr.p->fileRunning = 0; 03739 filePtr.p->fileClosing = 1; 03740 03741 FsCloseReq * req = (FsCloseReq *)signal->getDataPtrSend(); 03742 req->filePointer = filePtr.p->filePointer; 03743 req->userPointer = filePtr.i; 03744 req->userReference = reference(); 03745 req->fileFlag = 0; 03746 #ifdef DEBUG_ABORT 03747 ndbout_c("***** a FSCLOSEREQ filePtr.i = %u", filePtr.i); 03748 #endif 03749 sendSignal(NDBFS_REF, GSN_FSCLOSEREQ, signal, FsCloseReq::SignalLength, JBA); 03750 }
|
|
||||||||||||||||||||
|
Master died...abort I'm master for this backup I abort myself as slave if not master Definition at line 663 of file Backup.cpp. References BitmaskPOD< size >::assign(), AbortBackupOrd::BackupFailureDueToNodeFail, StopBackupRef::backupId, BackupFragmentRef::backupId, StartBackupRef::backupId, DefineBackupRef::backupId, StopBackupRef::backupPtr, BackupFragmentRef::backupPtr, StartBackupRef::backupPtr, DefineBackupRef::backupPtr, c_nodes, CRASH_INSERTION, StopBackupRef::errorCode, BackupFragmentRef::errorCode, StartBackupRef::errorCode, DefineBackupRef::errorCode, BitmaskPOD< size >::find(), SLList< T >::first(), BitmaskPOD< size >::get(), Signal::getDataPtr(), SimulatedBlock::getOwnNodeId(), GSN_ABORT_BACKUP_ORD, GSN_ALTER_TRIG_REQ, GSN_BACKUP_FRAGMENT_CONF, GSN_BACKUP_FRAGMENT_REF, GSN_BACKUP_FRAGMENT_REQ, GSN_CREATE_TRIG_REQ, GSN_DEFINE_BACKUP_CONF, GSN_DEFINE_BACKUP_REF, GSN_DEFINE_BACKUP_REQ, GSN_DROP_TRIG_REQ, GSN_START_BACKUP_CONF, GSN_START_BACKUP_REF, GSN_START_BACKUP_REQ, GSN_STOP_BACKUP_CONF, GSN_STOP_BACKUP_REF, GSN_STOP_BACKUP_REQ, GSN_UTIL_LOCK_REQ, GSN_UTIL_SEQUENCE_REQ, GSN_WAIT_GCP_REQ, Ptr< T >::i, jam, JBB, len, mask, masterAbort(), ndbout_c(), SLList< T >::next(), StopBackupRef::nodeId, BackupFragmentRef::nodeId, StartBackupRef::nodeId, DefineBackupRef::nodeId, Ptr< T >::p, pos(), SimulatedBlock::reference(), refToNode(), RNIL, SimulatedBlock::sendSignal(), StartBackupRef::signalNo, and Signal::theData. Referenced by execNODE_FAILREP(). 00667 { 00668 NdbNodeBitmask mask; 00669 mask.assign(2, theFailedNodes); 00670 00671 /* Update ptr.p->nodes to be up to date with current alive nodes 00672 */ 00673 NodePtr nodePtr; 00674 bool found = false; 00675 for(c_nodes.first(nodePtr); nodePtr.i != RNIL; c_nodes.next(nodePtr)) { 00676 jam(); 00677 if(NodeBitmask::get(theFailedNodes, nodePtr.p->nodeId)) { 00678 jam(); 00679 if (ptr.p->nodes.get(nodePtr.p->nodeId)) { 00680 jam(); 00681 ptr.p->nodes.clear(nodePtr.p->nodeId); 00682 found = true; 00683 } 00684 }//if 00685 }//for 00686 00687 if(!found) { 00688 jam(); 00689 return; // failed node is not part of backup process, safe to continue 00690 } 00691 00692 if(mask.get(refToNode(ptr.p->masterRef))) 00693 { 00697 ptr.p->masterRef = reference(); 00698 ptr.p->nodes.clear(); 00699 ptr.p->nodes.set(getOwnNodeId()); 00700 ptr.p->setErrorCode(AbortBackupOrd::BackupFailureDueToNodeFail); 00701 switch(ptr.p->m_gsn){ 00702 case GSN_DEFINE_BACKUP_REQ: 00703 case GSN_START_BACKUP_REQ: 00704 case GSN_BACKUP_FRAGMENT_REQ: 00705 case GSN_STOP_BACKUP_REQ: 00706 // I'm currently processing...reply to self and abort... 00707 ptr.p->masterData.gsn = ptr.p->m_gsn; 00708 ptr.p->masterData.sendCounter = ptr.p->nodes; 00709 return; 00710 case GSN_DEFINE_BACKUP_REF: 00711 case GSN_DEFINE_BACKUP_CONF: 00712 case GSN_START_BACKUP_REF: 00713 case GSN_START_BACKUP_CONF: 00714 case GSN_BACKUP_FRAGMENT_REF: 00715 case GSN_BACKUP_FRAGMENT_CONF: 00716 case GSN_STOP_BACKUP_REF: 00717 case GSN_STOP_BACKUP_CONF: 00718 ptr.p->masterData.gsn = GSN_DEFINE_BACKUP_REQ; 00719 masterAbort(signal, ptr); 00720 return; 00721 case GSN_ABORT_BACKUP_ORD: 00722 // Already aborting 00723 return; 00724 } 00725 } 00726 else if (newCoord == getOwnNodeId()) 00727 { 00731 jam(); 00732 CRASH_INSERTION((10001)); 00733 #ifdef DEBUG_ABORT 00734 ndbout_c("**** Master: Node failed: Master id = %u", 00735 refToNode(ptr.p->masterRef)); 00736 #endif 00737 00738 Uint32 gsn, len, pos; 00739 ptr.p->nodes.bitANDC(mask); 00740 switch(ptr.p->masterData.gsn){ 00741 case GSN_DEFINE_BACKUP_REQ: 00742 { 00743 DefineBackupRef * ref = (DefineBackupRef*)signal->getDataPtr(); 00744 ref->backupPtr = ptr.i; 00745 ref->backupId = ptr.p->backupId; 00746 ref->errorCode = AbortBackupOrd::BackupFailureDueToNodeFail; 00747 gsn= GSN_DEFINE_BACKUP_REF; 00748 len= DefineBackupRef::SignalLength; 00749 pos= &ref->nodeId - signal->getDataPtr(); 00750 break; 00751 } 00752 case GSN_START_BACKUP_REQ: 00753 { 00754 StartBackupRef * ref = (StartBackupRef*)signal->getDataPtr(); 00755 ref->backupPtr = ptr.i; 00756 ref->backupId = ptr.p->backupId; 00757 ref->errorCode = AbortBackupOrd::BackupFailureDueToNodeFail; 00758 ref->signalNo = ptr.p->masterData.startBackup.signalNo; 00759 gsn= GSN_START_BACKUP_REF; 00760 len= StartBackupRef::SignalLength; 00761 pos= &ref->nodeId - signal->getDataPtr(); 00762 break; 00763 } 00764 case GSN_BACKUP_FRAGMENT_REQ: 00765 { 00766 BackupFragmentRef * ref = (BackupFragmentRef*)signal->getDataPtr(); 00767 ref->backupPtr = ptr.i; 00768 ref->backupId = ptr.p->backupId; 00769 ref->errorCode = AbortBackupOrd::BackupFailureDueToNodeFail; 00770 gsn= GSN_BACKUP_FRAGMENT_REF; 00771 len= BackupFragmentRef::SignalLength; 00772 pos= &ref->nodeId - signal->getDataPtr(); 00773 break; 00774 } 00775 case GSN_STOP_BACKUP_REQ: 00776 { 00777 StopBackupRef * ref = (StopBackupRef*)signal->getDataPtr(); 00778 ref->backupPtr = ptr.i; 00779 ref->backupId = ptr.p->backupId; 00780 ref->errorCode = AbortBackupOrd::BackupFailureDueToNodeFail; 00781 gsn= GSN_STOP_BACKUP_REF; 00782 len= StopBackupRef::SignalLength; 00783 pos= &ref->nodeId - signal->getDataPtr(); 00784 break; 00785 } 00786 case GSN_CREATE_TRIG_REQ: 00787 case GSN_ALTER_TRIG_REQ: 00788 case GSN_WAIT_GCP_REQ: 00789 case GSN_UTIL_SEQUENCE_REQ: 00790 case GSN_UTIL_LOCK_REQ: 00791 case GSN_DROP_TRIG_REQ: 00792 return; 00793 } 00794 00795 for(Uint32 i = 0; (i = mask.find(i+1)) != NdbNodeBitmask::NotFound; ) 00796 { 00797 signal->theData[pos] = i; 00798 sendSignal(reference(), gsn, signal, len, JBB); 00799 #ifdef DEBUG_ABORT 00800 ndbout_c("sending %d to self from %d", gsn, i); 00801 #endif 00802 } 00803 return; 00804 }//if 00805 00809 CRASH_INSERTION((10021)); 00810 }
|
|
||||||||||||
|
||||||||||||
|
Definition at line 4321 of file Backup.cpp. References c_backups, c_triggerPool, ArrayPool< T >::getPtr(), Ptr< T >::i, ILLEGAL_TRIGGER_ID, jam, ndbrequire, Ptr< T >::p, DLList< T >::release(), removeBackup(), and RNIL. Referenced by execABORT_BACKUP_ORD(), and sendBackupRef(). 04322 { 04323 04324 TablePtr tabPtr; 04325 for(ptr.p->tables.first(tabPtr); tabPtr.i != RNIL;ptr.p->tables.next(tabPtr)) 04326 { 04327 jam(); 04328 tabPtr.p->attributes.release(); 04329 tabPtr.p->fragments.release(); 04330 for(Uint32 j = 0; j<3; j++) { 04331 jam(); 04332 TriggerPtr trigPtr; 04333 if(tabPtr.p->triggerAllocated[j]) { 04334 jam(); 04335 c_triggerPool.getPtr(trigPtr, tabPtr.p->triggerIds[j]); 04336 trigPtr.p->event = ILLEGAL_TRIGGER_ID; 04337 tabPtr.p->triggerAllocated[j] = false; 04338 }//if 04339 tabPtr.p->triggerIds[j] = ILLEGAL_TRIGGER_ID; 04340 }//for 04341 }//for 04342 04343 BackupFilePtr filePtr; 04344 for(ptr.p->files.first(filePtr); 04345 filePtr.i != RNIL; 04346 ptr.p->files.next(filePtr)) { 04347 jam(); 04348 ndbrequire(filePtr.p->fileOpened == 0); 04349 ndbrequire(filePtr.p->fileRunning == 0); 04350 ndbrequire(filePtr.p->scanRunning == 0); 04351 filePtr.p->pages.release(); 04352 }//for 04353 04354 ptr.p->files.release(); 04355 ptr.p->tables.release(); 04356 ptr.p->triggers.release(); 04357 04358 ptr.p->tables.release(); 04359 ptr.p->triggers.release(); 04360 ptr.p->pages.release(); 04361 ptr.p->backupId = ~0; 04362 04363 if(ptr.p->checkError()) 04364 removeBackup(signal, ptr); 04365 else 04366 c_backups.release(ptr); 04367 }
|
|
||||||||||||
|
Close all files Definition at line 4003 of file Backup.cpp. References closeFilesDone(), FsCloseReq::fileFlag, FsCloseReq::filePointer, Signal::getDataPtrSend(), GSN_FSCLOSEREQ, Ptr< T >::i, jam, JBA, NDBFS_REF, ndbout_c(), Ptr< T >::p, SimulatedBlock::reference(), RNIL, SimulatedBlock::sendSignal(), FsCloseReq::userPointer, and FsCloseReq::userReference. Referenced by execABORT_BACKUP_ORD(), and execSTOP_BACKUP_REQ(). 04004 { 04008 BackupFilePtr filePtr; 04009 int openCount = 0; 04010 for(ptr.p->files.first(filePtr); filePtr.i!=RNIL; ptr.p->files.next(filePtr)) 04011 { 04012 if(filePtr.p->fileOpened == 0) { 04013 jam(); 04014 continue; 04015 } 04016 04017 jam(); 04018 openCount++; 04019 04020 if(filePtr.p->fileClosing == 1){ 04021 jam(); 04022 continue; 04023 }//if 04024 04025 filePtr.p->fileClosing = 1; 04026 04027 if(filePtr.p->fileRunning == 1){ 04028 jam(); 04029 #ifdef DEBUG_ABORT 04030 ndbout_c("Close files fileRunning == 1, filePtr.i=%u", filePtr.i); 04031 #endif 04032 filePtr.p->operation.dataBuffer.eof(); 04033 } else { 04034 jam(); 04035 04036 FsCloseReq * req = (FsCloseReq *)sig->getDataPtrSend(); 04037 req->filePointer = filePtr.p->filePointer; 04038 req->userPointer = filePtr.i; 04039 req->userReference = reference(); 04040 req->fileFlag = 0; 04041 #ifdef DEBUG_ABORT 04042 ndbout_c("***** b FSCLOSEREQ filePtr.i = %u", filePtr.i); 04043 #endif 04044 sendSignal(NDBFS_REF, GSN_FSCLOSEREQ, sig, 04045 FsCloseReq::SignalLength, JBA); 04046 }//if 04047 }//for 04048 04049 if(openCount == 0){ 04050 jam(); 04051 closeFilesDone(sig, ptr); 04052 }//if 04053 }
|
|
||||||||||||
|
Definition at line 4115 of file Backup.cpp. References StopBackupConf::backupId, StopBackupConf::backupPtr, CLEANING, Signal::getDataPtrSend(), GSN_STOP_BACKUP_CONF, Ptr< T >::i, jam, JBB, StopBackupConf::noOfLogBytes, StopBackupConf::noOfLogRecords, Ptr< T >::p, and SimulatedBlock::sendSignal(). Referenced by closeFiles(), and execFSCLOSECONF(). 04116 { 04117 jam(); 04118 04119 jam(); 04120 BackupFilePtr filePtr; 04121 ptr.p->files.getPtr(filePtr, ptr.p->logFilePtr); 04122 04123 StopBackupConf* conf = (StopBackupConf*)signal->getDataPtrSend(); 04124 conf->backupId = ptr.p->backupId; 04125 conf->backupPtr = ptr.i; 04126 conf->noOfLogBytes = filePtr.p->operation.noOfBytes; 04127 conf->noOfLogRecords = filePtr.p->operation.noOfRecords; 04128 sendSignal(ptr.p->masterRef, GSN_STOP_BACKUP_CONF, signal, 04129 StopBackupConf::SignalLength, JBB); 04130 04131 ptr.p->m_gsn = GSN_STOP_BACKUP_CONF; 04132 ptr.p->slaveState.setState(CLEANING); 04133 }
|
|
||||||||||||
|
Definition at line 1224 of file Backup.cpp. References Backup::Table::attributes, BitmaskPOD< size >::clear(), Array< T >::getPtr(), jam, Backup::Table::noOfAttributes, Ptr< T >::p, and BitmaskPOD< size >::set(). Referenced by sendCreateTrig(). 01226 { 01227 mask.clear(); 01228 Table & table = * tabPtr.p; 01229 for(Uint32 i = 0; i<table.noOfAttributes; i++) { 01230 jam(); 01231 AttributePtr attr; 01232 table.attributes.getPtr(attr, i); 01233 mask.set(i); 01234 } 01235 }
|
|
|
Definition at line 145 of file Backup.cpp. References BACKUP_SEQUENCE, UtilSequenceReq::Create, DBUTIL_REF, Signal::getDataPtrSend(), GSN_UTIL_SEQUENCE_REQ, JBB, UtilSequenceReq::requestType, RNIL, UtilSequenceReq::senderData, SimulatedBlock::sendSignal(), and UtilSequenceReq::sequenceId. Referenced by execSTTOR(). 00146 { 00147 UtilSequenceReq * req = (UtilSequenceReq*)signal->getDataPtrSend(); 00148 00149 req->senderData = RNIL; 00150 req->sequenceId = BACKUP_SEQUENCE; 00151 req->requestType = UtilSequenceReq::Create; 00152 00153 sendSignal(DBUTIL_REF, GSN_UTIL_SEQUENCE_REQ, 00154 signal, UtilSequenceReq::SignalLength, JBB); 00155 }
|
|
||||||||||||
|
|
|
||||||||||||
|
Check finished with table Next table Finished with all tables, send StartBackupReq Definition at line 1338 of file Backup.cpp. References CRASH_INSERTION, ERROR_INSERTED, findTable(), Ptr< T >::i, jam, masterAbort(), ndbrequire, Ptr< T >::p, RNIL, sendCreateTrig(), and sendStartBackup(). Referenced by execCREATE_TRIG_CONF(), and execCREATE_TRIG_REF(). 01339 { 01340 CRASH_INSERTION(10003); 01341 01345 ptr.p->masterData.sendCounter--; 01346 if(ptr.p->masterData.sendCounter.done() == false){ 01347 jam(); 01348 return; 01349 }//if 01350 01351 if (ERROR_INSERTED(10025)) 01352 { 01353 ptr.p->errorCode = 325; 01354 } 01355 01356 if(ptr.p->checkError()) { 01357 jam(); 01358 masterAbort(signal, ptr); 01359 return; 01360 }//if 01361 01362 TablePtr tabPtr; 01363 ndbrequire(findTable(ptr, tabPtr, ptr.p->masterData.createTrig.tableId)); 01364 01368 ptr.p->tables.next(tabPtr); 01369 if(tabPtr.i != RNIL){ 01370 jam(); 01371 sendCreateTrig(signal, ptr, tabPtr); 01372 return; 01373 }//if 01374 01378 ptr.p->tables.first(tabPtr); 01379 ptr.p->masterData.startBackup.signalNo = 0; 01380 ptr.p->masterData.startBackup.noOfSignals = 01381 (ptr.p->tables.noOfElements() + StartBackupReq::MaxTableTriggers - 1) / 01382 StartBackupReq::MaxTableTriggers; 01383 sendStartBackup(signal, ptr, tabPtr); 01384 }
|
|
||||||||||||||||
|
Definition at line 1009 of file Backup.cpp. References c_backupPool, SimulatedBlock::c_mutexMgr, dictCommitTableMutex_locked(), ArrayPool< T >::getPtr(), GSN_UTIL_LOCK_REQ, Ptr< T >::i, jamEntry, Mutex::lock(), ndbrequire, and Ptr< T >::p. Referenced by execUTIL_SEQUENCE_CONF(). 01009 { 01010 jamEntry(); 01011 ndbrequire(retVal == 0); 01012 01013 BackupRecordPtr ptr; 01014 ptr.i = ptrI; 01015 c_backupPool.getPtr(ptr); 01016 01017 ndbrequire(ptr.p->masterData.gsn == GSN_UTIL_LOCK_REQ); 01018 01019 ptr.p->masterData.gsn = GSN_UTIL_LOCK_REQ; 01020 Mutex mutex(signal, c_mutexMgr, ptr.p->masterData.m_dictCommitTableMutex); 01021 Callback c = { safe_cast(&Backup::dictCommitTableMutex_locked), ptr.i }; 01022 ndbrequire(mutex.lock(c)); 01023 }
|
|
||||||||||||||||
|
Definition at line 2219 of file Backup.cpp. References DefineBackupRef::backupId, DefineBackupRef::backupPtr, DefineBackupRef::errorCode, Signal::getDataPtrSend(), SimulatedBlock::getOwnNodeId(), GSN_DEFINE_BACKUP_REF, Ptr< T >::i, JBB, ndbrequire, DefineBackupRef::nodeId, Ptr< T >::p, and SimulatedBlock::sendSignal(). Referenced by execDEFINE_BACKUP_REQ(), execGET_TABINFO_CONF(), execGET_TABINFOREF(), execLIST_TABLES_CONF(), and openFilesReply(). 02220 { 02221 ptr.p->m_gsn = GSN_DEFINE_BACKUP_REF; 02222 ptr.p->setErrorCode(errCode); 02223 ndbrequire(ptr.p->errorCode != 0); 02224 02225 DefineBackupRef* ref = (DefineBackupRef*)signal->getDataPtrSend(); 02226 ref->backupId = ptr.p->backupId; 02227 ref->backupPtr = ptr.i; 02228 ref->errorCode = ptr.p->errorCode; 02229 ref->nodeId = getOwnNodeId(); 02230 sendSignal(ptr.p->masterRef, GSN_DEFINE_BACKUP_REF, signal, 02231 DefineBackupRef::SignalLength, JBB); 02232 }
|
|
||||||||||||||||
|
Unlock mutexes Reply to client Prepare Trig Definition at line 1167 of file Backup.cpp. References BackupConf::backupId, SimulatedBlock::c_mutexMgr, CMVMI_REF, Signal::getDataPtrSend(), GSN_BACKUP_CONF, GSN_DEFINE_BACKUP_REQ, GSN_EVENT_REP, haveAllSignals(), jam, JBB, masterAbort(), NDB_LE_BackupStarted, ndbrequire, BackupConf::nodes, Ptr< T >::p, sendCreateTrig(), BackupConf::senderData, SimulatedBlock::sendSignal(), Signal::theData, and Mutex::unlock(). Referenced by execDEFINE_BACKUP_CONF(), and execDEFINE_BACKUP_REF(). 01168 { 01169 if (!haveAllSignals(ptr, GSN_DEFINE_BACKUP_REQ, nodeId)) { 01170 jam(); 01171 return; 01172 } 01173 01177 jam(); 01178 Mutex mutex1(signal, c_mutexMgr, ptr.p->masterData.m_dictCommitTableMutex); 01179 jam(); 01180 mutex1.unlock(); // ignore response 01181 01182 jam(); 01183 Mutex mutex2(signal, c_mutexMgr, ptr.p->masterData.m_defineBackupMutex); 01184 jam(); 01185 mutex2.unlock(); // ignore response 01186 01187 if(ptr.p->checkError()) 01188 { 01189 jam(); 01190 masterAbort(signal, ptr); 01191 return; 01192 } 01193 01197 BackupConf * conf = (BackupConf*)signal->getDataPtrSend(); 01198 conf->backupId = ptr.p->backupId; 01199 conf->senderData = ptr.p->clientData; 01200 conf->nodes = ptr.p->nodes; 01201 sendSignal(ptr.p->clientRef, GSN_BACKUP_CONF, signal, 01202 BackupConf::SignalLength, JBB); 01203 01204 signal->theData[0] = NDB_LE_BackupStarted; 01205 signal->theData[1] = ptr.p->clientRef; 01206 signal->theData[2] = ptr.p->backupId; 01207 ptr.p->nodes.copyto(NdbNodeBitmask::Size, signal->theData+3); 01208 sendSignal(CMVMI_REF, GSN_EVENT_REP, signal, 3+NdbNodeBitmask::Size, JBB); 01209 01213 TablePtr tabPtr; 01214 ndbrequire(ptr.p->tables.first(tabPtr)); 01215 sendCreateTrig(signal, ptr, tabPtr); 01216 }
|
|
||||||||||||||||
|
We now have both the mutexes Unlock mutexes Definition at line 1026 of file Backup.cpp. References c_backupPool, SimulatedBlock::c_mutexMgr, ERROR_INSERTED, ArrayPool< T >::getPtr(), GSN_UTIL_LOCK_REQ, Ptr< T >::i, jam, jamEntry, ndbrequire, Ptr< T >::p, sendBackupRef(), sendDefineBackupReq(), and Mutex::unlock(). Referenced by defineBackupMutex_locked(). 01027 { 01028 jamEntry(); 01029 ndbrequire(retVal == 0); 01030 01034 BackupRecordPtr ptr; 01035 ptr.i = ptrI; 01036 c_backupPool.getPtr(ptr); 01037 01038 ndbrequire(ptr.p->masterData.gsn == GSN_UTIL_LOCK_REQ); 01039 01040 if (ERROR_INSERTED(10031)) { 01041 ptr.p->setErrorCode(331); 01042 }//if 01043 01044 if (ptr.p->checkError()) 01045 { 01046 jam(); 01047 01051 jam(); 01052 Mutex mutex1(signal, c_mutexMgr, ptr.p->masterData.m_dictCommitTableMutex); 01053 jam(); 01054 mutex1.unlock(); // ignore response 01055 01056 jam(); 01057 Mutex mutex2(signal, c_mutexMgr, ptr.p->masterData.m_defineBackupMutex); 01058 jam(); 01059 mutex2.unlock(); // ignore response 01060 01061 sendBackupRef(signal, ptr, ptr.p->errorCode); 01062 return; 01063 }//if 01064 01065 sendDefineBackupReq(signal, ptr); 01066 }
|
|
||||||||||||
|
Definition at line 1993 of file Backup.cpp. References CRASH_INSERTION, GSN_DROP_TRIG_REQ, jam, ndbrequire, Ptr< T >::p, SimulatedBlock::reference(), and sendDropTrig(). Referenced by execDROP_TRIG_CONF(), and execDROP_TRIG_REF(). 01994 { 01995 01996 CRASH_INSERTION((10012)); 01997 01998 ndbrequire(ptr.p->masterRef == reference()); 01999 ndbrequire(ptr.p->masterData.gsn == GSN_DROP_TRIG_REQ); 02000 ndbrequire(ptr.p->masterData.sendCounter.done() == false); 02001 02002 ptr.p->masterData.sendCounter--; 02003 if(ptr.p->masterData.sendCounter.done() == false){ 02004 jam(); 02005 return; 02006 }//if 02007 02008 sendDropTrig(signal, ptr); // recursive next 02009 }
|
|
|
Definition at line 4275 of file Backup.cpp. References c_backups, c_triggerPool, DLList< T >::first(), ArrayPool< T >::getPtr(), Ptr< T >::i, jam, ndbout_c(), DLList< T >::next(), Ptr< T >::p, and RNIL. Referenced by execABORT_BACKUP_ORD(), execBACKUP_REQ(), and execDEFINE_BACKUP_REQ(). 04276 { 04277 jam(); 04278 BackupRecordPtr ptr; 04279 04280 for(c_backups.first(ptr); ptr.i != RNIL; c_backups.next(ptr)) { 04281 ndbout_c("Backup id=%u, slaveState.getState = %u, errorCode=%u", 04282 ptr.p->backupId, 04283 ptr.p->slaveState.getState(), 04284 ptr.p->errorCode); 04285 04286 TablePtr tabPtr; 04287 for(ptr.p->tables.first(tabPtr); 04288 tabPtr.i != RNIL; 04289 ptr.p->tables.next(tabPtr)) { 04290 jam(); 04291 for(Uint32 j = 0; j<3; j++) { 04292 jam(); 04293 TriggerPtr trigPtr; 04294 if(tabPtr.p->triggerAllocated[j]) { 04295 jam(); 04296 c_triggerPool.getPtr(trigPtr, tabPtr.p->triggerIds[j]); 04297 ndbout_c("Allocated[%u] Triggerid = %u, event = %u", 04298 j, 04299 tabPtr.p->triggerIds[j], 04300 trigPtr.p->event); 04301 }//if 04302 }//for 04303 }//for 04304 04305 BackupFilePtr filePtr; 04306 for(ptr.p->files.first(filePtr); 04307 filePtr.i != RNIL; 04308 ptr.p->files.next(filePtr)) { 04309 jam(); 04310 ndbout_c("filePtr.i = %u, filePtr.p->fileOpened=%u fileRunning=%u " 04311 "scanRunning=%u", 04312 filePtr.i, 04313 filePtr.p->fileOpened, 04314 filePtr.p->fileRunning, 04315 filePtr.p->scanRunning); 04316 }//for 04317 } 04318 }
|
|
|
Requests sent to master Only scans are actively aborted Requests sent to slave Definition at line 4146 of file Backup.cpp. References abort_scan(), AbortBackupOrd::AbortScan, AbortBackupOrd::BackupComplete, AbortBackupOrd::BackupFailure, AbortBackupOrd::BackupFailureDueToNodeFail, AbortBackupOrd::backupId, c_backupPool, c_backups, SimulatedBlock::calcBackupBlockRef(), cleanup(), AbortBackupOrd::ClientAbort, closeFiles(), dumpUsedResources(), AbortBackupOrd::FileOrScanError, ArrayPool< T >::findId(), DLList< T >::first(), Signal::getDataPtr(), getMasterNodeId(), SimulatedBlock::getOwnNodeId(), ArrayPool< T >::getPtr(), Signal::getSendersBlockRef(), GSN_ABORT_BACKUP_ORD, GSN_BACKUP_FRAGMENT_REQ, GSN_STOP_BACKUP_REQ, Ptr< T >::i, AbortBackupOrd::IncompatibleVersions, jam, jamEntry, JBB, AbortBackupOrd::LogBufferFull, ndbout_c(), ndbrequire, DLList< T >::next(), AbortBackupOrd::OkToClean, Ptr< T >::p, SimulatedBlock::reference(), refToNode(), AbortBackupOrd::requestType, RNIL, sendDropTrig(), AbortBackupOrd::senderData, and SimulatedBlock::sendSignal(). Referenced by Backup(), and execBACKUP_FRAGMENT_REF(). 04147 { 04148 jamEntry(); 04149 AbortBackupOrd* ord = (AbortBackupOrd*)signal->getDataPtr(); 04150 04151 const Uint32 backupId = ord->backupId; 04152 const AbortBackupOrd::RequestType requestType = 04153 (AbortBackupOrd::RequestType)ord->requestType; 04154 const Uint32 senderData = ord->senderData; 04155 04156 #ifdef DEBUG_ABORT 04157 ndbout_c("******** ABORT_BACKUP_ORD ********* nodeId = %u", 04158 refToNode(signal->getSendersBlockRef())); 04159 ndbout_c("backupId = %u, requestType = %u, senderData = %u, ", 04160 backupId, requestType, senderData); 04161 dumpUsedResources(); 04162 #endif 04163 04164 BackupRecordPtr ptr; 04165 if(requestType == AbortBackupOrd::ClientAbort) { 04166 if (getOwnNodeId() != getMasterNodeId()) { 04167 jam(); 04168 // forward to master 04169 #ifdef DEBUG_ABORT 04170 ndbout_c("---- Forward to master nodeId = %u", getMasterNodeId()); 04171 #endif 04172 sendSignal(calcBackupBlockRef(getMasterNodeId()), GSN_ABORT_BACKUP_ORD, 04173 signal, AbortBackupOrd::SignalLength, JBB); 04174 return; 04175 } 04176 jam(); 04177 for(c_backups.first(ptr); ptr.i != RNIL; c_backups.next(ptr)) { 04178 jam(); 04179 if(ptr.p->backupId == backupId && ptr.p->clientData == senderData) { 04180 jam(); 04181 break; 04182 }//if 04183 }//for 04184 if(ptr.i == RNIL) { 04185 jam(); 04186 return; 04187 }//if 04188 } else { 04189 if (c_backupPool.findId(senderData)) { 04190 jam(); 04191 c_backupPool.getPtr(ptr, senderData); 04192 } else { 04193 jam(); 04194 #ifdef DEBUG_ABORT 04195 ndbout_c("Backup: abort request type=%u on id=%u,%u not found", 04196 requestType, backupId, senderData); 04197 #endif 04198 return; 04199 } 04200 }//if 04201 04202 ptr.p->m_gsn = GSN_ABORT_BACKUP_ORD; 04203 const bool isCoordinator = (ptr.p->masterRef == reference()); 04204 04205 bool ok = false; 04206 switch(requestType){ 04207 04211 case AbortBackupOrd::ClientAbort: 04212 jam(); 04213 // fall through 04214 case AbortBackupOrd::LogBufferFull: 04215 jam(); 04216 // fall through 04217 case AbortBackupOrd::FileOrScanError: 04218 jam(); 04219 ndbrequire(isCoordinator); 04220 ptr.p->setErrorCode(requestType); 04221 if(ptr.p->masterData.gsn == GSN_BACKUP_FRAGMENT_REQ) 04222 { 04226 abort_scan(signal, ptr); 04227 } 04228 return; 04229 04233 case AbortBackupOrd::AbortScan: 04234 jam(); 04235 ptr.p->setErrorCode(requestType); 04236 return; 04237 04238 case AbortBackupOrd::BackupComplete: 04239 jam(); 04240 cleanup(signal, ptr); 04241 return; 04242 case AbortBackupOrd::BackupFailure: 04243 case AbortBackupOrd::BackupFailureDueToNodeFail: 04244 case AbortBackupOrd::OkToClean: 04245 case AbortBackupOrd::IncompatibleVersions: 04246 #ifndef VM_TRACE 04247 default: 04248 #endif 04249 ptr.p->setErrorCode(requestType); 04250 ok= true; 04251 } 04252 ndbrequire(ok); 04253 04254 Uint32 ref= ptr.p->masterRef; 04255 ptr.p->masterRef = reference(); 04256 ptr.p->nodes.clear(); 04257 ptr.p->nodes.set(getOwnNodeId()); 04258 04259 if(ref == reference()) 04260 { 04261 ptr.p->stopGCP= ptr.p->startGCP + 1; 04262 sendDropTrig(signal, ptr); 04263 } 04264 else 04265 { 04266 ptr.p->masterData.gsn = GSN_STOP_BACKUP_REQ; 04267 ptr.p->masterData.sendCounter.clearWaitingFor(); 04268 ptr.p->masterData.sendCounter.setWaitingFor(getOwnNodeId()); 04269 closeFiles(signal, ptr); 04270 } 04271 }
|
|
|
|
|
|
Definition at line 1571 of file Backup.cpp. References alterTrigReply(), c_backupPool, AlterTrigConf::getConnectionPtr(), Signal::getDataPtr(), ArrayPool< T >::getPtr(), and jamEntry. Referenced by Backup(). 01572 { 01573 jamEntry(); 01574 01575 AlterTrigConf* conf = (AlterTrigConf*)signal->getDataPtr(); 01576 const Uint32 ptrI = conf->getConnectionPtr(); 01577 01578 BackupRecordPtr ptr; 01579 c_backupPool.getPtr(ptr, ptrI); 01580 01581 alterTrigReply(signal, ptr); 01582 }
|
|
|
Definition at line 1585 of file Backup.cpp. References alterTrigReply(), c_backupPool, AlterTrigRef::getConnectionPtr(), Signal::getDataPtr(), AlterTrigRef::getErrorCode(), ArrayPool< T >::getPtr(), jamEntry, and Ptr< T >::p. Referenced by Backup(). 01586 { 01587 jamEntry(); 01588 01589 AlterTrigRef* ref = (AlterTrigRef*)signal->getDataPtr(); 01590 const Uint32 ptrI = ref->getConnectionPtr(); 01591 01592 BackupRecordPtr ptr; 01593 c_backupPool.getPtr(ptr, ptrI); 01594 01595 ptr.p->setErrorCode(ref->getErrorCode()); 01596 01597 alterTrigReply(signal, ptr); 01598 }
|
|
|
Definition at line 469 of file Backup.cpp. References BackupAbortRep::backupId, Signal::getDataPtr(), jamEntry, ndbout_c(), and BackupAbortRep::reason. Referenced by Backup(). 00470 { 00471 jamEntry(); 00472 BackupAbortRep* rep = (BackupAbortRep*)signal->getDataPtr(); 00473 00474 ndbout_c("Backup %d has been aborted %d", rep->backupId, rep->reason); 00475 }
|
|
|
Definition at line 437 of file Backup.cpp. References BackupCompleteRep::backupId, Signal::getDataPtr(), jamEntry, ndbout(), ndbout_c(), NdbTick_CurrentMillisecond(), BackupCompleteRep::noOfBytes, BackupCompleteRep::noOfLogBytes, BackupCompleteRep::noOfLogRecords, BackupCompleteRep::noOfRecords, yaSSL::Number, startTime, and xps(). Referenced by Backup(). 00438 { 00439 jamEntry(); 00440 BackupCompleteRep* rep = (BackupCompleteRep*)signal->getDataPtr(); 00441 00442 startTime = NdbTick_CurrentMillisecond() - startTime; 00443 00444 ndbout_c("Backup %d has completed", rep->backupId); 00445 const Uint32 bytes = rep->noOfBytes; 00446 const Uint32 records = rep->noOfRecords; 00447 00448 Number rps = xps(records, startTime); 00449 Number bps = xps(bytes, startTime); 00450 00451 ndbout << " Data [ " 00452 << Number(records) << " rows " 00453 << Number(bytes) << " bytes " << startTime << " ms ] " 00454 << " => " 00455 << rps << " row/s & " << bps << "b/s" << endl; 00456 00457 bps = xps(rep->noOfLogBytes, startTime); 00458 rps = xps(rep->noOfLogRecords, startTime); 00459 00460 ndbout << " Log [ " 00461 << Number(rep->noOfLogRecords) << " log records " 00462 << Number(rep->noOfLogBytes) << " bytes " << startTime << " ms ] " 00463 << " => " 00464 << rps << " records/s & " << bps << "b/s" << endl; 00465 00466 }
|
|
|
Definition at line 419 of file Backup.cpp. References BackupConf::backupId, Signal::getDataPtr(), jamEntry, and ndbout_c(). Referenced by Backup(). 00420 { 00421 jamEntry(); 00422 BackupConf * conf = (BackupConf*)signal->getDataPtr(); 00423 00424 ndbout_c("Backup %d has started", conf->backupId); 00425 }
|
|
|
|
|
|
Definition at line 1779 of file Backup.cpp. References BackupFragmentConf::backupPtr, c_backupPool, CRASH_INSERTION, ERROR_INSERTED, findTable(), BackupFragmentConf::fragmentNo, Signal::getDataPtr(), ArrayPool< T >::getPtr(), jam, jamEntry, masterAbort(), ndbrequire, nextFragment(), BackupFragmentConf::noOfBytes, BackupFragmentConf::noOfRecords, Ptr< T >::p, refToNode(), Signal::senderBlockRef(), and BackupFragmentConf::tableId. Referenced by Backup(). 01780 { 01781 jamEntry(); 01782 01783 CRASH_INSERTION((10010)); 01784 01785 BackupFragmentConf * conf = (BackupFragmentConf*)signal->getDataPtr(); 01786 const Uint32 ptrI = conf->backupPtr; 01787 //const Uint32 backupId = conf->backupId; 01788 const Uint32 tableId = conf->tableId; 01789 const Uint32 fragmentNo = conf->fragmentNo; 01790 const Uint32 nodeId = refToNode(signal->senderBlockRef()); 01791 const Uint32 noOfBytes = conf->noOfBytes; 01792 const Uint32 noOfRecords = conf->noOfRecords; 01793 01794 BackupRecordPtr ptr; 01795 c_backupPool.getPtr(ptr, ptrI); 01796 01797 ptr.p->noOfBytes += noOfBytes; 01798 ptr.p->noOfRecords += noOfRecords; 01799 ptr.p->masterData.sendCounter--; 01800 01801 TablePtr tabPtr; 01802 ndbrequire(findTable(ptr, tabPtr, tableId)); 01803 01804 FragmentPtr fragPtr; 01805 tabPtr.p->fragments.getPtr(fragPtr, fragmentNo); 01806 01807 ndbrequire(fragPtr.p->scanned == 0); 01808 ndbrequire(fragPtr.p->scanning == 1); 01809 ndbrequire(fragPtr.p->node == nodeId); 01810 01811 fragPtr.p->scanned = 1; 01812 fragPtr.p->scanning = 0; 01813 01814 if (ERROR_INSERTED(10028)) 01815 { 01816 ptr.p->errorCode = 328; 01817 } 01818 01819 if(ptr.p->checkError()) 01820 { 01821 if(ptr.p->masterData.sendCounter.done()) 01822 { 01823 jam(); 01824 masterAbort(signal, ptr); 01825 return; 01826 }//if 01827 } 01828 else 01829 { 01830 nextFragment(signal, ptr); 01831 } 01832 }
|
|
|
Definition at line 1835 of file Backup.cpp. References AbortBackupOrd::backupId, AbortBackupOrd::backupPtr, BackupFragmentRef::backupPtr, c_backupPool, CRASH_INSERTION, BackupFragmentRef::errorCode, execABORT_BACKUP_ORD(), Signal::getDataPtr(), Signal::getDataPtrSend(), ArrayPool< T >::getPtr(), Array< T >::getSize(), Ptr< T >::i, jam, jamEntry, AbortBackupOrd::LogBufferFull, masterAbort(), ndbrequire, BackupFragmentRef::nodeId, Ptr< T >::p, AbortBackupOrd::requestType, RNIL, and AbortBackupOrd::senderData. Referenced by Backup(). 01836 { 01837 jamEntry(); 01838 01839 CRASH_INSERTION((10011)); 01840 01841 BackupFragmentRef * ref = (BackupFragmentRef*)signal->getDataPtr(); 01842 const Uint32 ptrI = ref->backupPtr; 01843 //const Uint32 backupId = ref->backupId; 01844 const Uint32 nodeId = ref->nodeId; 01845 01846 BackupRecordPtr ptr; 01847 c_backupPool.getPtr(ptr, ptrI); 01848 01849 TablePtr tabPtr; 01850 ptr.p->tables.first(tabPtr); 01851 for(; tabPtr.i != RNIL; ptr.p->tables.next(tabPtr)) { 01852 jam(); 01853 FragmentPtr fragPtr; 01854 Array<Fragment> & frags = tabPtr.p->fragments; 01855 const Uint32 fragCount = frags.getSize(); 01856 01857 for(Uint32 i = 0; i<fragCount; i++) { 01858 jam(); 01859 tabPtr.p->fragments.getPtr(fragPtr, i); 01860 if(fragPtr.p->scanning != 0 && nodeId == fragPtr.p->node) 01861 { 01862 jam(); 01863 ndbrequire(fragPtr.p->scanned == 0); 01864 fragPtr.p->scanned = 1; 01865 fragPtr.p->scanning = 0; 01866 goto done; 01867 } 01868 } 01869 } 01870 ndbrequire(false); 01871 01872 done: 01873 ptr.p->masterData.sendCounter--; 01874 ptr.p->setErrorCode(ref->errorCode); 01875 01876 if(ptr.p->masterData.sendCounter.done()) 01877 { 01878 jam(); 01879 masterAbort(signal, ptr); 01880 return; 01881 }//if 01882 01883 AbortBackupOrd *ord = (AbortBackupOrd*)signal->getDataPtrSend(); 01884 ord->backupId = ptr.p->backupId; 01885 ord->backupPtr = ptr.i; 01886 ord->requestType = AbortBackupOrd::LogBufferFull; 01887 ord->senderData= ptr.i; 01888 execABORT_BACKUP_ORD(signal); 01889 }
|
|
|
Get backup record Get file Get table Get fragment Init operation Check for space in buffer Mark things as "in use" Start scan Definition at line 3133 of file Backup.cpp. References Backup::Table::attributes, BACKUP, BACKUP_REF, BackupFragmentReq::backupPtr, ScanFragReq::batch_size_bytes, ScanFragReq::batch_size_rows, c_backupFilePool, c_backupPool, ScanFragReq::clientOpPtr, BackupFragmentReq::count, count, CRASH_INSERTION, DBLQH_REF, findTable(), BackupFragmentReq::fragmentNo, ScanFragReq::fragmentNoKeyLen, Signal::getDataPtr(), Signal::getDataPtrSend(), SimulatedBlock::getOwnNodeId(), Array< T >::getPtr(), ArrayPool< T >::getPtr(), GSN_ATTRINFO, GSN_BACKUP_FRAGMENT_REQ, GSN_SCAN_FRAGREQ, Ptr< T >::i, AttributeHeader::init(), jam, jamEntry, JBB, Signal::length(), ndbrequire, Backup::Table::noOfAttributes, Ptr< T >::p, parallelism, SimulatedBlock::reference(), refToNode(), ScanFragReq::requestInfo, ScanFragReq::resultRef, ScanFragReq::savePointId, SCANNING, Backup::Table::schemaVersion, ScanFragReq::schemaVersion, ScanFragReq::senderData, SimulatedBlock::sendSignal(), SimulatedBlock::sendSignalWithDelay(), ScanFragReq::setAttrLen(), ScanFragReq::setHoldLockFlag(), ScanFragReq::setKeyinfoFlag(), ScanFragReq::setLockMode(), STARTED, Backup::Table::tableId, ScanFragReq::tableId, BackupFragmentReq::tableId, Signal::theData, ScanFragReq::transId1, and ScanFragReq::transId2. Referenced by Backup(). 03134 { 03135 jamEntry(); 03136 BackupFragmentReq* req = (BackupFragmentReq*)signal->getDataPtr(); 03137 03138 CRASH_INSERTION((10016)); 03139 03140 const Uint32 ptrI = req->backupPtr; 03141 //const Uint32 backupId = req->backupId; 03142 const Uint32 tableId = req->tableId; 03143 const Uint32 fragNo = req->fragmentNo; 03144 const Uint32 count = req->count; 03145 03149 BackupRecordPtr ptr; 03150 c_backupPool.getPtr(ptr, ptrI); 03151 03152 ptr.p->slaveState.setState(SCANNING); 03153 ptr.p->m_gsn = GSN_BACKUP_FRAGMENT_REQ; 03154 03158 BackupFilePtr filePtr; 03159 c_backupFilePool.getPtr(filePtr, ptr.p->dataFilePtr); 03160 03161 ndbrequire(filePtr.p->backupPtr == ptrI); 03162 ndbrequire(filePtr.p->fileOpened == 1); 03163 ndbrequire(filePtr.p->fileRunning == 1); 03164 ndbrequire(filePtr.p->scanRunning == 0); 03165 ndbrequire(filePtr.p->fileClosing == 0); 03166 03170 TablePtr tabPtr; 03171 ndbrequire(findTable(ptr, tabPtr, tableId)); 03172 03176 FragmentPtr fragPtr; 03177 tabPtr.p->fragments.getPtr(fragPtr, fragNo); 03178 03179 ndbrequire(fragPtr.p->scanned == 0); 03180 ndbrequire(fragPtr.p->scanning == 0 || 03181 refToNode(ptr.p->masterRef) == getOwnNodeId()); 03182 03186 if(filePtr.p->tableId != tableId) { 03187 jam(); 03188 filePtr.p->operation.init(tabPtr); 03189 filePtr.p->tableId = tableId; 03190 }//if 03191 03195 if(!filePtr.p->operation.newFragment(tableId, fragNo)) { 03196 jam(); 03197 req->count = count + 1; 03198 sendSignalWithDelay(BACKUP_REF, GSN_BACKUP_FRAGMENT_REQ, signal, 50, 03199 signal->length()); 03200 ptr.p->slaveState.setState(STARTED); 03201 return; 03202 }//if 03203 03207 fragPtr.p->scanning = 1; 03208 filePtr.p->fragmentNo = fragNo; 03209 03213 { 03214 filePtr.p->scanRunning = 1; 03215 03216 Table & table = * tabPtr.p; 03217 ScanFragReq * req = (ScanFragReq *)signal->getDataPtrSend(); 03218 const Uint32 parallelism = 16; 03219 const Uint32 attrLen = 5 + table.noOfAttributes; 03220 03221 req->senderData = filePtr.i; 03222 req->resultRef = reference(); 03223 req->schemaVersion = table.schemaVersion; 03224 req->fragmentNoKeyLen = fragNo; 03225 req->requestInfo = 0; 03226 req->savePointId = 0; 03227 req->tableId = table.tableId; 03228 ScanFragReq::setLockMode(req->requestInfo, 0); 03229 ScanFragReq::setHoldLockFlag(req->requestInfo, 0); 03230 ScanFragReq::setKeyinfoFlag(req->requestInfo, 0); 03231 ScanFragReq::setAttrLen(req->requestInfo,attrLen); 03232 req->transId1 = 0; 03233 req->transId2 = (BACKUP << 20) + (getOwnNodeId() << 8); 03234 req->clientOpPtr= filePtr.i; 03235 req->batch_size_rows= parallelism; 03236 req->batch_size_bytes= 0; 03237 sendSignal(DBLQH_REF, GSN_SCAN_FRAGREQ, signal, 03238 ScanFragReq::SignalLength, JBB); 03239 03240 signal->theData[0] = filePtr.i; 03241 signal->theData[1] = 0; 03242 signal->theData[2] = (BACKUP << 20) + (getOwnNodeId() << 8); 03243 03244 // Return all 03245 signal->theData[3] = table.noOfAttributes; 03246 signal->theData[4] = 0; 03247 signal->theData[5] = 0; 03248 signal->theData[6] = 0; 03249 signal->theData[7] = 0; 03250 03251 Uint32 dataPos = 8; 03252 Uint32 i; 03253 for(i = 0; i<table.noOfAttributes; i++) { 03254 jam(); 03255 AttributePtr attr; 03256 table.attributes.getPtr(attr, i); 03257 03258 AttributeHeader::init(&signal->theData[dataPos], i, 0); 03259 dataPos++; 03260 if(dataPos == 25) { 03261 jam(); 03262 sendSignal(DBLQH_REF, GSN_ATTRINFO, signal, 25, JBB); 03263 dataPos = 3; 03264 }//if 03265 }//for 03266 if(dataPos != 3) { 03267 jam(); 03268 sendSignal(DBLQH_REF, GSN_ATTRINFO, signal, dataPos, JBB); 03269 }//if 03270 } 03271 }
|
|
|
Testing Definition at line 428 of file Backup.cpp. References BackupRef::errorCode, Signal::getDataPtr(), jamEntry, ndbout_c(), and BackupRef::senderData. Referenced by Backup(). 00429 { 00430 jamEntry(); 00431 BackupRef * ref = (BackupRef*)signal->getDataPtr(); 00432 00433 ndbout_c("Backup (%d) has NOT started %d", ref->senderData, ref->errorCode); 00434 }
|
|
|
Master functinallity Definition at line 847 of file Backup.cpp. References BACKUP_SEQUENCE, BackupReq::backupDataLen, BackupRef::BackupDefinitionNotImplemented, c_aliveNodes, c_backups, BackupRef::CannotBackupDiskless, DBUTIL_REF, dumpUsedResources(), Signal::getDataPtr(), Signal::getDataPtrSend(), getMasterNodeId(), SimulatedBlock::getOwnNodeId(), GSN_UTIL_SEQUENCE_REQ, Ptr< T >::i, BackupRef::IAmNotMaster, jam, jamEntry, JBB, m_diskless, ndbrequire, UtilSequenceReq::NextVal, BackupRef::OutOfBackupRecord, Ptr< T >::p, SimulatedBlock::reference(), UtilSequenceReq::requestType, RNIL, DLList< T >::seize(), sendBackupRef(), Signal::senderBlockRef(), UtilSequenceReq::senderData, BackupReq::senderData, SimulatedBlock::sendSignal(), and UtilSequenceReq::sequenceId. Referenced by Backup(). 00848 { 00849 jamEntry(); 00850 BackupReq * req = (BackupReq*)signal->getDataPtr(); 00851 00852 const Uint32 senderData = req->senderData; 00853 const BlockReference senderRef = signal->senderBlockRef(); 00854 const Uint32 dataLen32 = req->backupDataLen; // In 32 bit words 00855 00856 if(getOwnNodeId() != getMasterNodeId()) { 00857 jam(); 00858 sendBackupRef(senderRef, signal, senderData, BackupRef::IAmNotMaster); 00859 return; 00860 }//if 00861 00862 if (m_diskless) 00863 { 00864 sendBackupRef(senderRef, signal, senderData, 00865 BackupRef::CannotBackupDiskless); 00866 return; 00867 } 00868 00869 if(dataLen32 != 0) { 00870 jam(); 00871 sendBackupRef(senderRef, signal, senderData, 00872 BackupRef::BackupDefinitionNotImplemented); 00873 return; 00874 }//if 00875 00876 #ifdef DEBUG_ABORT 00877 dumpUsedResources(); 00878 #endif 00879 00882 BackupRecordPtr ptr; 00883 c_backups.seize(ptr); 00884 if(ptr.i == RNIL) { 00885 jam(); 00886 sendBackupRef(senderRef, signal, senderData, BackupRef::OutOfBackupRecord); 00887 return; 00888 }//if 00889 00890 ndbrequire(ptr.p->pages.empty()); 00891 ndbrequire(ptr.p->tables.isEmpty()); 00892 00893 ptr.p->m_gsn = 0; 00894 ptr.p->errorCode = 0; 00895 ptr.p->clientRef = senderRef; 00896 ptr.p->clientData = senderData; 00897 ptr.p->masterRef = reference(); 00898 ptr.p->nodes = c_aliveNodes; 00899 ptr.p->backupId = 0; 00900 ptr.p->backupKey[0] = 0; 00901 ptr.p->backupKey[1] = 0; 00902 ptr.p->backupDataLen = 0; 00903 ptr.p->masterData.errorCode = 0; 00904 ptr.p->masterData.dropTrig.tableId = RNIL; 00905 ptr.p->masterData.alterTrig.tableId = RNIL; 00906 00907 UtilSequenceReq * utilReq = (UtilSequenceReq*)signal->getDataPtrSend(); 00908 00909 ptr.p->masterData.gsn = GSN_UTIL_SEQUENCE_REQ; 00910 utilReq->senderData = ptr.i; 00911 utilReq->sequenceId = BACKUP_SEQUENCE; 00912 utilReq->requestType = UtilSequenceReq::NextVal; 00913 sendSignal(DBUTIL_REF, GSN_UTIL_SEQUENCE_REQ, 00914 signal, UtilSequenceReq::SignalLength, JBB); 00915 }
|
|
|
|
|
|
|
|
|
Trigger logging Definition at line 3768 of file Backup.cpp. References c_tablePool, c_triggerPool, SimulatedBlock::getOwnNodeId(), ArrayPool< T >::getPtr(), jam, jamEntry, Ptr< T >::p, Signal::theData, ZFALSE, and ZTRUE. Referenced by Backup(). 03769 { 03770 /* 03771 TUP asks if this trigger is to be fired on this node. 03772 */ 03773 TriggerPtr trigPtr; 03774 TablePtr tabPtr; 03775 FragmentPtr fragPtr; 03776 Uint32 trigger_id = signal->theData[0]; 03777 Uint32 frag_id = signal->theData[1]; 03778 Uint32 result; 03779 03780 jamEntry(); 03781 c_triggerPool.getPtr(trigPtr, trigger_id); 03782 c_tablePool.getPtr(tabPtr, trigPtr.p->tab_ptr_i); 03783 frag_id = frag_id & tabPtr.p->frag_mask; 03784 /* 03785 At the moment the fragment identity known by TUP is the 03786 actual fragment id but with possibly an extra bit set. 03787 This is due to that ACC splits the fragment. Thus fragment id 5 can 03788 here be either 5 or 13. Thus masking with 2 ** n - 1 where number of 03789 fragments <= 2 ** n will always provide a correct fragment id. 03790 */ 03791 tabPtr.p->fragments.getPtr(fragPtr, frag_id); 03792 if (fragPtr.p->node != getOwnNodeId()) { 03793 jam(); 03794 result = ZFALSE; 03795 } else { 03796 jam(); 03797 result = ZTRUE; 03798 }//if 03799 signal->theData[0] = result; 03800 }
|
|
|
|
Verify that I'm waiting for this conf Definition at line 1282 of file Backup.cpp. References c_backupPool, createTrigReply(), findTable(), CreateTrigConf::getConnectionPtr(), Signal::getDataPtr(), ArrayPool< T >::getPtr(), CreateTrigConf::getTableId(), CreateTrigConf::getTriggerEvent(), CreateTrigConf::getTriggerId(), GSN_CREATE_TRIG_REQ, ILLEGAL_TRIGGER_ID, jamEntry, ndbrequire, Ptr< T >::p, and SimulatedBlock::reference(). Referenced by Backup(). 01283 { 01284 jamEntry(); 01285 CreateTrigConf * conf = (CreateTrigConf*)signal->getDataPtr(); 01286 01287 const Uint32 ptrI = conf->getConnectionPtr(); 01288 const Uint32 tableId = conf->getTableId(); 01289 const TriggerEvent::Value type = conf->getTriggerEvent(); 01290 const Uint32 triggerId = conf->getTriggerId(); 01291 01292 BackupRecordPtr ptr; 01293 c_backupPool.getPtr(ptr, ptrI); 01294 01298 ndbrequire(ptr.p->masterRef == reference()); 01299 ndbrequire(ptr.p->masterData.gsn == GSN_CREATE_TRIG_REQ); 01300 ndbrequire(ptr.p->masterData.sendCounter.done() == false); 01301 ndbrequire(ptr.p->masterData.createTrig.tableId == tableId); 01302 01303 TablePtr tabPtr; 01304 ndbrequire(findTable(ptr, tabPtr, tableId)); 01305 ndbrequire(type < 3); // if some decides to change the enums 01306 01307 ndbrequire(tabPtr.p->triggerIds[type] == ILLEGAL_TRIGGER_ID); 01308 tabPtr.p->triggerIds[type] = triggerId; 01309 01310 createTrigReply(signal, ptr); 01311 }
|
|
|
Verify that I'm waiting for this ref Definition at line 1314 of file Backup.cpp. References c_backupPool, createTrigReply(), CreateTrigRef::getConnectionPtr(), Signal::getDataPtr(), CreateTrigRef::getErrorCode(), ArrayPool< T >::getPtr(), CreateTrigRef::getTableId(), GSN_CREATE_TRIG_REQ, ndbrequire, Ptr< T >::p, and SimulatedBlock::reference(). Referenced by Backup(). 01315 { 01316 CreateTrigRef* ref = (CreateTrigRef*)signal->getDataPtr(); 01317 01318 const Uint32 ptrI = ref->getConnectionPtr(); 01319 const Uint32 tableId = ref->getTableId(); 01320 01321 BackupRecordPtr ptr; 01322 c_backupPool.getPtr(ptr, ptrI); 01323 01327 ndbrequire(ptr.p->masterRef == reference()); 01328 ndbrequire(ptr.p->masterData.gsn == GSN_CREATE_TRIG_REQ); 01329 ndbrequire(ptr.p->masterData.sendCounter.done() == false); 01330 ndbrequire(ptr.p->masterData.createTrig.tableId == tableId); 01331 01332 ptr.p->setErrorCode(ref->getErrorCode()); 01333 01334 createTrigReply(signal, ptr); 01335 }
|
|
|
Definition at line 1146 of file Backup.cpp. References DefineBackupConf::backupPtr, c_backupPool, defineBackupReply(), ERROR_INSERTED, Signal::getDataPtr(), ArrayPool< T >::getPtr(), jamEntry, Ptr< T >::p, refToNode(), and Signal::senderBlockRef(). Referenced by Backup(). 01147 { 01148 jamEntry(); 01149 01150 DefineBackupConf* conf = (DefineBackupConf*)signal->getDataPtr(); 01151 const Uint32 ptrI = conf->backupPtr; 01152 //const Uint32 backupId = conf->backupId; 01153 const Uint32 nodeId = refToNode(signal->senderBlockRef()); 01154 01155 BackupRecordPtr ptr; 01156 c_backupPool.getPtr(ptr, ptrI); 01157 01158 if (ERROR_INSERTED(10024)) 01159 { 01160 ptr.p->setErrorCode(324); 01161 } 01162 01163 defineBackupReply(signal, ptr, nodeId); 01164 }
|
|
|
Definition at line 1128 of file Backup.cpp. References DefineBackupRef::backupPtr, c_backupPool, defineBackupReply(), DefineBackupRef::errorCode, Signal::getDataPtr(), ArrayPool< T >::getPtr(), jamEntry, DefineBackupRef::nodeId, and Ptr< T >::p. Referenced by Backup(). 01129 { 01130 jamEntry(); 01131 01132 DefineBackupRef* ref = (DefineBackupRef*)signal->getDataPtr(); 01133 01134 const Uint32 ptrI = ref->backupPtr; 01135 //const Uint32 backupId = ref->backupId; 01136 const Uint32 nodeId = ref->nodeId; 01137 01138 BackupRecordPtr ptr; 01139 c_backupPool.getPtr(ptr, ptrI); 01140 01141 ptr.p->setErrorCode(ref->errorCode); 01142 defineBackupReply(signal, ptr, nodeId); 01143 }
|
|
|
Signals sent from master Definition at line 2235 of file Backup.cpp. References backupAllData(), DefineBackupReq::backupDataLen, DefineBackupReq::backupId, DefineBackupReq::backupKey, DefineBackupReq::backupPtr, c_backupPool, c_backups, c_defaults, DefineBackupReq::clientData, DefineBackupReq::clientRef, CRASH_INSERTION, BackupFormat::CTL_FILE, BackupFormat::DATA_FILE, DEBUG_OUT, defineBackupRef(), DEFINING, dumpUsedResources(), ERROR_INSERTED, DefineBackupRef::FailedToAllocateBuffers, DefineBackupRef::FailedToAllocateFileRecord, DefineBackupRef::FailedToSetupFsBuffers, files, Signal::getDataPtr(), ArrayPool< T >::getPtr(), GSN_DEFINE_BACKUP_REQ, Ptr< T >::i, INITIAL, jam, jamEntry, BackupFormat::LOG_FILE, Backup::Config::m_dataBufferSize, Backup::Config::m_logBufferSize, Backup::Config::m_maxWriteSize, Backup::Config::m_minWriteSize, ndbrequire, DefineBackupReq::nodes, Ptr< T >::p, SimulatedBlock::reference(), RNIL, DLList< T >::seizeId(), DefineBackupReq::senderRef, DefineBackupRef::Undefined, and verifyNodesAlive(). Referenced by Backup(). 02236 { 02237 jamEntry(); 02238 02239 DefineBackupReq* req = (DefineBackupReq*)signal->getDataPtr(); 02240 02241 BackupRecordPtr ptr; 02242 const Uint32 ptrI = req->backupPtr; 02243 const Uint32 backupId = req->backupId; 02244 const BlockReference senderRef = req->senderRef; 02245 02246 if(senderRef == reference()){ 02250 jam(); 02251 c_backupPool.getPtr(ptr, ptrI); 02252 } else { // from other node 02253 jam(); 02254 #ifdef DEBUG_ABORT 02255 dumpUsedResources(); 02256 #endif 02257 if(!c_backups.seizeId(ptr, ptrI)) { 02258 jam(); 02259 ndbrequire(false); // If master has succeeded slave should succed 02260 }//if 02261 }//if 02262 02263 CRASH_INSERTION((10014)); 02264 02265 ptr.p->m_gsn = GSN_DEFINE_BACKUP_REQ; 02266 ptr.p->slaveState.forceState(INITIAL); 02267 ptr.p->slaveState.setState(DEFINING); 02268 ptr.p->errorCode = 0; 02269 ptr.p->clientRef = req->clientRef; 02270 ptr.p->clientData = req->clientData; 02271 ptr.p->masterRef = senderRef; 02272 ptr.p->nodes = req->nodes; 02273 ptr.p->backupId = backupId; 02274 ptr.p->backupKey[0] = req->backupKey[0]; 02275 ptr.p->backupKey[1] = req->backupKey[1]; 02276 ptr.p->backupDataLen = req->backupDataLen; 02277 ptr.p->masterData.dropTrig.tableId = RNIL; 02278 ptr.p->masterData.alterTrig.tableId = RNIL; 02279 ptr.p->masterData.errorCode = 0; 02280 ptr.p->noOfBytes = 0; 02281 ptr.p->noOfRecords = 0; 02282 ptr.p->noOfLogBytes = 0; 02283 ptr.p->noOfLogRecords = 0; 02284 ptr.p->currGCP = 0; 02285 02289 BackupFilePtr files[3]; 02290 Uint32 noOfPages[] = { 02291 NO_OF_PAGES_META_FILE, 02292 2, // 32k 02293 0 // 3M 02294 }; 02295 const Uint32 maxInsert[] = { 02296 2048, // Temporarily to solve TR515 02297 //25, // 100 bytes 02298 2048, // 4k 02299 16*3000, // Max 16 tuples 02300 }; 02301 Uint32 minWrite[] = { 02302 8192, 02303 8192, 02304 32768 02305 }; 02306 Uint32 maxWrite[] = { 02307 8192, 02308 8192, 02309 32768 02310 }; 02311 02312 minWrite[1] = c_defaults.m_minWriteSize; 02313 maxWrite[1] = c_defaults.m_maxWriteSize; 02314 noOfPages[1] = (c_defaults.m_logBufferSize + sizeof(Page32) - 1) / 02315 sizeof(Page32); 02316 minWrite[2] = c_defaults.m_minWriteSize; 02317 maxWrite[2] = c_defaults.m_maxWriteSize; 02318 noOfPages[2] = (c_defaults.m_dataBufferSize + sizeof(Page32) - 1) / 02319 sizeof(Page32); 02320 02321 for(Uint32 i = 0; i<3; i++) { 02322 jam(); 02323 if(!ptr.p->files.seize(files[i])) { 02324 jam(); 02325 defineBackupRef(signal, ptr, 02326 DefineBackupRef::FailedToAllocateFileRecord); 02327 return; 02328 }//if 02329 02330 files[i].p->tableId = RNIL; 02331 files[i].p->backupPtr = ptr.i; 02332 files[i].p->filePointer = RNIL; 02333 files[i].p->fileClosing = 0; 02334 files[i].p->fileOpened = 0; 02335 files[i].p->fileRunning = 0; 02336 files[i].p->scanRunning = 0; 02337 files[i].p->errorCode = 0; 02338 02339 if(files[i].p->pages.seize(noOfPages[i]) == false) { 02340 jam(); 02341 DEBUG_OUT("Failed to seize " << noOfPages[i] << " pages"); 02342 defineBackupRef(signal, ptr, DefineBackupRef::FailedToAllocateBuffers); 02343 return; 02344 }//if 02345 Page32Ptr pagePtr; 02346 files[i].p->pages.getPtr(pagePtr, 0); 02347 02348 const char * msg = files[i].p-> 02349 operation.dataBuffer.setup((Uint32*)pagePtr.p, 02350 noOfPages[i] * (sizeof(Page32) >> 2), 02351 128, 02352 minWrite[i] >> 2, 02353 maxWrite[i] >> 2, 02354 maxInsert[i]); 02355 if(msg != 0) { 02356 jam(); 02357 defineBackupRef(signal, ptr, DefineBackupRef::FailedToSetupFsBuffers); 02358 return; 02359 }//if 02360 }//for 02361 files[0].p->fileType = BackupFormat::CTL_FILE; 02362 files[1].p->fileType = BackupFormat::LOG_FILE; 02363 files[2].p->fileType = BackupFormat::DATA_FILE; 02364 02365 ptr.p->ctlFilePtr = files[0].i; 02366 ptr.p->logFilePtr = files[1].i; 02367 ptr.p->dataFilePtr = files[2].i; 02368 02369 if (!verifyNodesAlive(ptr, ptr.p->nodes)) { 02370 jam(); 02371 defineBackupRef(signal, ptr, DefineBackupRef::Undefined); 02372 return; 02373 }//if 02374 if (ERROR_INSERTED(10027)) { 02375 jam(); 02376 defineBackupRef(signal, ptr, 327); 02377 return; 02378 }//if 02379 02380 if(ptr.p->backupDataLen == 0) { 02381 jam(); 02382 backupAllData(signal, ptr); 02383 return; 02384 }//if 02385 02389 ndbrequire(0); 02390 }
|
|
|
DIH signals Definition at line 2923 of file Backup.cpp. References c_backupPool, calculate_frag_mask(), DBDIH_REF, findTable(), getFragmentInfo(), ArrayPool< T >::getPtr(), GSN_DI_FCOUNTREQ, Ptr< T >::i, jam, jamEntry, JBB, Signal::length(), ndbrequire, Ptr< T >::p, RNIL, SimulatedBlock::sendSignal(), and Signal::theData. Referenced by Backup(). 02924 { 02925 jamEntry(); 02926 02927 const Uint32 userPtr = signal->theData[0]; 02928 const Uint32 fragCount = signal->theData[1]; 02929 const Uint32 tableId = signal->theData[2]; 02930 const Uint32 senderData = signal->theData[3]; 02931 02932 ndbrequire(userPtr == RNIL && signal->length() == 5); 02933 02934 BackupRecordPtr ptr; 02935 c_backupPool.getPtr(ptr, senderData); 02936 02937 TablePtr tabPtr; 02938 ndbrequire(findTable(ptr, tabPtr, tableId)); 02939 02940 ndbrequire(tabPtr.p->fragments.seize(fragCount) != false); 02941 tabPtr.p->frag_mask = calculate_frag_mask(fragCount); 02942 for(Uint32 i = 0; i<fragCount; i++) { 02943 jam(); 02944 FragmentPtr fragPtr; 02945 tabPtr.p->fragments.getPtr(fragPtr, i); 02946 fragPtr.p->scanned = 0; 02947 fragPtr.p->scanning = 0; 02948 fragPtr.p->tableId = tableId; 02949 fragPtr.p->node = RNIL; 02950 }//for 02951 02955 if(ptr.p->tables.next(tabPtr)) { 02956 jam(); 02957 signal->theData[0] = RNIL; 02958 signal->theData[1] = tabPtr.p->tableId; 02959 signal->theData[2] = ptr.i; 02960 sendSignal(DBDIH_REF, GSN_DI_FCOUNTREQ, signal, 3, JBB); 02961 return; 02962 }//if 02963 02964 ptr.p->tables.first(tabPtr); 02965 getFragmentInfo(signal, ptr, tabPtr, 0); 02966 }
|
|
|
Definition at line 2999 of file Backup.cpp. References c_backupPool, findTable(), getFragmentInfo(), ArrayPool< T >::getPtr(), jamEntry, Signal::length(), MAX_REPLICAS, ndbrequire, Ptr< T >::p, RNIL, and Signal::theData. Referenced by Backup(). 03000 { 03001 jamEntry(); 03002 03003 const Uint32 userPtr = signal->theData[0]; 03004 const Uint32 senderData = signal->theData[1]; 03005 const Uint32 nodeCount = signal->theData[6]; 03006 const Uint32 tableId = signal->theData[7]; 03007 const Uint32 fragNo = signal->theData[8]; 03008 03009 ndbrequire(userPtr == RNIL && signal->length() == 9); 03010 ndbrequire(nodeCount > 0 && nodeCount <= MAX_REPLICAS); 03011 03012 BackupRecordPtr ptr; 03013 c_backupPool.getPtr(ptr, senderData); 03014 03015 TablePtr tabPtr; 03016 ndbrequire(findTable(ptr, tabPtr, tableId)); 03017 03018 FragmentPtr fragPtr; 03019 tabPtr.p->fragments.getPtr(fragPtr, fragNo); 03020 03021 fragPtr.p->node = signal->theData[2]; 03022 03023 getFragmentInfo(signal, ptr, tabPtr, fragNo + 1); 03024 }
|
|
|
Definition at line 1979 of file Backup.cpp. References c_backupPool, dropTrigReply(), DropTrigConf::getConnectionPtr(), Signal::getDataPtr(), ArrayPool< T >::getPtr(), and jamEntry. Referenced by Backup(). 01980 { 01981 jamEntry(); 01982 01983 DropTrigConf* conf = (DropTrigConf*)signal->getDataPtr(); 01984 const Uint32 ptrI = conf->getConnectionPtr(); 01985 01986 BackupRecordPtr ptr; 01987 c_backupPool.getPtr(ptr, ptrI); 01988 01989 dropTrigReply(signal, ptr); 01990 }
|
|
|
Definition at line 1964 of file Backup.cpp. References c_backupPool, dropTrigReply(), DropTrigRef::getConnectionPtr(), Signal::getDataPtr(), ArrayPool< T >::getPtr(), and jamEntry. Referenced by Backup(). 01965 { 01966 jamEntry(); 01967 01968 DropTrigRef* ref = (DropTrigRef*)signal->getDataPtr(); 01969 const Uint32 ptrI = ref->getConnectionPtr(); 01970 01971 BackupRecordPtr ptr; 01972 c_backupPool.getPtr(ptr, ptrI); 01973 01974 //ndbrequire(ref->getErrorCode() == DropTrigRef::NoSuchTrigger); 01975 dropTrigReply(signal, ptr); 01976 }
|
|
|
|
Definition at line 3870 of file Backup.cpp. References c_backupPool, c_triggerPool, Signal::getDataPtr(), FireTrigOrd::getGCI(), ArrayPool< T >::getPtr(), FireTrigOrd::getTriggerId(), ILLEGAL_TRIGGER_ID, jam, jamEntry, len, ndbrequire, and Ptr< T >::p. Referenced by Backup(). 03871 { 03872 jamEntry(); 03873 FireTrigOrd* trg = (FireTrigOrd*)signal->getDataPtr(); 03874 03875 const Uint32 gci = trg->getGCI(); 03876 const Uint32 trI = trg->getTriggerId(); 03877 03878 TriggerPtr trigPtr; 03879 c_triggerPool.getPtr(trigPtr, trI); 03880 03881 ndbrequire(trigPtr.p->event != ILLEGAL_TRIGGER_ID); 03882 03883 if(trigPtr.p->errorCode != 0) { 03884 jam(); 03885 return; 03886 }//if 03887 03888 ndbrequire(trigPtr.p->logEntry != 0); 03889 Uint32 len = trigPtr.p->logEntry->Length; 03890 03891 BackupRecordPtr ptr; 03892 c_backupPool.getPtr(ptr, trigPtr.p->backupPtr); 03893 if(gci != ptr.p->currGCP) 03894 { 03895 jam(); 03896 03897 trigPtr.p->logEntry->TriggerEvent = htonl(trigPtr.p->event | 0x10000); 03898 trigPtr.p->logEntry->Data[len] = htonl(gci); 03899 len ++; 03900 ptr.p->currGCP = gci; 03901 }//if 03902 03903 len += (sizeof(BackupFormat::LogFile::LogEntry) >> 2) - 2; 03904 trigPtr.p->logEntry->Length = htonl(len); 03905 03906 ndbrequire(len + 1 <= trigPtr.p->operation->dataBuffer.getMaxWrite()); 03907 trigPtr.p->operation->dataBuffer.updateWritePtr(len + 1); 03908 trigPtr.p->logEntry = 0; 03909 03910 trigPtr.p->operation->noOfBytes += (len + 1) << 2; 03911 trigPtr.p->operation->noOfRecords += 1; 03912 }
|
|
|
Definition at line 3666 of file Backup.cpp. References c_backupFilePool, checkFile(), CRASH_INSERTION, Backup::OperationRecord::dataBuffer, ArrayPool< T >::getPtr(), jamEntry, op, Ptr< T >::p, Signal::theData, and FsBuffer::updateReadPtr(). Referenced by Backup(). 03667 { 03668 jamEntry(); 03669 03670 CRASH_INSERTION((10018)); 03671 03672 //FsConf * conf = (FsConf*)signal->getDataPtr(); 03673 const Uint32 filePtrI = signal->theData[0]; //conf->userPointer; 03674 const Uint32 bytes = signal->theData[1]; //conf->bytes; 03675 03676 BackupFilePtr filePtr; 03677 c_backupFilePool.getPtr(filePtr, filePtrI); 03678 03679 OperationRecord & op = filePtr.p->operation; 03680 03681 op.dataBuffer.updateReadPtr(bytes >> 2); 03682 03683 checkFile(signal, filePtr); 03684 }
|
|
|
Definition at line 3647 of file Backup.cpp. References c_backupFilePool, checkFile(), FsRef::errorCode, Signal::getDataPtr(), ArrayPool< T >::getPtr(), jamEntry, Ptr< T >::p, and FsRef::userPointer. Referenced by Backup(). 03648 { 03649 jamEntry(); 03650 03651 FsRef * ref = (FsRef *)signal->getDataPtr(); 03652 03653 const Uint32 filePtrI = ref->userPointer; 03654 const Uint32 errCode = ref->errorCode; 03655 03656 BackupFilePtr filePtr; 03657 c_backupFilePool.getPtr(filePtr, filePtrI); 03658 03659 filePtr.p->fileRunning = 0; 03660 filePtr.p->errorCode = errCode; 03661 03662 checkFile(signal, filePtr); 03663 }
|
|
|
Definition at line 4077 of file Backup.cpp. References c_backupFilePool, c_backupPool, closeFilesDone(), Signal::getDataPtr(), ArrayPool< T >::getPtr(), Ptr< T >::i, jam, jamEntry, ndbout_c(), ndbrequire, Ptr< T >::p, RNIL, and FsConf::userPointer. Referenced by Backup(), and execFSCLOSEREF(). 04078 { 04079 jamEntry(); 04080 04081 FsConf * conf = (FsConf*)signal->getDataPtr(); 04082 const Uint32 filePtrI = conf->userPointer; 04083 04084 BackupFilePtr filePtr; 04085 c_backupFilePool.getPtr(filePtr, filePtrI); 04086 04087 #ifdef DEBUG_ABORT 04088 ndbout_c("***** FSCLOSECONF filePtrI = %u", filePtrI); 04089 #endif 04090 04091 ndbrequire(filePtr.p->fileClosing == 1); 04092 ndbrequire(filePtr.p->fileOpened == 1); 04093 ndbrequire(filePtr.p->fileRunning == 0); 04094 ndbrequire(filePtr.p->scanRunning == 0); 04095 04096 filePtr.p->fileOpened = 0; 04097 04098 BackupRecordPtr ptr; 04099 c_backupPool.getPtr(ptr, filePtr.p->backupPtr); 04100 for(ptr.p->files.first(filePtr); filePtr.i!=RNIL;ptr.p->files.next(filePtr)) 04101 { 04102 jam(); 04103 if(filePtr.p->fileOpened == 1) { 04104 jam(); 04105 #ifdef DEBUG_ABORT 04106 ndbout_c("waiting for more FSCLOSECONF's filePtr.i = %u", filePtr.i); 04107 #endif 04108 return; // we will be getting more FSCLOSECONF's 04109 }//if 04110 }//for 04111 closeFilesDone(signal, ptr); 04112 }
|
|
|
Definition at line 4056 of file Backup.cpp. References c_backupFilePool, c_backupPool, execFSCLOSECONF(), Signal::getDataPtr(), ArrayPool< T >::getPtr(), jamEntry, Ptr< T >::p, FsConf::userPointer, and FsRef::userPointer. Referenced by Backup(). 04057 { 04058 jamEntry(); 04059 04060 FsRef * ref = (FsRef*)signal->getDataPtr(); 04061 const Uint32 filePtrI = ref->userPointer; 04062 04063 BackupFilePtr filePtr; 04064 c_backupFilePool.getPtr(filePtr, filePtrI); 04065 04066 BackupRecordPtr ptr; 04067 c_backupPool.getPtr(ptr, filePtr.p->backupPtr); 04068 04069 filePtr.p->fileOpened = 1; 04070 FsConf * conf = (FsConf*)signal->getDataPtr(); 04071 conf->userPointer = filePtrI; 04072 04073 execFSCLOSECONF(signal); 04074 }
|
|
|
Definition at line 2530 of file Backup.cpp. References c_backupFilePool, c_backupPool, FsConf::filePointer, Signal::getDataPtr(), ArrayPool< T >::getPtr(), jamEntry, ndbrequire, openFilesReply(), Ptr< T >::p, and FsConf::userPointer. Referenced by Backup(). 02531 { 02532 jamEntry(); 02533 02534 FsConf * conf = (FsConf *)signal->getDataPtr(); 02535 02536 const Uint32 userPtr = conf->userPointer; 02537 const Uint32 filePointer = conf->filePointer; 02538 02539 BackupFilePtr filePtr; 02540 c_backupFilePool.getPtr(filePtr, userPtr); 02541 filePtr.p->filePointer = filePointer; 02542 02543 BackupRecordPtr ptr; 02544 c_backupPool.getPtr(ptr, filePtr.p->backupPtr); 02545 02546 ndbrequire(filePtr.p->fileOpened == 0); 02547 filePtr.p->fileOpened = 1; 02548 openFilesReply(signal, ptr, filePtr); 02549 }
|
|
|
FS signals Definition at line 2512 of file Backup.cpp. References c_backupFilePool, c_backupPool, FsRef::errorCode, Signal::getDataPtr(), ArrayPool< T >::getPtr(), jamEntry, openFilesReply(), Ptr< T >::p, and FsRef::userPointer. Referenced by Backup(). 02513 { 02514 jamEntry(); 02515 02516 FsRef * ref = (FsRef *)signal->getDataPtr(); 02517 02518 const Uint32 userPtr = ref->userPointer; 02519 02520 BackupFilePtr filePtr; 02521 c_backupFilePool.getPtr(filePtr, userPtr); 02522 02523 BackupRecordPtr ptr; 02524 c_backupPool.getPtr(ptr, filePtr.p->backupPtr); 02525 ptr.p->setErrorCode(ref->errorCode); 02526 openFilesReply(signal, ptr, filePtr); 02527 }
|
|
|
Get backup record Definition at line 4401 of file Backup.cpp. References c_backupPool, c_backups, Signal::getDataPtr(), ArrayPool< T >::getPtr(), jamEntry, DLList< T >::release(), and FsConf::userPointer. Referenced by Backup(), and execFSREMOVEREF(). 04401 { 04402 jamEntry(); 04403 04404 FsConf * conf = (FsConf*)signal->getDataPtr(); 04405 const Uint32 ptrI = conf->userPointer; 04406 04410 BackupRecordPtr ptr; 04411 c_backupPool.getPtr(ptr, ptrI); 04412 c_backups.release(ptr); 04413 }
|
|
|
Definition at line 4389 of file Backup.cpp. References execFSREMOVECONF(), Signal::getDataPtr(), jamEntry, FsConf::userPointer, and FsRef::userPointer. Referenced by Backup(). 04390 { 04391 jamEntry(); 04392 FsRef * ref = (FsRef*)signal->getDataPtr(); 04393 const Uint32 ptrI = ref->userPointer; 04394 04395 FsConf * conf = (FsConf*)signal->getDataPtr(); 04396 conf->userPointer = ptrI; 04397 execFSREMOVECONF(signal); 04398 }
|
|
|
No of pages needed Definition at line 2708 of file Backup.cpp. References SimulatedBlock::assembleFragments(), BACKUP_REF, buf, BackupContinueB::BUFFER_FULL_META, c_backupPool, mySTL::copy(), DBDIH_REF, defineBackupRef(), DefineBackupRef::FailedAllocateTableMem, Signal::getDataPtr(), ArrayPool< T >::getPtr(), Signal::getSection(), FsBuffer::getWritePtr(), GSN_CONTINUEB, GSN_DI_FCOUNTREQ, Ptr< T >::i, DictTabInfo::isIndex(), jam, jamEntry, JBB, len, ndbrequire, Ptr< T >::p, parseTableDescription(), SimulatedBlock::releaseSections(), RNIL, BackupFormat::CtlFile::TableDescription::SectionLength, BackupFormat::CtlFile::TableDescription::SectionType, GetTabInfoConf::senderData, SimulatedBlock::sendSignal(), SimulatedBlock::sendSignalWithDelay(), SegmentedSectionPtr::sz, BackupFormat::TABLE_DESCRIPTION, Signal::theData, GetTabInfoConf::totalLen, and FsBuffer::updateWritePtr(). Referenced by Backup(). 02709 { 02710 jamEntry(); 02711 02712 if(!assembleFragments(signal)) { 02713 jam(); 02714 return; 02715 }//if 02716 02717 GetTabInfoConf * const conf = (GetTabInfoConf*)signal->getDataPtr(); 02718 //const Uint32 senderRef = info->senderRef; 02719 const Uint32 len = conf->totalLen; 02720 const Uint32 senderData = conf->senderData; 02721 02722 BackupRecordPtr ptr; 02723 c_backupPool.getPtr(ptr, senderData); 02724 02725 SegmentedSectionPtr dictTabInfoPtr; 02726 signal->getSection(dictTabInfoPtr, GetTabInfoConf::DICT_TAB_INFO); 02727 ndbrequire(dictTabInfoPtr.sz == len); 02728 02732 const Uint32 noPages = (len + sizeof(Page32) - 1) / sizeof(Page32); 02733 if(ptr.p->pages.getSize() < noPages) { 02734 jam(); 02735 ptr.p->pages.release(); 02736 if(ptr.p->pages.seize(noPages) == false) { 02737 jam(); 02738 ptr.p->setErrorCode(DefineBackupRef::FailedAllocateTableMem); 02739 ndbrequire(false); 02740 releaseSections(signal); 02741 defineBackupRef(signal, ptr); 02742 return; 02743 }//if 02744 }//if 02745 02746 BackupFilePtr filePtr; 02747 ptr.p->files.getPtr(filePtr, ptr.p->ctlFilePtr); 02748 FsBuffer & buf = filePtr.p->operation.dataBuffer; 02749 { // Write into ctl file 02750 Uint32* dst, dstLen = len + 2; 02751 if(!buf.getWritePtr(&dst, dstLen)) { 02752 jam(); 02753 ndbrequire(false); 02754 ptr.p->setErrorCode(DefineBackupRef::FailedAllocateTableMem); 02755 releaseSections(signal); 02756 defineBackupRef(signal, ptr); 02757 return; 02758 }//if 02759 if(dst != 0) { 02760 jam(); 02761 02762 BackupFormat::CtlFile::TableDescription * desc = 02763 (BackupFormat::CtlFile::TableDescription*)dst; 02764 desc->SectionType = htonl(BackupFormat::TABLE_DESCRIPTION); 02765 desc->SectionLength = htonl(len + 2); 02766 dst += 2; 02767 02768 copy(dst, dictTabInfoPtr); 02769 buf.updateWritePtr(dstLen); 02770 }//if 02771 } 02772 02773 ndbrequire(ptr.p->pages.getSize() >= noPages); 02774 Page32Ptr pagePtr; 02775 ptr.p->pages.getPtr(pagePtr, 0); 02776 copy(&pagePtr.p->data[0], dictTabInfoPtr); 02777 releaseSections(signal); 02778 02779 if(ptr.p->checkError()) { 02780 jam(); 02781 defineBackupRef(signal, ptr); 02782 return; 02783 }//if 02784 02785 TablePtr tabPtr = parseTableDescription(signal, ptr, len); 02786 if(tabPtr.i == RNIL) { 02787 jam(); 02788 defineBackupRef(signal, ptr); 02789 return; 02790 }//if 02791 02792 TablePtr tmp = tabPtr; 02793 ptr.p->tables.next(tabPtr); 02794 if(DictTabInfo::isIndex(tmp.p->tableType)){ 02795 ptr.p->tables.release(tmp); 02796 } 02797 02798 if(tabPtr.i == RNIL) { 02799 jam(); 02800 02801 ptr.p->pages.release(); 02802 02803 ndbrequire(ptr.p->tables.first(tabPtr)); 02804 signal->theData[0] = RNIL; 02805 signal->theData[1] = tabPtr.p->tableId; 02806 signal->theData[2] = ptr.i; 02807 sendSignal(DBDIH_REF, GSN_DI_FCOUNTREQ, signal, 3, JBB); 02808 return; 02809 }//if 02810 02811 signal->theData[0] = BackupContinueB::BUFFER_FULL_META; 02812 signal->theData[1] = ptr.i; 02813 signal->theData[2] = tabPtr.i; 02814 sendSignalWithDelay(BACKUP_REF, GSN_CONTINUEB, signal, 100, 3); 02815 return; 02816 }
|
|
|
Definition at line 2696 of file Backup.cpp. References c_backupPool, defineBackupRef(), GetTabInfoRef::errorCode, Signal::getDataPtr(), ArrayPool< T >::getPtr(), and GetTabInfoRef::senderData. Referenced by Backup(). 02697 { 02698 GetTabInfoRef * ref = (GetTabInfoRef*)signal->getDataPtr(); 02699 02700 const Uint32 senderData = ref->senderData; 02701 BackupRecordPtr ptr; 02702 c_backupPool.getPtr(ptr, senderData); 02703 02704 defineBackupRef(signal, ptr, ref->errorCode); 02705 }
|
|
|
Definition at line 813 of file Backup.cpp. References c_aliveNodes, c_nodes, SLList< T >::first(), BitmaskPOD< size >::get(), GSN_INCL_NODECONF, Ptr< T >::i, jam, jamEntry, JBB, ndbrequire, SLList< T >::next(), Ptr< T >::p, SimulatedBlock::reference(), RNIL, SimulatedBlock::sendSignal(), BitmaskPOD< size >::set(), and Signal::theData. Referenced by Backup(). 00814 { 00815 jamEntry(); 00816 00817 const Uint32 senderRef = signal->theData[0]; 00818 const Uint32 inclNode = signal->theData[1]; 00819 00820 NodePtr node; 00821 for(c_nodes.first(node); node.i != RNIL; c_nodes.next(node)) { 00822 jam(); 00823 const Uint32 nodeId = node.p->nodeId; 00824 if(inclNode == nodeId){ 00825 jam(); 00826 00827 ndbrequire(node.p->alive == 0); 00828 ndbrequire(!c_aliveNodes.get(nodeId)); 00829 00830 node.p->alive = 1; 00831 c_aliveNodes.set(nodeId); 00832 00833 break; 00834 }//if 00835 }//for 00836 signal->theData[0] = reference(); 00837 sendSignal(senderRef, GSN_INCL_NODECONF, signal, 1, JBB); 00838 }
|
|
|
DICT signals Definition at line 2407 of file Backup.cpp. References c_backupPool, defineBackupRef(), DefineBackupRef::FailedToAllocateTables, Signal::getDataPtr(), ArrayPool< T >::getPtr(), ListTablesConf::getTableId(), ListTablesConf::getTableType(), Ptr< T >::i, DictTabInfo::isIndex(), DictTabInfo::isTable(), jam, jamEntry, len, Signal::length(), openFiles(), Ptr< T >::p, RNIL, ListTablesConf::senderData, and ListTablesConf::tableData. Referenced by Backup(). 02408 { 02409 jamEntry(); 02410 02411 ListTablesConf* conf = (ListTablesConf*)signal->getDataPtr(); 02412 02413 BackupRecordPtr ptr; 02414 c_backupPool.getPtr(ptr, conf->senderData); 02415 02416 const Uint32 len = signal->length() - ListTablesConf::HeaderLength; 02417 for(unsigned int i = 0; i<len; i++) { 02418 jam(); 02419 Uint32 tableId = ListTablesConf::getTableId(conf->tableData[i]); 02420 Uint32 tableType = ListTablesConf::getTableType(conf->tableData[i]); 02421 if (!DictTabInfo::isTable(tableType) && !DictTabInfo::isIndex(tableType)){ 02422 jam(); 02423 continue; 02424 }//if 02425 TablePtr tabPtr; 02426 ptr.p->tables.seize(tabPtr); 02427 if(tabPtr.i == RNIL) { 02428 jam(); 02429 defineBackupRef(signal, ptr, DefineBackupRef::FailedToAllocateTables); 02430 return; 02431 }//if 02432 tabPtr.p->tableId = tableId; 02433 tabPtr.p->tableType = tableType; 02434 }//for 02435 02436 if(len == ListTablesConf::DataLength) { 02437 jam(); 02441 return; 02442 }//if 02443 02447 openFiles(signal, ptr); 02448 }
|
|
|
Definition at line 586 of file Backup.cpp. References c_aliveNodes, c_backups, c_masterNodeId, c_nodes, checkNodeFail(), BitmaskPOD< size >::clear(), DLList< T >::first(), SLList< T >::first(), BitmaskPOD< size >::get(), Signal::getDataPtr(), Ptr< T >::i, jam, jamEntry, NodeFailRep::masterNodeId, ndbout_c(), ndbrequire, DLList< T >::next(), SLList< T >::next(), Ptr< T >::p, RNIL, and NodeFailRep::theNodes. Referenced by Backup(). 00587 { 00588 jamEntry(); 00589 00590 NodeFailRep * rep = (NodeFailRep*)signal->getDataPtr(); 00591 00592 bool doStuff = false; 00593 /* 00594 Start by saving important signal data which will be destroyed before the 00595 process is completed. 00596 */ 00597 NodeId new_master_node_id = rep->masterNodeId; 00598 Uint32 theFailedNodes[NodeBitmask::Size]; 00599 for (Uint32 i = 0; i < NodeBitmask::Size; i++) 00600 theFailedNodes[i] = rep->theNodes[i]; 00601 00602 c_masterNodeId = new_master_node_id; 00603 00604 NodePtr nodePtr; 00605 for(c_nodes.first(nodePtr); nodePtr.i != RNIL; c_nodes.next(nodePtr)) { 00606 jam(); 00607 if(NodeBitmask::get(theFailedNodes, nodePtr.p->nodeId)){ 00608 if(nodePtr.p->alive){ 00609 jam(); 00610 ndbrequire(c_aliveNodes.get(nodePtr.p->nodeId)); 00611 doStuff = true; 00612 } else { 00613 jam(); 00614 ndbrequire(!c_aliveNodes.get(nodePtr.p->nodeId)); 00615 }//if 00616 nodePtr.p->alive = 0; 00617 c_aliveNodes.clear(nodePtr.p->nodeId); 00618 }//if 00619 }//for 00620 00621 if(!doStuff){ 00622 jam(); 00623 return; 00624 }//if 00625 00626 #ifdef DEBUG_ABORT 00627 ndbout_c("****************** Node fail rep ******************"); 00628 #endif 00629 00630 NodeId newCoordinator = c_masterNodeId; 00631 BackupRecordPtr ptr; 00632 for(c_backups.first(ptr); ptr.i != RNIL; c_backups.next(ptr)) { 00633 jam(); 00634 checkNodeFail(signal, ptr, newCoordinator, theFailedNodes); 00635 } 00636 }
|
|
|
|
Definition at line 3498 of file Backup.cpp. References c_backupFilePool, checkScan(), ScanFragConf::completedOps, CRASH_INSERTION, fragmentCompleted(), ScanFragConf::fragmentCompleted, Signal::getDataPtr(), ArrayPool< T >::getPtr(), jam, jamEntry, op, Ptr< T >::p, Backup::OperationRecord::scanConf(), ScanFragConf::senderData, and ScanFragConf::total_len. Referenced by Backup(). 03499 { 03500 jamEntry(); 03501 03502 CRASH_INSERTION((10017)); 03503 03504 ScanFragConf * conf = (ScanFragConf*)signal->getDataPtr(); 03505 03506 const Uint32 filePtrI = conf->senderData; 03507 BackupFilePtr filePtr; 03508 c_backupFilePool.getPtr(filePtr, filePtrI); 03509 03510 OperationRecord & op = filePtr.p->operation; 03511 03512 op.scanConf(conf->completedOps, conf->total_len); 03513 const Uint32 completed = conf->fragmentCompleted; 03514 if(completed != 2) { 03515 jam(); 03516 03517 checkScan(signal, filePtr); 03518 return; 03519 }//if 03520 03521 fragmentCompleted(signal, filePtr); 03522 }
|
|
|
Definition at line 3481 of file Backup.cpp. References backupFragmentRef(), c_backupFilePool, ScanFragRef::errorCode, Signal::getDataPtr(), ArrayPool< T >::getPtr(), jamEntry, Ptr< T >::p, and ScanFragRef::senderData. Referenced by Backup(). 03482 { 03483 jamEntry(); 03484 03485 ScanFragRef * ref = (ScanFragRef*)signal->getDataPtr(); 03486 03487 const Uint32 filePtrI = ref->senderData; 03488 BackupFilePtr filePtr; 03489 c_backupFilePool.getPtr(filePtr, filePtrI); 03490 03491 filePtr.p->errorCode = ref->errorCode; 03492 filePtr.p->scanRunning = 0; 03493 03494 backupFragmentRef(signal, filePtr); 03495 }
|
|
|
The actual scan Definition at line 3274 of file Backup.cpp. References jamEntry. Referenced by Backup(). 03275 { 03276 jamEntry(); 03277 }
|
|
|
Definition at line 1444 of file Backup.cpp. References StartBackupConf::backupPtr, c_backupPool, Signal::getDataPtr(), ArrayPool< T >::getPtr(), jamEntry, refToNode(), Signal::senderBlockRef(), StartBackupConf::signalNo, and startBackupReply(). Referenced by Backup(). 01445 { 01446 jamEntry(); 01447 01448 StartBackupConf* conf = (StartBackupConf*)signal->getDataPtr(); 01449 const Uint32 ptrI = conf->backupPtr; 01450 //const Uint32 backupId = conf->backupId; 01451 const Uint32 signalNo = conf->signalNo; 01452 const Uint32 nodeId = refToNode(signal->senderBlockRef()); 01453 01454 BackupRecordPtr ptr; 01455 c_backupPool.getPtr(ptr, ptrI); 01456 01457 startBackupReply(signal, ptr, nodeId, signalNo); 01458 }
|
|
|
Definition at line 1426 of file Backup.cpp. References StartBackupRef::backupPtr, c_backupPool, StartBackupRef::errorCode, Signal::getDataPtr(), ArrayPool< T >::getPtr(), jamEntry, StartBackupRef::nodeId, Ptr< T >::p, StartBackupRef::signalNo, and startBackupReply(). Referenced by Backup(). 01427 { 01428 jamEntry(); 01429 01430 StartBackupRef* ref = (StartBackupRef*)signal->getDataPtr(); 01431 const Uint32 ptrI = ref->backupPtr; 01432 //const Uint32 backupId = ref->backupId; 01433 const Uint32 signalNo = ref->signalNo; 01434 const Uint32 nodeId = ref->nodeId; 01435 01436 BackupRecordPtr ptr; 01437 c_backupPool.getPtr(ptr, ptrI); 01438 01439 ptr.p->setErrorCode(ref->errorCode); 01440 startBackupReply(signal, ptr, nodeId, signalNo); 01441 }
|
|
|
Start file threads... Definition at line 3045 of file Backup.cpp. References BACKUP_REF, StartBackupConf::backupId, StartBackupRef::backupId, StartBackupConf::backupPtr, StartBackupRef::backupPtr, StartBackupReq::backupPtr, c_backupPool, CRASH_INSERTION, StartBackupRef::errorCode, StartBackupRef::FailedToAllocateTriggerRecord, findTable(), Signal::getDataPtr(), Signal::getDataPtrSend(), SimulatedBlock::getOwnNodeId(), ArrayPool< T >::getPtr(), GSN_CONTINUEB, GSN_START_BACKUP_CONF, GSN_START_BACKUP_REF, GSN_START_BACKUP_REQ, Ptr< T >::i, jam, jamEntry, JBB, ndbrequire, StartBackupRef::nodeId, StartBackupReq::noOfTableTriggers, Ptr< T >::p, RNIL, SimulatedBlock::sendSignal(), SimulatedBlock::sendSignalWithDelay(), StartBackupConf::signalNo, StartBackupRef::signalNo, StartBackupReq::signalNo, BackupContinueB::START_FILE_THREAD, STARTED, StartBackupReq::TableTriggers::tableId, StartBackupReq::tableTriggers, Signal::theData, and StartBackupReq::TableTriggers::triggerIds. Referenced by Backup(). 03046 { 03047 jamEntry(); 03048 03049 CRASH_INSERTION((10015)); 03050 03051 StartBackupReq* req = (StartBackupReq*)signal->getDataPtr(); 03052 const Uint32 ptrI = req->backupPtr; 03053 //const Uint32 backupId = req->backupId; 03054 const Uint32 signalNo = req->signalNo; 03055 03056 BackupRecordPtr ptr; 03057 c_backupPool.getPtr(ptr, ptrI); 03058 03059 ptr.p->slaveState.setState(STARTED); 03060 ptr.p->m_gsn = GSN_START_BACKUP_REQ; 03061 03062 for(Uint32 i = 0; i<req->noOfTableTriggers; i++) { 03063 jam(); 03064 TablePtr tabPtr; 03065 ndbrequire(findTable(ptr, tabPtr, req->tableTriggers[i].tableId)); 03066 for(Uint32 j = 0; j<3; j++) { 03067 jam(); 03068 const Uint32 triggerId = req->tableTriggers[i].triggerIds[j]; 03069 tabPtr.p->triggerIds[j] = triggerId; 03070 03071 TriggerPtr trigPtr; 03072 if(!ptr.p->triggers.seizeId(trigPtr, triggerId)) { 03073 jam(); 03074 ptr.p->m_gsn = GSN_START_BACKUP_REF; 03075 StartBackupRef* ref = (StartBackupRef*)signal->getDataPtrSend(); 03076 ref->backupPtr = ptr.i; 03077 ref->backupId = ptr.p->backupId; 03078 ref->signalNo = signalNo; 03079 ref->errorCode = StartBackupRef::FailedToAllocateTriggerRecord; 03080 ref->nodeId = getOwnNodeId(); 03081 sendSignal(ptr.p->masterRef, GSN_START_BACKUP_REF, signal, 03082 StartBackupRef::SignalLength, JBB); 03083 return; 03084 }//if 03085 03086 tabPtr.p->triggerAllocated[j] = true; 03087 trigPtr.p->backupPtr = ptr.i; 03088 trigPtr.p->tableId = tabPtr.p->tableId; 03089 trigPtr.p->tab_ptr_i = tabPtr.i; 03090 trigPtr.p->logEntry = 0; 03091 trigPtr.p->event = j; 03092 trigPtr.p->maxRecordSize = 2048; 03093 trigPtr.p->operation = 03094 &ptr.p->files.getPtr(ptr.p->logFilePtr)->operation; 03095 trigPtr.p->operation->noOfBytes = 0; 03096 trigPtr.p->operation->noOfRecords = 0; 03097 trigPtr.p->errorCode = 0; 03098 }//for 03099 }//for 03100 03104 BackupFilePtr filePtr; 03105 for(ptr.p->files.first(filePtr); 03106 filePtr.i!=RNIL; 03107 ptr.p->files.next(filePtr)){ 03108 jam(); 03109 if(filePtr.p->fileRunning == 0) { 03110 jam(); 03111 filePtr.p->fileRunning = 1; 03112 signal->theData[0] = BackupContinueB::START_FILE_THREAD; 03113 signal->theData[1] = filePtr.i; 03114 sendSignalWithDelay(BACKUP_REF, GSN_CONTINUEB, signal, 100, 2); 03115 }//if 03116 }//for 03117 03118 ptr.p->m_gsn = GSN_START_BACKUP_CONF; 03119 StartBackupConf* conf = (StartBackupConf*)signal->getDataPtrSend(); 03120 conf->backupPtr = ptr.i; 03121 conf->backupId = ptr.p->backupId; 03122 conf->signalNo = signalNo; 03123 sendSignal(ptr.p->masterRef, GSN_START_BACKUP_CONF, signal, 03124 StartBackupConf::SignalLength, JBB); 03125 }
|
|
|
Definition at line 2052 of file Backup.cpp. References StopBackupConf::backupPtr, c_backupPool, Signal::getDataPtr(), ArrayPool< T >::getPtr(), jamEntry, StopBackupConf::noOfLogBytes, StopBackupConf::noOfLogRecords, Ptr< T >::p, refToNode(), Signal::senderBlockRef(), and stopBackupReply(). Referenced by Backup(). 02053 { 02054 jamEntry(); 02055 02056 StopBackupConf* conf = (StopBackupConf*)signal->getDataPtr(); 02057 const Uint32 ptrI = conf->backupPtr; 02058 //const Uint32 backupId = conf->backupId; 02059 const Uint32 nodeId = refToNode(signal->senderBlockRef()); 02060 02061 BackupRecordPtr ptr; 02062 c_backupPool.getPtr(ptr, ptrI); 02063 02064 ptr.p->noOfLogBytes += conf->noOfLogBytes; 02065 ptr.p->noOfLogRecords += conf->noOfLogRecords; 02066 02067 stopBackupReply(signal, ptr, nodeId); 02068 }
|
|
|
Definition at line 2017 of file Backup.cpp. References StopBackupRef::backupPtr, c_backupPool, StopBackupRef::errorCode, Signal::getDataPtr(), ArrayPool< T >::getPtr(), jamEntry, StopBackupRef::nodeId, Ptr< T >::p, and stopBackupReply(). Referenced by Backup(). 02018 { 02019 jamEntry(); 02020 02021 StopBackupRef* ref = (StopBackupRef*)signal->getDataPtr(); 02022 const Uint32 ptrI = ref->backupPtr; 02023 //const Uint32 backupId = ref->backupId; 02024 const Uint32 nodeId = ref->nodeId; 02025 02026 BackupRecordPtr ptr; 02027 c_backupPool.getPtr(ptr, ptrI); 02028 02029 ptr.p->setErrorCode(ref->errorCode); 02030 stopBackupReply(signal, ptr, nodeId); 02031 }
|
|