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


Definition at line 41 of file Backup.hpp.
| typedef Ptr<Attribute> Backup::AttributePtr |
Definition at line 193 of file Backup.hpp.
| typedef Ptr<BackupFile> Backup::BackupFilePtr |
Definition at line 352 of file Backup.hpp.
| typedef Ptr<BackupRecord> Backup::BackupRecordPtr |
Definition at line 517 of file Backup.hpp.
| typedef Ptr<Fragment> Backup::FragmentPtr |
Definition at line 205 of file Backup.hpp.
| typedef Ptr<Node> Backup::NodePtr |
Definition at line 165 of file Backup.hpp.
| typedef Ptr<Page32> Backup::Page32Ptr |
Definition at line 172 of file Backup.hpp.
| typedef Ptr<Table> Backup::TablePtr |
Definition at line 228 of file Backup.hpp.
| typedef Ptr<TriggerRecord> Backup::TriggerPtr |
Definition at line 326 of file Backup.hpp.
| enum Backup::State |
State for BackupRecord
Definition at line 358 of file Backup.hpp.
00358 { 00359 INITIAL, 00360 DEFINING, // Defining backup content and parameters 00361 DEFINED, // DEFINE_BACKUP_CONF sent in slave, received all in master 00362 STARTED, // Creating triggers 00363 SCANNING, // Scanning fragments 00364 STOPPING, // Closing files 00365 CLEANING, // Cleaning resources 00366 ABORTING // Aborting backup 00367 };
| Backup::Backup | ( | Block_context & | ctx | ) |
Definition at line 30 of file BackupInit.cpp.
References BLOCK_CONSTRUCTOR, c_masterNodeId, execABORT_BACKUP_ORD(), execBACKUP_ABORT_REP(), execBACKUP_COMPLETE_REP(), execBACKUP_CONF(), execBACKUP_FRAGMENT_COMPLETE_REP(), execBACKUP_FRAGMENT_CONF(), execBACKUP_FRAGMENT_REF(), execBACKUP_FRAGMENT_REQ(), execBACKUP_REF(), execBACKUP_REQ(), execBACKUP_TRIG_REQ(), execCONTINUEB(), execCREATE_TRIG_CONF(), execCREATE_TRIG_REF(), execDEFINE_BACKUP_CONF(), execDEFINE_BACKUP_REF(), execDEFINE_BACKUP_REQ(), execDI_FCOUNTCONF(), execDIGETPRIMCONF(), execDROP_TRIG_CONF(), execDROP_TRIG_REF(), execDUMP_STATE_ORD(), execEND_LCPREQ(), execFIRE_TRIG_ORD(), execFSAPPENDCONF(), execFSAPPENDREF(), execFSCLOSECONF(), execFSCLOSEREF(), execFSOPENCONF(), execFSOPENREF(), execFSREMOVECONF(), execFSREMOVEREF(), execGET_TABINFO_CONF(), execGET_TABINFOREF(), execINCL_NODEREQ(), execLCP_PREPARE_REQ(), execLIST_TABLES_CONF(), execNODE_FAILREP(), execREAD_CONFIG_REQ(), execREAD_NODESCONF(), execSCAN_FRAGCONF(), execSCAN_FRAGREF(), execSCAN_HBREP(), execSTART_BACKUP_CONF(), execSTART_BACKUP_REF(), execSTART_BACKUP_REQ(), execSTOP_BACKUP_CONF(), execSTOP_BACKUP_REF(), execSTOP_BACKUP_REQ(), execSTTOR(), execTRANSID_AI(), execTRIG_ATTRINFO(), execUTIL_SEQUENCE_CONF(), execUTIL_SEQUENCE_REF(), execWAIT_GCP_CONF(), execWAIT_GCP_REF(), SimulatedBlock::getOwnNodeId(), GSN_ABORT_BACKUP_ORD, GSN_BACKUP_ABORT_REP, GSN_BACKUP_COMPLETE_REP, GSN_BACKUP_CONF, GSN_BACKUP_FRAGMENT_COMPLETE_REP, GSN_BACKUP_FRAGMENT_CONF, GSN_BACKUP_FRAGMENT_REF, GSN_BACKUP_FRAGMENT_REQ, GSN_BACKUP_REF, GSN_BACKUP_REQ, GSN_BACKUP_TRIG_REQ, GSN_CONTINUEB, GSN_CREATE_TRIG_CONF, GSN_CREATE_TRIG_REF, GSN_DEFINE_BACKUP_CONF, GSN_DEFINE_BACKUP_REF, GSN_DEFINE_BACKUP_REQ, GSN_DI_FCOUNTCONF, GSN_DIGETPRIMCONF, GSN_DROP_TRIG_CONF, GSN_DROP_TRIG_REF, GSN_DUMP_STATE_ORD, GSN_END_LCPREQ, GSN_FIRE_TRIG_ORD, GSN_FSAPPENDCONF, GSN_FSAPPENDREF, GSN_FSCLOSECONF, GSN_FSCLOSEREF, GSN_FSOPENCONF, GSN_FSOPENREF, GSN_FSREMOVECONF, GSN_FSREMOVEREF, GSN_GET_TABINFO_CONF, GSN_GET_TABINFOREF, GSN_INCL_NODEREQ, GSN_LCP_PREPARE_REQ, GSN_LIST_TABLES_CONF, GSN_NODE_FAILREP, GSN_READ_CONFIG_REQ, GSN_READ_NODESCONF, GSN_SCAN_FRAGCONF, GSN_SCAN_FRAGREF, GSN_SCAN_HBREP, 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_STTOR, GSN_TRANSID_AI, GSN_TRIG_ATTRINFO, GSN_UTIL_SEQUENCE_CONF, GSN_UTIL_SEQUENCE_REF, GSN_WAIT_GCP_CONF, and GSN_WAIT_GCP_REF.
00030 : 00031 SimulatedBlock(BACKUP, ctx), 00032 c_nodes(c_nodePool), 00033 c_backups(c_backupPool) 00034 { 00035 BLOCK_CONSTRUCTOR(Backup); 00036 00037 c_masterNodeId = getOwnNodeId(); 00038 00039 // Add received signals 00040 addRecSignal(GSN_READ_CONFIG_REQ, &Backup::execREAD_CONFIG_REQ); 00041 addRecSignal(GSN_STTOR, &Backup::execSTTOR); 00042 addRecSignal(GSN_DUMP_STATE_ORD, &Backup::execDUMP_STATE_ORD); 00043 addRecSignal(GSN_READ_NODESCONF, &Backup::execREAD_NODESCONF); 00044 addRecSignal(GSN_NODE_FAILREP, &Backup::execNODE_FAILREP); 00045 addRecSignal(GSN_INCL_NODEREQ, &Backup::execINCL_NODEREQ); 00046 addRecSignal(GSN_CONTINUEB, &Backup::execCONTINUEB); 00047 addRecSignal(GSN_READ_CONFIG_REQ, &Backup::execREAD_CONFIG_REQ, true); 00048 00049 addRecSignal(GSN_SCAN_HBREP, &Backup::execSCAN_HBREP); 00050 addRecSignal(GSN_TRANSID_AI, &Backup::execTRANSID_AI); 00051 addRecSignal(GSN_SCAN_FRAGREF, &Backup::execSCAN_FRAGREF); 00052 addRecSignal(GSN_SCAN_FRAGCONF, &Backup::execSCAN_FRAGCONF); 00053 00054 addRecSignal(GSN_BACKUP_TRIG_REQ, &Backup::execBACKUP_TRIG_REQ); 00055 addRecSignal(GSN_TRIG_ATTRINFO, &Backup::execTRIG_ATTRINFO); 00056 addRecSignal(GSN_FIRE_TRIG_ORD, &Backup::execFIRE_TRIG_ORD); 00057 00058 addRecSignal(GSN_LIST_TABLES_CONF, &Backup::execLIST_TABLES_CONF); 00059 addRecSignal(GSN_GET_TABINFOREF, &Backup::execGET_TABINFOREF); 00060 addRecSignal(GSN_GET_TABINFO_CONF, &Backup::execGET_TABINFO_CONF); 00061 00062 addRecSignal(GSN_CREATE_TRIG_REF, &Backup::execCREATE_TRIG_REF); 00063 addRecSignal(GSN_CREATE_TRIG_CONF, &Backup::execCREATE_TRIG_CONF); 00064 00065 addRecSignal(GSN_DROP_TRIG_REF, &Backup::execDROP_TRIG_REF); 00066 addRecSignal(GSN_DROP_TRIG_CONF, &Backup::execDROP_TRIG_CONF); 00067 00068 addRecSignal(GSN_DI_FCOUNTCONF, &Backup::execDI_FCOUNTCONF); 00069 addRecSignal(GSN_DIGETPRIMCONF, &Backup::execDIGETPRIMCONF); 00070 00071 addRecSignal(GSN_FSOPENREF, &Backup::execFSOPENREF, true); 00072 addRecSignal(GSN_FSOPENCONF, &Backup::execFSOPENCONF); 00073 00074 addRecSignal(GSN_FSCLOSEREF, &Backup::execFSCLOSEREF, true); 00075 addRecSignal(GSN_FSCLOSECONF, &Backup::execFSCLOSECONF); 00076 00077 addRecSignal(GSN_FSAPPENDREF, &Backup::execFSAPPENDREF, true); 00078 addRecSignal(GSN_FSAPPENDCONF, &Backup::execFSAPPENDCONF); 00079 00080 addRecSignal(GSN_FSREMOVEREF, &Backup::execFSREMOVEREF, true); 00081 addRecSignal(GSN_FSREMOVECONF, &Backup::execFSREMOVECONF); 00082 00083 /*****/ 00084 addRecSignal(GSN_BACKUP_REQ, &Backup::execBACKUP_REQ); 00085 addRecSignal(GSN_ABORT_BACKUP_ORD, &Backup::execABORT_BACKUP_ORD); 00086 00087 addRecSignal(GSN_DEFINE_BACKUP_REQ, &Backup::execDEFINE_BACKUP_REQ); 00088 addRecSignal(GSN_DEFINE_BACKUP_REF, &Backup::execDEFINE_BACKUP_REF); 00089 addRecSignal(GSN_DEFINE_BACKUP_CONF, &Backup::execDEFINE_BACKUP_CONF); 00090 00091 addRecSignal(GSN_START_BACKUP_REQ, &Backup::execSTART_BACKUP_REQ); 00092 addRecSignal(GSN_START_BACKUP_REF, &Backup::execSTART_BACKUP_REF); 00093 addRecSignal(GSN_START_BACKUP_CONF, &Backup::execSTART_BACKUP_CONF); 00094 00095 addRecSignal(GSN_BACKUP_FRAGMENT_REQ, &Backup::execBACKUP_FRAGMENT_REQ); 00096 addRecSignal(GSN_BACKUP_FRAGMENT_REF, &Backup::execBACKUP_FRAGMENT_REF); 00097 addRecSignal(GSN_BACKUP_FRAGMENT_CONF, &Backup::execBACKUP_FRAGMENT_CONF); 00098 00099 addRecSignal(GSN_BACKUP_FRAGMENT_COMPLETE_REP, 00100 &Backup::execBACKUP_FRAGMENT_COMPLETE_REP); 00101 00102 addRecSignal(GSN_STOP_BACKUP_REQ, &Backup::execSTOP_BACKUP_REQ); 00103 addRecSignal(GSN_STOP_BACKUP_REF, &Backup::execSTOP_BACKUP_REF); 00104 addRecSignal(GSN_STOP_BACKUP_CONF, &Backup::execSTOP_BACKUP_CONF); 00105 00106 //addRecSignal(GSN_BACKUP_STATUS_REQ, &Backup::execBACKUP_STATUS_REQ); 00107 //addRecSignal(GSN_BACKUP_STATUS_CONF, &Backup::execBACKUP_STATUS_CONF); 00108 00109 addRecSignal(GSN_UTIL_SEQUENCE_REF, &Backup::execUTIL_SEQUENCE_REF); 00110 addRecSignal(GSN_UTIL_SEQUENCE_CONF, &Backup::execUTIL_SEQUENCE_CONF); 00111 00112 addRecSignal(GSN_WAIT_GCP_REF, &Backup::execWAIT_GCP_REF); 00113 addRecSignal(GSN_WAIT_GCP_CONF, &Backup::execWAIT_GCP_CONF); 00114 00118 addRecSignal(GSN_BACKUP_REF, &Backup::execBACKUP_REF); 00119 addRecSignal(GSN_BACKUP_CONF, &Backup::execBACKUP_CONF); 00120 addRecSignal(GSN_BACKUP_ABORT_REP, &Backup::execBACKUP_ABORT_REP); 00121 addRecSignal(GSN_BACKUP_COMPLETE_REP, &Backup::execBACKUP_COMPLETE_REP); 00122 00123 addRecSignal(GSN_LCP_PREPARE_REQ, &Backup::execLCP_PREPARE_REQ); 00124 addRecSignal(GSN_END_LCPREQ, &Backup::execEND_LCPREQ); 00125 }
Here is the call graph for this function:

| Backup::~Backup | ( | ) | [virtual] |
| void Backup::abort_scan | ( | Signal * | , | |
| BackupRecordPtr | ptr | |||
| ) |
Definition at line 2263 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().
02264 { 02265 AbortBackupOrd *ord = (AbortBackupOrd*)signal->getDataPtrSend(); 02266 ord->backupId = ptr.p->backupId; 02267 ord->backupPtr = ptr.i; 02268 ord->senderData= ptr.i; 02269 ord->requestType = AbortBackupOrd::AbortScan; 02270 02271 TablePtr tabPtr; 02272 ptr.p->tables.first(tabPtr); 02273 for(; tabPtr.i != RNIL; ptr.p->tables.next(tabPtr)) { 02274 jam(); 02275 FragmentPtr fragPtr; 02276 Array<Fragment> & frags = tabPtr.p->fragments; 02277 const Uint32 fragCount = frags.getSize(); 02278 02279 for(Uint32 i = 0; i<fragCount; i++) { 02280 jam(); 02281 tabPtr.p->fragments.getPtr(fragPtr, i); 02282 const Uint32 nodeId = fragPtr.p->node; 02283 if(fragPtr.p->scanning != 0 && ptr.p->nodes.get(nodeId)) { 02284 jam(); 02285 02286 const BlockReference ref = numberToRef(BACKUP, nodeId); 02287 sendSignal(ref, GSN_ABORT_BACKUP_ORD, signal, 02288 AbortBackupOrd::SignalLength, JBB); 02289 02290 } 02291 } 02292 } 02293 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::abortFile | ( | Signal * | signal, | |
| BackupRecordPtr | ptr, | |||
| BackupFilePtr | filePtr | |||
| ) |
| void Backup::abortFileHook | ( | Signal * | signal, | |
| BackupFilePtr | filePtr, | |||
| bool | scanDone | |||
| ) |
| void Backup::alterTrigReply | ( | Signal * | signal, | |
| BackupRecordPtr | ptr | |||
| ) |
| void Backup::backupAllData | ( | Signal * | signal, | |
| BackupRecordPtr | ||||
| ) |
Definition at line 2530 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().
02531 { 02535 ListTablesReq * req = (ListTablesReq*)signal->getDataPtrSend(); 02536 req->senderRef = reference(); 02537 req->senderData = ptr.i; 02538 req->requestData = 0; 02539 sendSignal(DBDICT_REF, GSN_LIST_TABLES_REQ, signal, 02540 ListTablesReq::SignalLength, JBB); 02541 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::backupFragmentRef | ( | Signal * | signal, | |
| BackupFilePtr | filePtr | |||
| ) |
Definition at line 3765 of file Backup.cpp.
References BackupFragmentRef::backupId, BackupFragmentRef::backupPtr, c_backupPool, BackupFragmentRef::errorCode, Signal::getDataPtrSend(), SimulatedBlock::getOwnNodeId(), GSN_BACKUP_FRAGMENT_REF, Ptr< T >::i, JBB, BackupFragmentRef::nodeId, Ptr< T >::p, and SimulatedBlock::sendSignal().
Referenced by execSCAN_FRAGREF(), and fragmentCompleted().
03766 { 03767 BackupRecordPtr ptr; 03768 c_backupPool.getPtr(ptr, filePtr.p->backupPtr); 03769 03770 ptr.p->m_gsn = GSN_BACKUP_FRAGMENT_REF; 03771 03772 BackupFragmentRef * ref = (BackupFragmentRef*)signal->getDataPtrSend(); 03773 ref->backupId = ptr.p->backupId; 03774 ref->backupPtr = ptr.i; 03775 ref->nodeId = getOwnNodeId(); 03776 ref->errorCode = filePtr.p->errorCode; 03777 sendSignal(ptr.p->masterRef, GSN_BACKUP_FRAGMENT_REF, signal, 03778 BackupFragmentRef::SignalLength, JBB); 03779 }
Here is the call graph for this function:

Here is the caller graph for this function:

| Backup::BLOCK_DEFINES | ( | Backup | ) |
| bool Backup::checkAbort | ( | BackupRecordPtr | ptr | ) |
| void Backup::checkFile | ( | Signal * | , | |
| BackupFilePtr | ||||
| ) |
Definition at line 3885 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, 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 closeFiles(), execCONTINUEB(), execFSAPPENDCONF(), and execFSAPPENDREF().
03886 { 03887 03888 #ifdef DEBUG_ABORT 03889 // ndbout_c("---- check file filePtr.i = %u", filePtr.i); 03890 #endif 03891 03892 OperationRecord & op = filePtr.p->operation; 03893 03894 Uint32 * tmp, sz; bool eof; 03895 if(op.dataBuffer.getReadPtr(&tmp, &sz, &eof)) 03896 { 03897 jam(); 03898 03899 jam(); 03900 FsAppendReq * req = (FsAppendReq *)signal->getDataPtrSend(); 03901 req->filePointer = filePtr.p->filePointer; 03902 req->userPointer = filePtr.i; 03903 req->userReference = reference(); 03904 req->varIndex = 0; 03905 req->offset = tmp - c_startOfPages; 03906 req->size = sz; 03907 03908 sendSignal(NDBFS_REF, GSN_FSAPPENDREQ, signal, 03909 FsAppendReq::SignalLength, JBA); 03910 return; 03911 } 03912 03913 if(!eof) { 03914 jam(); 03915 signal->theData[0] = BackupContinueB::BUFFER_UNDERFLOW; 03916 signal->theData[1] = filePtr.i; 03917 sendSignalWithDelay(BACKUP_REF, GSN_CONTINUEB, signal, 50, 2); 03918 return; 03919 }//if 03920 03921 if(sz > 0) { 03922 jam(); 03923 FsAppendReq * req = (FsAppendReq *)signal->getDataPtrSend(); 03924 req->filePointer = filePtr.p->filePointer; 03925 req->userPointer = filePtr.i; 03926 req->userReference = reference(); 03927 req->varIndex = 0; 03928 req->offset = tmp - c_startOfPages; 03929 req->size = sz; // Round up 03930 03931 sendSignal(NDBFS_REF, GSN_FSAPPENDREQ, signal, 03932 FsAppendReq::SignalLength, JBA); 03933 return; 03934 }//if 03935 03936 #ifdef DEBUG_ABORT 03937 Uint32 running= filePtr.p->fileRunning; 03938 Uint32 closing= filePtr.p->fileClosing; 03939 #endif 03940 03941 if(!filePtr.p->fileClosing) 03942 { 03943 filePtr.p->fileRunning = 0; 03944 filePtr.p->fileClosing = 1; 03945 03946 FsCloseReq * req = (FsCloseReq *)signal->getDataPtrSend(); 03947 req->filePointer = filePtr.p->filePointer; 03948 req->userPointer = filePtr.i; 03949 req->userReference = reference(); 03950 req->fileFlag = 0; 03951 #ifdef DEBUG_ABORT 03952 ndbout_c("***** a FSCLOSEREQ filePtr.i = %u run=%d cl=%d", filePtr.i, 03953 running, closing); 03954 #endif 03955 sendSignal(NDBFS_REF, GSN_FSCLOSEREQ, signal, FsCloseReq::SignalLength, JBA); 03956 } 03957 else 03958 { 03959 #ifdef DEBUG_ABORT 03960 ndbout_c("***** a NOT SENDING FSCLOSEREQ filePtr.i = %u run=%d cl=%d", 03961 filePtr.i, 03962 running, closing); 03963 #endif 03964 03965 } 03966 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::checkNodeFail | ( | Signal * | signal, | |
| BackupRecordPtr | ptr, | |||
| NodeId | newCoord, | |||
| Uint32 | theFailedNodes[NodeBitmask::Size] | |||
| ) |
Definition at line 738 of file Backup.cpp.
References 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 >::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, mask, masterAbort(), ndbout_c(), ndbrequire, StopBackupRef::nodeId, BackupFragmentRef::nodeId, StartBackupRef::nodeId, DefineBackupRef::nodeId, Ptr< T >::p, pos(), SimulatedBlock::reference(), refToNode(), RNIL, SimulatedBlock::sendSignal(), and Signal::theData.
Referenced by execNODE_FAILREP().
00742 { 00743 NdbNodeBitmask mask; 00744 mask.assign(2, theFailedNodes); 00745 00746 /* Update ptr.p->nodes to be up to date with current alive nodes 00747 */ 00748 NodePtr nodePtr; 00749 bool found = false; 00750 for(c_nodes.first(nodePtr); nodePtr.i != RNIL; c_nodes.next(nodePtr)) { 00751 jam(); 00752 if(NodeBitmask::get(theFailedNodes, nodePtr.p->nodeId)) { 00753 jam(); 00754 if (ptr.p->nodes.get(nodePtr.p->nodeId)) { 00755 jam(); 00756 ptr.p->nodes.clear(nodePtr.p->nodeId); 00757 found = true; 00758 } 00759 }//if 00760 }//for 00761 00762 if(!found) { 00763 jam(); 00764 return; // failed node is not part of backup process, safe to continue 00765 } 00766 00767 if(mask.get(refToNode(ptr.p->masterRef))) 00768 { 00772 ptr.p->masterRef = reference(); 00773 ptr.p->nodes.clear(); 00774 ptr.p->nodes.set(getOwnNodeId()); 00775 ptr.p->setErrorCode(AbortBackupOrd::BackupFailureDueToNodeFail); 00776 switch(ptr.p->m_gsn){ 00777 case GSN_DEFINE_BACKUP_REQ: 00778 case GSN_START_BACKUP_REQ: 00779 case GSN_BACKUP_FRAGMENT_REQ: 00780 case GSN_STOP_BACKUP_REQ: 00781 // I'm currently processing...reply to self and abort... 00782 ptr.p->masterData.gsn = ptr.p->m_gsn; 00783 ptr.p->masterData.sendCounter = ptr.p->nodes; 00784 return; 00785 case GSN_DEFINE_BACKUP_REF: 00786 case GSN_DEFINE_BACKUP_CONF: 00787 case GSN_START_BACKUP_REF: 00788 case GSN_START_BACKUP_CONF: 00789 case GSN_BACKUP_FRAGMENT_REF: 00790 case GSN_BACKUP_FRAGMENT_CONF: 00791 case GSN_STOP_BACKUP_REF: 00792 case GSN_STOP_BACKUP_CONF: 00793 ptr.p->masterData.gsn = GSN_DEFINE_BACKUP_REQ; 00794 masterAbort(signal, ptr); 00795 return; 00796 case GSN_ABORT_BACKUP_ORD: 00797 // Already aborting 00798 return; 00799 } 00800 } 00801 else if (newCoord == getOwnNodeId()) 00802 { 00806 jam(); 00807 CRASH_INSERTION((10001)); 00808 #ifdef DEBUG_ABORT 00809 ndbout_c("**** Master: Node failed: Master id = %u", 00810 refToNode(ptr.p->masterRef)); 00811 #endif 00812 00813 Uint32 gsn, len, pos; 00814 ptr.p->nodes.bitANDC(mask); 00815 switch(ptr.p->masterData.gsn){ 00816 case GSN_DEFINE_BACKUP_REQ: 00817 { 00818 DefineBackupRef * ref = (DefineBackupRef*)signal->getDataPtr(); 00819 ref->backupPtr = ptr.i; 00820 ref->backupId = ptr.p->backupId; 00821 ref->errorCode = AbortBackupOrd::BackupFailureDueToNodeFail; 00822 gsn= GSN_DEFINE_BACKUP_REF; 00823 len= DefineBackupRef::SignalLength; 00824 pos= &ref->nodeId - signal->getDataPtr(); 00825 break; 00826 } 00827 case GSN_START_BACKUP_REQ: 00828 { 00829 StartBackupRef * ref = (StartBackupRef*)signal->getDataPtr(); 00830 ref->backupPtr = ptr.i; 00831 ref->backupId = ptr.p->backupId; 00832 ref->errorCode = AbortBackupOrd::BackupFailureDueToNodeFail; 00833 gsn= GSN_START_BACKUP_REF; 00834 len= StartBackupRef::SignalLength; 00835 pos= &ref->nodeId - signal->getDataPtr(); 00836 break; 00837 } 00838 case GSN_BACKUP_FRAGMENT_REQ: 00839 { 00840 BackupFragmentRef * ref = (BackupFragmentRef*)signal->getDataPtr(); 00841 ref->backupPtr = ptr.i; 00842 ref->backupId = ptr.p->backupId; 00843 ref->errorCode = AbortBackupOrd::BackupFailureDueToNodeFail; 00844 gsn= GSN_BACKUP_FRAGMENT_REF; 00845 len= BackupFragmentRef::SignalLength; 00846 pos= &ref->nodeId - signal->getDataPtr(); 00847 break; 00848 } 00849 case GSN_STOP_BACKUP_REQ: 00850 { 00851 StopBackupRef * ref = (StopBackupRef*)signal->getDataPtr(); 00852 ref->backupPtr = ptr.i; 00853 ref->backupId = ptr.p->backupId; 00854 ref->errorCode = AbortBackupOrd::BackupFailureDueToNodeFail; 00855 gsn= GSN_STOP_BACKUP_REF; 00856 len= StopBackupRef::SignalLength; 00857 pos= &ref->nodeId - signal->getDataPtr(); 00858 break; 00859 } 00860 case GSN_WAIT_GCP_REQ: 00861 case GSN_DROP_TRIG_REQ: 00862 case GSN_CREATE_TRIG_REQ: 00863 case GSN_ALTER_TRIG_REQ: 00864 ptr.p->setErrorCode(AbortBackupOrd::BackupFailureDueToNodeFail); 00865 return; 00866 case GSN_UTIL_SEQUENCE_REQ: 00867 case GSN_UTIL_LOCK_REQ: 00868 return; 00869 default: 00870 ndbrequire(false); 00871 } 00872 00873 for(Uint32 i = 0; (i = mask.find(i+1)) != NdbNodeBitmask::NotFound; ) 00874 { 00875 signal->theData[pos] = i; 00876 sendSignal(reference(), gsn, signal, len, JBB); 00877 #ifdef DEBUG_ABORT 00878 ndbout_c("sending %d to self from %d", gsn, i); 00879 #endif 00880 } 00881 return; 00882 }//if 00883 00887 CRASH_INSERTION((10021)); 00888 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::checkScan | ( | Signal * | , | |
| BackupFilePtr | ||||
| ) |
Definition at line 3782 of file Backup.cpp.
References BACKUP, BACKUP_REF, AbortBackupOrd::backupId, AbortBackupOrd::backupPtr, ScanFragNextReq::batch_size_bytes, ScanFragNextReq::batch_size_rows, BackupContinueB::BUFFER_FULL_SCAN, c_backupPool, ScanFragNextReq::closeFlag, Backup::OperationRecord::closeScan(), DBLQH_REF, ERROR_INSERTED, AbortBackupOrd::FileOrScanError, Signal::getDataPtrSend(), SimulatedBlock::getOwnNodeId(), GSN_ABORT_BACKUP_ORD, GSN_CONTINUEB, GSN_SCAN_NEXTREQ, Ptr< T >::i, jam, JBB, Backup::OperationRecord::newScan(), Ptr< T >::p, AbortBackupOrd::requestType, AbortBackupOrd::senderData, ScanFragNextReq::senderData, SimulatedBlock::sendSignal(), SimulatedBlock::sendSignalWithDelay(), SET_ERROR_INSERT_VALUE, Signal::theData, ScanFragNextReq::transId1, and ScanFragNextReq::transId2.
Referenced by execCONTINUEB(), and execSCAN_FRAGCONF().
03783 { 03784 OperationRecord & op = filePtr.p->operation; 03785 03786 if(filePtr.p->errorCode != 0) 03787 { 03788 jam(); 03789 03793 op.closeScan(); 03794 ScanFragNextReq * req = (ScanFragNextReq *)signal->getDataPtrSend(); 03795 req->senderData = filePtr.i; 03796 req->closeFlag = 1; 03797 req->transId1 = 0; 03798 req->transId2 = (BACKUP << 20) + (getOwnNodeId() << 8); 03799 sendSignal(DBLQH_REF, GSN_SCAN_NEXTREQ, signal, 03800 ScanFragNextReq::SignalLength, JBB); 03801 return; 03802 }//if 03803 03804 if(op.newScan()) { 03805 jam(); 03806 03807 ScanFragNextReq * req = (ScanFragNextReq *)signal->getDataPtrSend(); 03808 req->senderData = filePtr.i; 03809 req->closeFlag = 0; 03810 req->transId1 = 0; 03811 req->transId2 = (BACKUP << 20) + (getOwnNodeId() << 8); 03812 req->batch_size_rows= 16; 03813 req->batch_size_bytes= 0; 03814 if(ERROR_INSERTED(10032)) 03815 sendSignalWithDelay(DBLQH_REF, GSN_SCAN_NEXTREQ, signal, 03816 100, ScanFragNextReq::SignalLength); 03817 else if(ERROR_INSERTED(10033)) 03818 { 03819 SET_ERROR_INSERT_VALUE(10032); 03820 sendSignalWithDelay(DBLQH_REF, GSN_SCAN_NEXTREQ, signal, 03821 10000, ScanFragNextReq::SignalLength); 03822 03823 BackupRecordPtr ptr; 03824 c_backupPool.getPtr(ptr, filePtr.p->backupPtr); 03825 AbortBackupOrd *ord = (AbortBackupOrd*)signal->getDataPtrSend(); 03826 ord->backupId = ptr.p->backupId; 03827 ord->backupPtr = ptr.i; 03828 ord->requestType = AbortBackupOrd::FileOrScanError; 03829 ord->senderData= ptr.i; 03830 sendSignal(ptr.p->masterRef, GSN_ABORT_BACKUP_ORD, signal, 03831 AbortBackupOrd::SignalLength, JBB); 03832 } 03833 else 03834 sendSignal(DBLQH_REF, GSN_SCAN_NEXTREQ, signal, 03835 ScanFragNextReq::SignalLength, JBB); 03836 return; 03837 }//if 03838 03839 signal->theData[0] = BackupContinueB::BUFFER_FULL_SCAN; 03840 signal->theData[1] = filePtr.i; 03841 sendSignalWithDelay(BACKUP_REF, GSN_CONTINUEB, signal, 50, 2); 03842 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::cleanup | ( | Signal * | , | |
| BackupRecordPtr | ptr | |||
| ) |
Definition at line 4512 of file Backup.cpp.
References c_triggerPool, DBDICT, SimulatedBlock::EXECUTE_DIRECT(), GSN_BACKUP_FRAGMENT_REQ, Ptr< T >::i, ILLEGAL_TRIGGER_ID, jam, Ptr< T >::p, RNIL, and Signal::theData.
Referenced by execABORT_BACKUP_ORD(), and sendBackupRef().
04513 { 04514 04515 TablePtr tabPtr; 04516 for(ptr.p->tables.first(tabPtr); tabPtr.i != RNIL;ptr.p->tables.next(tabPtr)) 04517 { 04518 jam(); 04519 tabPtr.p->attributes.release(); 04520 tabPtr.p->fragments.release(); 04521 for(Uint32 j = 0; j<3; j++) { 04522 jam(); 04523 TriggerPtr trigPtr; 04524 if(tabPtr.p->triggerAllocated[j]) { 04525 jam(); 04526 c_triggerPool.getPtr(trigPtr, tabPtr.p->triggerIds[j]); 04527 trigPtr.p->event = ILLEGAL_TRIGGER_ID; 04528 tabPtr.p->triggerAllocated[j] = false; 04529 }//if 04530 tabPtr.p->triggerIds[j] = ILLEGAL_TRIGGER_ID; 04531 }//for 04532 { 04533 signal->theData[0] = tabPtr.p->tableId; 04534 signal->theData[1] = 0; // unlock 04535 EXECUTE_DIRECT(DBDICT, GSN_BACKUP_FRAGMENT_REQ, signal, 2); 04536 } 04537 }//for 04538 04539 BackupFilePtr filePtr; 04540 for(ptr.p->files.first(filePtr); 04541 filePtr.i != RNIL; 04542 ptr.p->files.next(filePtr)) { 04543 jam(); 04544 ndbrequire(filePtr.p->fileOpened == 0); 04545 ndbrequire(filePtr.p->fileRunning == 0); 04546 ndbrequire(filePtr.p->scanRunning == 0); 04547 filePtr.p->pages.release(); 04548 }//for 04549 04550 ptr.p->files.release(); 04551 ptr.p->tables.release(); 04552 ptr.p->triggers.release(); 04553 ptr.p->backupId = ~0; 04554 04555 if(ptr.p->checkError()) 04556 removeBackup(signal, ptr); 04557 else 04558 c_backups.release(ptr); 04559 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::closeFiles | ( | Signal * | , | |
| BackupRecordPtr | ptr | |||
| ) |
Definition at line 4195 of file Backup.cpp.
References checkFile(), closeFilesDone(), FsCloseReq::fileFlag, FsCloseReq::filePointer, GSN_FSCLOSEREQ, Ptr< T >::i, jam, JBA, NDBFS_REF, ndbout_c(), Ptr< T >::p, SimulatedBlock::reference(), RNIL, SimulatedBlock::sendSignal(), sig(), FsCloseReq::userPointer, and FsCloseReq::userReference.
Referenced by execCONTINUEB().
04196 { 04200 BackupFilePtr filePtr; 04201 int openCount = 0; 04202 for(ptr.p->files.first(filePtr); filePtr.i!=RNIL; ptr.p->files.next(filePtr)) 04203 { 04204 if(filePtr.p->fileOpened == 0) { 04205 jam(); 04206 continue; 04207 } 04208 04209 jam(); 04210 openCount++; 04211 04212 if(filePtr.p->fileClosing == 1){ 04213 jam(); 04214 continue; 04215 }//if 04216 04217 if(filePtr.p->fileRunning == 1){ 04218 jam(); 04219 #ifdef DEBUG_ABORT 04220 ndbout_c("Close files fileRunning == 1, filePtr.i=%u", filePtr.i); 04221 #endif 04222 filePtr.p->operation.dataBuffer.eof(); 04223 } else { 04224 jam(); 04225 filePtr.p->fileClosing = 1; 04226 filePtr.p->operation.dataBuffer.eof(); 04227 checkFile(sig, filePtr); // make sure we write everything before closing 04228 04229 FsCloseReq * req = (FsCloseReq *)sig->getDataPtrSend(); 04230 req->filePointer = filePtr.p->filePointer; 04231 req->userPointer = filePtr.i; 04232 req->userReference = reference(); 04233 req->fileFlag = 0; 04234 #ifdef DEBUG_ABORT 04235 ndbout_c("***** b FSCLOSEREQ filePtr.i = %u", filePtr.i); 04236 #endif 04237 sendSignal(NDBFS_REF, GSN_FSCLOSEREQ, sig, 04238 FsCloseReq::SignalLength, JBA); 04239 }//if 04240 }//for 04241 04242 if(openCount == 0){ 04243 jam(); 04244 closeFilesDone(sig, ptr); 04245 }//if 04246 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::closeFilesDone | ( | Signal * | , | |
| BackupRecordPtr | ptr | |||
| ) |
Definition at line 4309 of file Backup.cpp.
References StopBackupConf::backupId, StopBackupConf::backupPtr, CLEANING, Signal::getDataPtrSend(), GSN_STOP_BACKUP_CONF, Ptr< T >::i, jam, JBB, lcp_close_file_conf(), StopBackupConf::noOfLogBytes, StopBackupConf::noOfLogRecords, Ptr< T >::p, and SimulatedBlock::sendSignal().
Referenced by closeFiles(), and execFSCLOSECONF().
04310 { 04311 jam(); 04312 04313 if(ptr.p->is_lcp()) 04314 { 04315 lcp_close_file_conf(signal, ptr); 04316 return; 04317 } 04318 04319 jam(); 04320 BackupFilePtr filePtr; 04321 ptr.p->files.getPtr(filePtr, ptr.p->logFilePtr); 04322 04323 StopBackupConf* conf = (StopBackupConf*)signal->getDataPtrSend(); 04324 conf->backupId = ptr.p->backupId; 04325 conf->backupPtr = ptr.i; 04326 conf->noOfLogBytes = filePtr.p->operation.noOfBytes; 04327 conf->noOfLogRecords = filePtr.p->operation.noOfRecords; 04328 sendSignal(ptr.p->masterRef, GSN_STOP_BACKUP_CONF, signal, 04329 StopBackupConf::SignalLength, JBB); 04330 04331 ptr.p->m_gsn = GSN_STOP_BACKUP_CONF; 04332 ptr.p->slaveState.setState(CLEANING); 04333 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1314 of file Backup.cpp.
References Backup::Table::attributes, Backup::Attribute::Data::attrId, Backup::Attribute::data, Ptr< T >::isNull(), jam, mask, and Ptr< T >::p.
Referenced by sendCreateTrig().
01316 { 01317 mask.clear(); 01318 Table & table = * tabPtr.p; 01319 Ptr<Attribute> attrPtr; 01320 table.attributes.first(attrPtr); 01321 for(; !attrPtr.isNull(); table.attributes.next(attrPtr)) 01322 { 01323 jam(); 01324 mask.set(attrPtr.p->data.attrId); 01325 } 01326 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::createSequence | ( | Signal * | signal | ) |
Definition at line 152 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().
00153 { 00154 UtilSequenceReq * req = (UtilSequenceReq*)signal->getDataPtrSend(); 00155 00156 req->senderData = RNIL; 00157 req->sequenceId = BACKUP_SEQUENCE; 00158 req->requestType = UtilSequenceReq::Create; 00159 00160 sendSignal(DBUTIL_REF, GSN_UTIL_SEQUENCE_REQ, 00161 signal, UtilSequenceReq::SignalLength, JBB); 00162 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::createSequenceReply | ( | Signal * | , | |
| class UtilSequenceConf * | ||||
| ) |
| void Backup::createTrigReply | ( | Signal * | signal, | |
| BackupRecordPtr | ptr | |||
| ) |
Definition at line 1461 of file Backup.cpp.
References StartBackupConf::backupId, StartBackupRef::backupId, StartBackupConf::backupPtr, StartBackupRef::backupPtr, CRASH_INSERTION, ERROR_INSERTED, StartBackupRef::errorCode, findTable(), Signal::getDataPtrSend(), SimulatedBlock::getOwnNodeId(), GSN_START_BACKUP_CONF, GSN_START_BACKUP_REF, Ptr< T >::i, jam, JBB, ndbrequire, StartBackupRef::nodeId, Ptr< T >::p, RNIL, sendCreateTrig(), and SimulatedBlock::sendSignal().
Referenced by execCREATE_TRIG_CONF(), and execCREATE_TRIG_REF().
01462 { 01463 CRASH_INSERTION(10003); 01464 01468 ptr.p->slaveData.trigSendCounter--; 01469 if(ptr.p->slaveData.trigSendCounter.done() == false){ 01470 jam(); 01471 return; 01472 }//if 01473 01474 if (ERROR_INSERTED(10025)) 01475 { 01476 ptr.p->errorCode = 325; 01477 } 01478 01479 if(ptr.p->checkError()) { 01480 jam(); 01481 ptr.p->m_gsn = GSN_START_BACKUP_REF; 01482 StartBackupRef* ref = (StartBackupRef*)signal->getDataPtrSend(); 01483 ref->backupPtr = ptr.i; 01484 ref->backupId = ptr.p->backupId; 01485 ref->errorCode = ptr.p->errorCode; 01486 ref->nodeId = getOwnNodeId(); 01487 sendSignal(ptr.p->masterRef, GSN_START_BACKUP_REF, signal, 01488 StartBackupRef::SignalLength, JBB); 01489 return; 01490 }//if 01491 01492 TablePtr tabPtr; 01493 ndbrequire(findTable(ptr, tabPtr, ptr.p->slaveData.createTrig.tableId)); 01494 01498 ptr.p->tables.next(tabPtr); 01499 if(tabPtr.i != RNIL){ 01500 jam(); 01501 sendCreateTrig(signal, ptr, tabPtr); 01502 return; 01503 }//if 01504 01510 ptr.p->m_gsn = GSN_START_BACKUP_CONF; 01511 StartBackupConf* conf = (StartBackupConf*)signal->getDataPtrSend(); 01512 conf->backupPtr = ptr.i; 01513 conf->backupId = ptr.p->backupId; 01514 sendSignal(ptr.p->masterRef, GSN_START_BACKUP_CONF, signal, 01515 StartBackupConf::SignalLength, JBB); 01516 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1088 of file Backup.cpp.
References c_backupPool, SimulatedBlock::c_mutexMgr, dictCommitTableMutex_locked(), GSN_UTIL_LOCK_REQ, Ptr< T >::i, jamEntry, mutex, ndbrequire, and Ptr< T >::p.
Referenced by execUTIL_SEQUENCE_CONF().
01088 { 01089 jamEntry(); 01090 ndbrequire(retVal == 0); 01091 01092 BackupRecordPtr ptr; 01093 ptr.i = ptrI; 01094 c_backupPool.getPtr(ptr); 01095 01096 ndbrequire(ptr.p->masterData.gsn == GSN_UTIL_LOCK_REQ); 01097 01098 ptr.p->masterData.gsn = GSN_UTIL_LOCK_REQ; 01099 Mutex mutex(signal, c_mutexMgr, ptr.p->masterData.m_dictCommitTableMutex); 01100 Callback c = { safe_cast(&Backup::dictCommitTableMutex_locked), ptr.i }; 01101 ndbrequire(mutex.lock(c)); 01102 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::defineBackupRef | ( | Signal * | , | |
| BackupRecordPtr | , | |||
| Uint32 | errCode = 0 | |||
| ) |
Definition at line 2301 of file Backup.cpp.
References DefineBackupRef::backupId, DefineBackupRef::backupPtr, DefineBackupRef::errorCode, LcpPrepareRef::errorCode, LcpPrepareRef::fragmentId, Signal::getDataPtrSend(), SimulatedBlock::getOwnNodeId(), GSN_DEFINE_BACKUP_REF, GSN_LCP_PREPARE_REF, Ptr< T >::i, jam, JBB, ndbrequire, DefineBackupRef::nodeId, Ptr< T >::p, SimulatedBlock::reference(), LcpPrepareRef::senderData, LcpPrepareRef::senderRef, SimulatedBlock::sendSignal(), and LcpPrepareRef::tableId.
Referenced by execDEFINE_BACKUP_REQ(), execGET_TABINFO_CONF(), execGET_TABINFOREF(), execLCP_PREPARE_REQ(), execLIST_TABLES_CONF(), and openFilesReply().
02302 { 02303 if(ptr.p->is_lcp()) 02304 { 02305 jam(); 02306 TablePtr tabPtr; 02307 FragmentPtr fragPtr; 02308 02309 ptr.p->setErrorCode(errCode); 02310 ndbrequire(ptr.p->tables.first(tabPtr)); 02311 tabPtr.p->fragments.getPtr(fragPtr, 0); 02312 02313 LcpPrepareRef* ref= (LcpPrepareRef*)signal->getDataPtrSend(); 02314 ref->senderData = ptr.p->clientData; 02315 ref->senderRef = reference(); 02316 ref->tableId = tabPtr.p->tableId; 02317 ref->fragmentId = fragPtr.p->fragmentId; 02318 ref->errorCode = errCode; 02319 sendSignal(ptr.p->masterRef, GSN_LCP_PREPARE_REF, 02320 signal, LcpPrepareRef::SignalLength, JBB); 02321 return; 02322 } 02323 02324 ptr.p->m_gsn = GSN_DEFINE_BACKUP_REF; 02325 ptr.p->setErrorCode(errCode); 02326 ndbrequire(ptr.p->errorCode != 0); 02327 02328 DefineBackupRef* ref = (DefineBackupRef*)signal->getDataPtrSend(); 02329 ref->backupId = ptr.p->backupId; 02330 ref->backupPtr = ptr.i; 02331 ref->errorCode = ptr.p->errorCode; 02332 ref->nodeId = getOwnNodeId(); 02333 sendSignal(ptr.p->masterRef, GSN_DEFINE_BACKUP_REF, signal, 02334 DefineBackupRef::SignalLength, JBB); 02335 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::defineBackupReply | ( | Signal * | signal, | |
| BackupRecordPtr | ptr, | |||
| Uint32 | nodeId | |||
| ) |
Definition at line 1247 of file Backup.cpp.
References BackupConf::backupId, SimulatedBlock::c_mutexMgr, CMVMI_REF, CRASH_INSERTION, Signal::getDataPtrSend(), GSN_BACKUP_CONF, GSN_DEFINE_BACKUP_REQ, GSN_EVENT_REP, haveAllSignals(), jam, JBB, masterAbort(), NDB_LE_BackupStarted, BackupConf::nodes, Ptr< T >::p, SEND_BACKUP_STARTED_FLAG, BackupConf::senderData, SimulatedBlock::sendSignal(), sendStartBackup(), Signal::theData, and Mutex::unlock().
Referenced by execDEFINE_BACKUP_CONF(), and execDEFINE_BACKUP_REF().
01248 { 01249 if (!haveAllSignals(ptr, GSN_DEFINE_BACKUP_REQ, nodeId)) { 01250 jam(); 01251 return; 01252 } 01253 01257 jam(); 01258 Mutex mutex1(signal, c_mutexMgr, ptr.p->masterData.m_dictCommitTableMutex); 01259 jam(); 01260 mutex1.unlock(); // ignore response 01261 01262 jam(); 01263 Mutex mutex2(signal, c_mutexMgr, ptr.p->masterData.m_defineBackupMutex); 01264 jam(); 01265 mutex2.unlock(); // ignore response 01266 01267 if(ptr.p->checkError()) 01268 { 01269 jam(); 01270 masterAbort(signal, ptr); 01271 return; 01272 } 01273 01277 CRASH_INSERTION((10034)); 01278 01279 if (SEND_BACKUP_STARTED_FLAG(ptr.p->flags)) 01280 { 01281 BackupConf * conf = (BackupConf*)signal->getDataPtrSend(); 01282 conf->backupId = ptr.p->backupId; 01283 conf->senderData = ptr.p->clientData; 01284 conf->nodes = ptr.p->nodes; 01285 sendSignal(ptr.p->clientRef, GSN_BACKUP_CONF, signal, 01286 BackupConf::SignalLength, JBB); 01287 } 01288 01289 signal->theData[0] = NDB_LE_BackupStarted; 01290 signal->theData[1] = ptr.p->clientRef; 01291 signal->theData[2] = ptr.p->backupId; 01292 ptr.p->nodes.copyto(NdbNodeBitmask::Size, signal->theData+3); 01293 sendSignal(CMVMI_REF, GSN_EVENT_REP, signal, 3+NdbNodeBitmask::Size, JBB); 01294 01302 TablePtr tabPtr; 01303 ptr.p->tables.first(tabPtr); 01304 01305 sendStartBackup(signal, ptr, tabPtr); 01306 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1105 of file Backup.cpp.
References c_backupPool, SimulatedBlock::c_mutexMgr, ERROR_INSERTED, GSN_UTIL_LOCK_REQ, Ptr< T >::i, jam, jamEntry, ndbrequire, Ptr< T >::p, sendBackupRef(), sendDefineBackupReq(), and Mutex::unlock().
Referenced by defineBackupMutex_locked().
01106 { 01107 jamEntry(); 01108 ndbrequire(retVal == 0); 01109 01113 BackupRecordPtr ptr; 01114 ptr.i = ptrI; 01115 c_backupPool.getPtr(ptr); 01116 01117 ndbrequire(ptr.p->masterData.gsn == GSN_UTIL_LOCK_REQ); 01118 01119 if (ERROR_INSERTED(10031)) { 01120 ptr.p->setErrorCode(331); 01121 }//if 01122 01123 if (ptr.p->checkError()) 01124 { 01125 jam(); 01126 01130 jam(); 01131 Mutex mutex1(signal, c_mutexMgr, ptr.p->masterData.m_dictCommitTableMutex); 01132 jam(); 01133 mutex1.unlock(); // ignore response 01134 01135 jam(); 01136 Mutex mutex2(signal, c_mutexMgr, ptr.p->masterData.m_defineBackupMutex); 01137 jam(); 01138 mutex2.unlock(); // ignore response 01139 01140 sendBackupRef(signal, ptr, ptr.p->errorCode); 01141 return; 01142 }//if 01143 01144 sendDefineBackupReq(signal, ptr); 01145 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::dropTrigReply | ( | Signal * | , | |
| BackupRecordPtr | ptr | |||
| ) |
Definition at line 2064 of file Backup.cpp.
References CRASH_INSERTION, GSN_DROP_TRIG_REQ, jam, ndbrequire, Ptr< T >::p, and sendDropTrig().
Referenced by execDROP_TRIG_CONF(), and execDROP_TRIG_REF().
02065 { 02066 CRASH_INSERTION((10012)); 02067 02068 ndbrequire(ptr.p->slaveData.gsn == GSN_DROP_TRIG_REQ); 02069 ndbrequire(ptr.p->slaveData.trigSendCounter.done() == false); 02070 02071 // move from .masterData to .slaveData 02072 ptr.p->slaveData.trigSendCounter--; 02073 if(ptr.p->slaveData.trigSendCounter.done() == false){ 02074 jam(); 02075 return; 02076 }//if 02077 02078 sendDropTrig(signal, ptr); // recursive next 02079 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::dumpUsedResources | ( | ) |
Definition at line 4466 of file Backup.cpp.
References c_backups, c_triggerPool, Ptr< T >::i, jam, ndbout_c(), Ptr< T >::p, and RNIL.
Referenced by execABORT_BACKUP_ORD(), execBACKUP_REQ(), and execDEFINE_BACKUP_REQ().
04467 { 04468 jam(); 04469 BackupRecordPtr ptr; 04470 04471 for(c_backups.first(ptr); ptr.i != RNIL; c_backups.next(ptr)) { 04472 ndbout_c("Backup id=%u, slaveState.getState = %u, errorCode=%u", 04473 ptr.p->backupId, 04474 ptr.p->slaveState.getState(), 04475 ptr.p->errorCode); 04476 04477 TablePtr tabPtr; 04478 for(ptr.p->tables.first(tabPtr); 04479 tabPtr.i != RNIL; 04480 ptr.p->tables.next(tabPtr)) { 04481 jam(); 04482 for(Uint32 j = 0; j<3; j++) { 04483 jam(); 04484 TriggerPtr trigPtr; 04485 if(tabPtr.p->triggerAllocated[j]) { 04486 jam(); 04487 c_triggerPool.getPtr(trigPtr, tabPtr.p->triggerIds[j]); 04488 ndbout_c("Allocated[%u] Triggerid = %u, event = %u", 04489 j, 04490 tabPtr.p->triggerIds[j], 04491 trigPtr.p->event); 04492 }//if 04493 }//for 04494 }//for 04495 04496 BackupFilePtr filePtr; 04497 for(ptr.p->files.first(filePtr); 04498 filePtr.i != RNIL; 04499 ptr.p->files.next(filePtr)) { 04500 jam(); 04501 ndbout_c("filePtr.i = %u, filePtr.p->fileOpened=%u fileRunning=%u " 04502 "scanRunning=%u", 04503 filePtr.i, 04504 filePtr.p->fileOpened, 04505 filePtr.p->fileRunning, 04506 filePtr.p->scanRunning); 04507 }//for 04508 } 04509 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::execABORT_BACKUP_ORD | ( | Signal * | signal | ) | [protected] |
Definition at line 4346 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, dumpUsedResources(), AbortBackupOrd::FileOrScanError, Signal::getDataPtr(), getMasterNodeId(), SimulatedBlock::getOwnNodeId(), Signal::getSendersBlockRef(), GSN_ABORT_BACKUP_ORD, GSN_BACKUP_FRAGMENT_REQ, Ptr< T >::i, AbortBackupOrd::IncompatibleVersions, jam, jamEntry, JBB, AbortBackupOrd::LogBufferFull, ndbout_c(), ndbrequire, ok(), AbortBackupOrd::OkToClean, Ptr< T >::p, SimulatedBlock::reference(), refToNode(), AbortBackupOrd::requestType, RNIL, AbortBackupOrd::senderData, SimulatedBlock::sendSignal(), and sendStopBackup().
Referenced by Backup(), and execBACKUP_FRAGMENT_REF().
04347 { 04348 jamEntry(); 04349 AbortBackupOrd* ord = (AbortBackupOrd*)signal->getDataPtr(); 04350 04351 const Uint32 backupId = ord->backupId; 04352 const AbortBackupOrd::RequestType requestType = 04353 (AbortBackupOrd::RequestType)ord->requestType; 04354 const Uint32 senderData = ord->senderData; 04355 04356 #ifdef DEBUG_ABORT 04357 ndbout_c("******** ABORT_BACKUP_ORD ********* nodeId = %u", 04358 refToNode(signal->getSendersBlockRef())); 04359 ndbout_c("backupId = %u, requestType = %u, senderData = %u, ", 04360 backupId, requestType, senderData); 04361 dumpUsedResources(); 04362 #endif 04363 04364 BackupRecordPtr ptr; 04365 if(requestType == AbortBackupOrd::ClientAbort) { 04366 if (getOwnNodeId() != getMasterNodeId()) { 04367 jam(); 04368 // forward to master 04369 #ifdef DEBUG_ABORT 04370 ndbout_c("---- Forward to master nodeId = %u", getMasterNodeId()); 04371 #endif 04372 sendSignal(calcBackupBlockRef(getMasterNodeId()), GSN_ABORT_BACKUP_ORD, 04373 signal, AbortBackupOrd::SignalLength, JBB); 04374 return; 04375 } 04376 jam(); 04377 for(c_backups.first(ptr); ptr.i != RNIL; c_backups.next(ptr)) { 04378 jam(); 04379 if(ptr.p->backupId == backupId && ptr.p->clientData == senderData) { 04380 jam(); 04381 break; 04382 }//if 04383 }//for 04384 if(ptr.i == RNIL) { 04385 jam(); 04386 return; 04387 }//if 04388 } else { 04389 if (c_backupPool.findId(senderData)) { 04390 jam(); 04391 c_backupPool.getPtr(ptr, senderData); 04392 } else { 04393 jam(); 04394 #ifdef DEBUG_ABORT 04395 ndbout_c("Backup: abort request type=%u on id=%u,%u not found", 04396 requestType, backupId, senderData); 04397 #endif 04398 return; 04399 } 04400 }//if 04401 04402 ptr.p->m_gsn = GSN_ABORT_BACKUP_ORD; 04403 const bool isCoordinator = (ptr.p->masterRef == reference()); 04404 04405 bool ok = false; 04406 switch(requestType){ 04407 04411 case AbortBackupOrd::ClientAbort: 04412 jam(); 04413 // fall through 04414 case AbortBackupOrd::LogBufferFull: 04415 jam(); 04416 // fall through 04417 case AbortBackupOrd::FileOrScanError: 04418 jam(); 04419 ndbrequire(isCoordinator); 04420 ptr.p->setErrorCode(requestType); 04421 if(ptr.p->masterData.gsn == GSN_BACKUP_FRAGMENT_REQ) 04422 { 04426 abort_scan(signal, ptr); 04427 } 04428 return; 04429 04433 case AbortBackupOrd::AbortScan: 04434 jam(); 04435 ptr.p->setErrorCode(requestType); 04436 return; 04437 04438 case AbortBackupOrd::BackupComplete: 04439 jam(); 04440 cleanup(signal, ptr); 04441 return; 04442 case AbortBackupOrd::BackupFailure: 04443 case AbortBackupOrd::BackupFailureDueToNodeFail: 04444 case AbortBackupOrd::OkToClean: 04445 case AbortBackupOrd::IncompatibleVersions: 04446 #ifndef VM_TRACE 04447 default: 04448 #endif 04449 ptr.p->setErrorCode(requestType); 04450 ok= true; 04451 } 04452 ndbrequire(ok); 04453 04454 Uint32 ref= ptr.p->masterRef; 04455 ptr.p->masterRef = reference(); 04456 ptr.p->nodes.clear(); 04457 ptr.p->nodes.set(getOwnNodeId()); 04458 04459 04460 ptr.p->stopGCP= ptr.p->startGCP + 1; 04461 sendStopBackup(signal, ptr); 04462 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::execABORT_BACKUP_REQ | ( | Signal * | signal | ) | [protected] |
| void Backup::execBACKUP_ABORT_REP | ( | Signal * | signal | ) | [protected] |
Definition at line 550 of file Backup.cpp.
References BackupAbortRep::backupId, Signal::getDataPtr(), jamEntry, ndbout_c(), and BackupAbortRep::reason.
Referenced by Backup().
00551 { 00552 jamEntry(); 00553 BackupAbortRep* rep = (BackupAbortRep*)signal->getDataPtr(); 00554 00555 ndbout_c("Backup %d has been aborted %d", rep->backupId, rep->reason); 00556 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::execBACKUP_COMPLETE_REP | ( | Signal * | signal | ) | [protected] |
Definition at line 516 of file Backup.cpp.
References BackupCompleteRep::backupId, Signal::getDataPtr(), jamEntry, ndbout(), ndbout_c(), NdbTick_CurrentMillisecond(), BackupCompleteRep::noOfBytesHigh, BackupCompleteRep::noOfBytesLow, BackupCompleteRep::noOfLogBytes, BackupCompleteRep::noOfLogRecords, BackupCompleteRep::noOfRecordsHigh, BackupCompleteRep::noOfRecordsLow, yaSSL::Number, records, startTime, and xps().
Referenced by Backup().
00517 { 00518 jamEntry(); 00519 BackupCompleteRep* rep = (BackupCompleteRep*)signal->getDataPtr(); 00520 00521 startTime = NdbTick_CurrentMillisecond() - startTime; 00522 00523 ndbout_c("Backup %d has completed", rep->backupId); 00524 const Uint64 bytes = 00525 rep->noOfBytesLow + (((Uint64)rep->noOfBytesHigh) << 32); 00526 const Uint64 records = 00527 rep->noOfRecordsLow + (((Uint64)rep->noOfRecordsHigh) << 32); 00528 00529 Number rps = xps(records, startTime); 00530 Number bps = xps(bytes, startTime); 00531 00532 ndbout << " Data [ " 00533 << Number(records) << " rows " 00534 << Number(bytes) << " bytes " << startTime << " ms ] " 00535 << " => " 00536 << rps << " row/s & " << bps << "b/s" << endl; 00537 00538 bps = xps(rep->noOfLogBytes, startTime); 00539 rps = xps(rep->noOfLogRecords, startTime); 00540 00541 ndbout << " Log [ " 00542 << Number(rep->noOfLogRecords) << " log records " 00543 << Number(rep->noOfLogBytes) << " bytes " << startTime << " ms ] " 00544 << " => " 00545 << rps << " records/s & " << bps << "b/s" << endl; 00546 00547 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::execBACKUP_CONF | ( | Signal * | signal | ) | [protected] |
Definition at line 498 of file Backup.cpp.
References BackupConf::backupId, Signal::getDataPtr(), jamEntry, and ndbout_c().
Referenced by Backup().
00499 { 00500 jamEntry(); 00501 BackupConf * conf = (BackupConf*)signal->getDataPtr(); 00502 00503 ndbout_c("Backup %d has started", conf->backupId); 00504 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::execBACKUP_DATA | ( | Signal * | signal | ) | [protected] |
| void Backup::execBACKUP_FRAGMENT_COMPLETE_REP | ( | Signal * | signal | ) | [protected] |
Definition at line 1912 of file Backup.cpp.
References BackupFragmentCompleteRep::backupPtr, c_backupPool, findTable(), BackupFragmentCompleteRep::fragmentNo, Signal::getDataPtr(), jamEntry, ndbrequire, BackupFragmentCompleteRep::noOfFragmentRowsHigh, BackupFragmentCompleteRep::noOfFragmentRowsLow, BackupFragmentCompleteRep::noOfTableRowsHigh, BackupFragmentCompleteRep::noOfTableRowsLow, Ptr< T >::p, and BackupFragmentCompleteRep::tableId.
Referenced by Backup().
01913 { 01914 jamEntry(); 01915 BackupFragmentCompleteRep * rep = 01916 (BackupFragmentCompleteRep*)signal->getDataPtr(); 01917 01918 BackupRecordPtr ptr; 01919 c_backupPool.getPtr(ptr, rep->backupPtr); 01920 01921 TablePtr tabPtr; 01922 ndbrequire(findTable(ptr, tabPtr, rep->tableId)); 01923 01924 tabPtr.p->noOfRecords = 01925 rep->noOfTableRowsLow + (((Uint64)rep->noOfTableRowsHigh) << 32); 01926 01927 FragmentPtr fragPtr; 01928 tabPtr.p->fragments.getPtr(fragPtr, rep->fragmentNo); 01929 01930 fragPtr.p->noOfRecords = 01931 rep->noOfFragmentRowsLow + (((Uint64)rep->noOfFragmentRowsHigh) << 32); 01932 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::execBACKUP_FRAGMENT_CONF | ( | Signal * | signal | ) | [protected] |
Definition at line 1774 of file Backup.cpp.
References BACKUP, BackupFragmentConf::backupPtr, c_backupPool, BitmaskPOD< size >::clear(), CRASH_INSERTION, ERROR_INSERTED, findTable(), BackupFragmentConf::fragmentNo, Signal::getDataPtr(), Signal::getDataPtrSend(), SimulatedBlock::getOwnNodeId(), GSN_BACKUP_FRAGMENT_COMPLETE_REP, Ptr< T >::i, BitmaskPOD< size >::isclear(), jam, jamEntry, JBB, masterAbort(), ndbrequire, nextFragment(), BackupFragmentConf::noOfBytesHigh, BackupFragmentConf::noOfBytesLow, BackupFragmentConf::noOfRecordsHigh, BackupFragmentConf::noOfRecordsLow, Ptr< T >::p, refToNode(), Signal::senderBlockRef(), SimulatedBlock::sendSignal(), and BackupFragmentConf::tableId.
Referenced by Backup().
01775 { 01776 jamEntry(); 01777 01778 CRASH_INSERTION((10010)); 01779 01780 BackupFragmentConf * conf = (BackupFragmentConf*)signal->getDataPtr(); 01781 const Uint32 ptrI = conf->backupPtr; 01782 //const Uint32 backupId = conf->backupId; 01783 const Uint32 tableId = conf->tableId; 01784 const Uint32 fragmentNo = conf->fragmentNo; 01785 const Uint32 nodeId = refToNode(signal->senderBlockRef()); 01786 const Uint64 noOfBytes = 01787 conf->noOfBytesLow + (((Uint64)conf->noOfBytesHigh) << 32); 01788 const Uint64 noOfRecords = 01789 conf->noOfRecordsLow + (((Uint64)conf->noOfRecordsHigh) << 32); 01790 01791 BackupRecordPtr ptr; 01792 c_backupPool.getPtr(ptr, ptrI); 01793 01794 ptr.p->noOfBytes += noOfBytes; 01795 ptr.p->noOfRecords += noOfRecords; 01796 ptr.p->masterData.sendCounter--; 01797 01798 TablePtr tabPtr; 01799 ndbrequire(findTable(ptr, tabPtr, tableId)); 01800 01801 tabPtr.p->noOfRecords += noOfRecords; 01802 01803 FragmentPtr fragPtr; 01804 tabPtr.p->fragments.getPtr(fragPtr, fragmentNo); 01805 01806 fragPtr.p->noOfRecords = noOfRecords; 01807 01808 ndbrequire(fragPtr.p->scanned == 0); 01809 ndbrequire(fragPtr.p->scanning == 1); 01810 ndbrequire(fragPtr.p->node == nodeId); 01811 01812 fragPtr.p->scanned = 1; 01813 fragPtr.p->scanning = 0; 01814 01815 if (ERROR_INSERTED(10028)) 01816 { 01817 ptr.p->errorCode = 328; 01818 } 01819 01820 if(ptr.p->checkError()) 01821 { 01822 if(ptr.p->masterData.sendCounter.done()) 01823 { 01824 jam(); 01825 masterAbort(signal, ptr); 01826 return; 01827 }//if 01828 } 01829 else 01830 { 01831 NodeBitmask nodes = ptr.p->nodes; 01832 nodes.clear(getOwnNodeId()); 01833 if (!nodes.isclear()) 01834 { 01835 BackupFragmentCompleteRep *rep = 01836 (BackupFragmentCompleteRep*)signal->getDataPtrSend(); 01837 rep->backupId = ptr.p->backupId; 01838 rep->backupPtr = ptr.i; 01839 rep->tableId = tableId; 01840 rep->fragmentNo = fragmentNo; 01841 rep->noOfTableRowsLow = (Uint32)(tabPtr.p->noOfRecords & 0xFFFFFFFF); 01842 rep->noOfTableRowsHigh = (Uint32)(tabPtr.p->noOfRecords >> 32); 01843 rep->noOfFragmentRowsLow = (Uint32)(noOfRecords & 0xFFFFFFFF); 01844 rep->noOfFragmentRowsHigh = (Uint32)(noOfRecords >> 32); 01845 NodeReceiverGroup rg(BACKUP, ptr.p->nodes); 01846 sendSignal(rg, GSN_BACKUP_FRAGMENT_COMPLETE_REP, signal, 01847 BackupFragmentCompleteRep::SignalLength, JBB); 01848 } 01849 nextFragment(signal, ptr); 01850 } 01851 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::execBACKUP_FRAGMENT_REF | ( | Signal * | signal | ) | [protected] |
Definition at line 1854 of file Backup.cpp.
References AbortBackupOrd::backupId, AbortBackupOrd::backupPtr, BackupFragmentRef::backupPtr, c_backupPool, CRASH_INSERTION, err, BackupFragmentRef::errorCode, execABORT_BACKUP_ORD(), Signal::getDataPtr(), Signal::getDataPtrSend(), 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().
01855 { 01856 jamEntry(); 01857 01858 CRASH_INSERTION((10011)); 01859 01860 BackupFragmentRef * ref = (BackupFragmentRef*)signal->getDataPtr(); 01861 const Uint32 ptrI = ref->backupPtr; 01862 //const Uint32 backupId = ref->backupId; 01863 const Uint32 nodeId = ref->nodeId; 01864 01865 BackupRecordPtr ptr; 01866 c_backupPool.getPtr(ptr, ptrI); 01867 01868 TablePtr tabPtr; 01869 ptr.p->tables.first(tabPtr); 01870 for(; tabPtr.i != RNIL; ptr.p->tables.next(tabPtr)) { 01871 jam(); 01872 FragmentPtr fragPtr; 01873 Array<Fragment> & frags = tabPtr.p->fragments; 01874 const Uint32 fragCount = frags.getSize(); 01875 01876 for(Uint32 i = 0; i<fragCount; i++) { 01877 jam(); 01878 tabPtr.p->fragments.getPtr(fragPtr, i); 01879 if(fragPtr.p->scanning != 0 && nodeId == fragPtr.p->node) 01880 { 01881 jam(); 01882 ndbrequire(fragPtr.p->scanned == 0); 01883 fragPtr.p->scanned = 1; 01884 fragPtr.p->scanning = 0; 01885 goto done; 01886 } 01887 } 01888 } 01889 goto err; 01890 01891 done: 01892 ptr.p->masterData.sendCounter--; 01893 ptr.p->setErrorCode(ref->errorCode); 01894 01895 if(ptr.p->masterData.sendCounter.done()) 01896 { 01897 jam(); 01898 masterAbort(signal, ptr); 01899 return; 01900 }//if 01901 01902 err: 01903 AbortBackupOrd *ord = (AbortBackupOrd*)signal->getDataPtrSend(); 01904 ord->backupId = ptr.p->backupId; 01905 ord->backupPtr = ptr.i; 01906 ord->requestType = AbortBackupOrd::LogBufferFull; 01907 ord->senderData= ptr.i; 01908 execABORT_BACKUP_ORD(signal); 01909 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::execBACKUP_FRAGMENT_REQ | ( | Signal * | signal | ) | [protected] |
Definition at line 3322 of file Backup.cpp.
References Backup::Table::attributes, Backup::Attribute::Data::attrId, BACKUP, BACKUP_REF, BackupFragmentReq::backupPtr, ScanFragReq::batch_size_bytes, ScanFragReq::batch_size_rows, c_backupFilePool, c_backupPool, ScanFragReq::clientOpPtr, Backup::Attribute::COL_DISK, BackupFragmentReq::count, count, CRASH_INSERTION, Backup::Attribute::data, DBLQH_REF, findTable(), BackupFragmentReq::fragmentNo, ScanFragReq::fragmentNoKeyLen, Signal::getDataPtr(), Signal::getDataPtrSend(), SimulatedBlock::getOwnNodeId(), GSN_ATTRINFO, GSN_BACKUP_FRAGMENT_REQ, GSN_SCAN_FRAGREQ, Ptr< T >::i, AttributeHeader::init(), Ptr< T >::isNull(), jam, jamEntry, JBB, Signal::length(), Backup::Attribute::Data::m_flags, 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::setLcpScanFlag(), ScanFragReq::setLockMode(), ScanFragReq::setNoDiskFlag(), ScanFragReq::setReadCommittedFlag(), ScanFragReq::setScanPrio(), ScanFragReq::setTupScanFlag(), STARTED, Backup::Table::tableId, ScanFragReq::tableId, BackupFragmentReq::tableId, Signal::theData, ScanFragReq::transId1, and ScanFragReq::transId2.
Referenced by Backup().
03323 { 03324 jamEntry(); 03325 BackupFragmentReq* req = (BackupFragmentReq*)signal->getDataPtr(); 03326 03327 CRASH_INSERTION((10016)); 03328 03329 const Uint32 ptrI = req->backupPtr; 03330 //const Uint32 backupId = req->backupId; 03331 const Uint32 tableId = req->tableId; 03332 const Uint32 fragNo = req->fragmentNo; 03333 const Uint32 count = req->count; 03334 03338 BackupRecordPtr ptr; 03339 c_backupPool.getPtr(ptr, ptrI); 03340 03341 ptr.p->slaveState.setState(SCANNING); 03342 ptr.p->m_gsn = GSN_BACKUP_FRAGMENT_REQ; 03343 03347 BackupFilePtr filePtr; 03348 c_backupFilePool.getPtr(filePtr, ptr.p->dataFilePtr); 03349 03350 ndbrequire(filePtr.p->backupPtr == ptrI); 03351 ndbrequire(filePtr.p->fileOpened == 1); 03352 ndbrequire(filePtr.p->fileRunning == 1); 03353 ndbrequire(filePtr.p->scanRunning == 0); 03354 ndbrequire(filePtr.p->fileClosing == 0); 03355 03359 TablePtr tabPtr; 03360 ndbrequire(findTable(ptr, tabPtr, tableId)); 03361 03365 FragmentPtr fragPtr; 03366 tabPtr.p->fragments.getPtr(fragPtr, fragNo); 03367 03368 ndbrequire(fragPtr.p->scanned == 0); 03369 ndbrequire(fragPtr.p->scanning == 0 || 03370 refToNode(ptr.p->masterRef) == getOwnNodeId()); 03371 03375 if(filePtr.p->tableId != tableId) { 03376 jam(); 03377 filePtr.p->operation.init(tabPtr); 03378 filePtr.p->tableId = tableId; 03379 }//if 03380 03384 if(!filePtr.p->operation.newFragment(tableId, fragPtr.p->fragmentId)) { 03385 jam(); 03386 req->count = count + 1; 03387 sendSignalWithDelay(BACKUP_REF, GSN_BACKUP_FRAGMENT_REQ, signal, 50, 03388 signal->length()); 03389 ptr.p->slaveState.setState(STARTED); 03390 return; 03391 }//if 03392 03396 fragPtr.p->scanning = 1; 03397 filePtr.p->fragmentNo = fragPtr.p->fragmentId; 03398 03402 { 03403 filePtr.p->scanRunning = 1; 03404 03405 Table & table = * tabPtr.p; 03406 ScanFragReq * req = (ScanFragReq *)signal->getDataPtrSend(); 03407 const Uint32 parallelism = 16; 03408 const Uint32 attrLen = 5 + table.noOfAttributes; 03409 03410 req->senderData = filePtr.i; 03411 req->resultRef = reference(); 03412 req->schemaVersion = table.schemaVersion; 03413 req->fragmentNoKeyLen = fragPtr.p->fragmentId; 03414 req->requestInfo = 0; 03415 req->savePointId = 0; 03416 req->tableId = table.tableId; 03417 ScanFragReq::setReadCommittedFlag(req->requestInfo, 1); 03418 ScanFragReq::setLockMode(req->requestInfo, 0); 03419 ScanFragReq::setHoldLockFlag(req->requestInfo, 0); 03420 ScanFragReq::setKeyinfoFlag(req->requestInfo, 0); 03421 ScanFragReq::setAttrLen(req->requestInfo,attrLen); 03422 if (ptr.p->is_lcp()) 03423 { 03424 ScanFragReq::setScanPrio(req->requestInfo, 1); 03425 ScanFragReq::setTupScanFlag(req->requestInfo, 1); 03426 ScanFragReq::setNoDiskFlag(req->requestInfo, 1); 03427 ScanFragReq::setLcpScanFlag(req->requestInfo, 1); 03428 } 03429 req->transId1 = 0; 03430 req->transId2 = (BACKUP << 20) + (getOwnNodeId() << 8); 03431 req->clientOpPtr= filePtr.i; 03432 req->batch_size_rows= parallelism; 03433 req->batch_size_bytes= 0; 03434 sendSignal(DBLQH_REF, GSN_SCAN_FRAGREQ, signal, 03435 ScanFragReq::SignalLength, JBB); 03436 03437 signal->theData[0] = filePtr.i; 03438 signal->theData[1] = 0; 03439 signal->theData[2] = (BACKUP << 20) + (getOwnNodeId() << 8); 03440 03441 // Return all 03442 signal->theData[3] = table.noOfAttributes; 03443 signal->theData[4] = 0; 03444 signal->theData[5] = 0; 03445 signal->theData[6] = 0; 03446 signal->theData[7] = 0; 03447 03448 Uint32 dataPos = 8; 03449 Ptr<Attribute> attrPtr; 03450 table.attributes.first(attrPtr); 03451 for(; !attrPtr.isNull(); table.attributes.next(attrPtr)) 03452 { 03453 jam(); 03454 03458 ndbrequire(! (ptr.p->is_lcp() && 03459 attrPtr.p->data.m_flags & Attribute::COL_DISK)); 03460 03461 AttributeHeader::init(&signal->theData[dataPos], 03462 attrPtr.p->data.attrId, 0); 03463 dataPos++; 03464 if(dataPos == 25) { 03465 jam(); 03466 sendSignal(DBLQH_REF, GSN_ATTRINFO, signal, 25, JBB); 03467 dataPos = 3; 03468 }//if 03469 }//for 03470 if(dataPos != 3) { 03471 jam(); 03472 sendSignal(DBLQH_REF, GSN_ATTRINFO, signal, dataPos, JBB); 03473 }//if 03474 } 03475 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::execBACKUP_REF | ( | Signal * | signal | ) | [protected] |
Testing
Definition at line 507 of file Backup.cpp.
References BackupRef::errorCode, Signal::getDataPtr(), jamEntry, ndbout_c(), and BackupRef::senderData.
Referenced by Backup().
00508 { 00509 jamEntry(); 00510 BackupRef * ref = (BackupRef*)signal->getDataPtr(); 00511 00512 ndbout_c("Backup (%d) has NOT started %d", ref->senderData, ref->errorCode); 00513 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::execBACKUP_REQ | ( | Signal * | signal | ) | [protected] |
Master functinallity
Seize a backup record
Definition at line 925 of file Backup.cpp.
References BACKUP_SEQUENCE, BackupReq::backupDataLen, BackupRef::BackupDefinitionNotImplemented, c_aliveNodes, c_backups, BackupRef::CannotBackupDiskless, DBUTIL_REF, dumpUsedResources(), BackupReq::flags, flags, Signal::getDataPtr(), Signal::getDataPtrSend(), Signal::getLength(), 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, sendBackupRef(), Signal::senderBlockRef(), UtilSequenceReq::senderData, BackupReq::senderData, SimulatedBlock::sendSignal(), and UtilSequenceReq::sequenceId.
Referenced by Backup().
00926 { 00927 jamEntry(); 00928 BackupReq * req = (BackupReq*)signal->getDataPtr(); 00929 00930 const Uint32 senderData = req->senderData; 00931 const BlockReference senderRef = signal->senderBlockRef(); 00932 const Uint32 dataLen32 = req->backupDataLen; // In 32 bit words 00933 const Uint32 flags = signal->getLength() > 2 ? req->flags : 2; 00934 00935 if(getOwnNodeId() != getMasterNodeId()) { 00936 jam(); 00937 sendBackupRef(senderRef, flags, signal, senderData, BackupRef::IAmNotMaster); 00938 return; 00939 }//if 00940 00941 if (m_diskless) 00942 { 00943 sendBackupRef(senderRef, flags, signal, senderData, 00944 BackupRef::CannotBackupDiskless); 00945 return; 00946 } 00947 00948 if(dataLen32 != 0) { 00949 jam(); 00950 sendBackupRef(senderRef, flags, signal, senderData, 00951 BackupRef::BackupDefinitionNotImplemented); 00952 return; 00953 }//if 00954 00955 #ifdef DEBUG_ABORT 00956 dumpUsedResources(); 00957 #endif 00958 00961 BackupRecordPtr ptr; 00962 c_backups.seize(ptr); 00963 if(ptr.i == RNIL) { 00964 jam(); 00965 sendBackupRef(senderRef, flags, signal, senderData, BackupRef::OutOfBackupRecord); 00966 return; 00967 }//if 00968 00969 ndbrequire(ptr.p->tables.isEmpty()); 00970 00971 ptr.p->m_gsn = 0; 00972 ptr.p->errorCode = 0; 00973 ptr.p->clientRef = senderRef; 00974 ptr.p->clientData = senderData; 00975 ptr.p->flags = flags; 00976 ptr.p->masterRef = reference(); 00977 ptr.p->nodes = c_aliveNodes; 00978 ptr.p->backupId = 0; 00979 ptr.p->backupKey[0] = 0; 00980 ptr.p->backupKey[1] = 0; 00981 ptr.p->backupDataLen = 0; 00982 ptr.p->masterData.errorCode = 0; 00983 00984 UtilSequenceReq * utilReq = (UtilSequenceReq*)signal->getDataPtrSend(); 00985 00986 ptr.p->masterData.gsn = GSN_UTIL_SEQUENCE_REQ; 00987 utilReq->senderData = ptr.i; 00988 utilReq->sequenceId = BACKUP_SEQUENCE; 00989 utilReq->requestType = UtilSequenceReq::NextVal; 00990 sendSignal(DBUTIL_REF, GSN_UTIL_SEQUENCE_REQ, 00991 signal, UtilSequenceReq::SignalLength, JBB); 00992 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::execBACKUP_STATUS_CONF | ( | Signal * | signal | ) | [protected] |
| void Backup::execBACKUP_STATUS_REQ | ( | Signal * | signal | ) | [protected] |
| void Backup::execBACKUP_TRIG_REQ | ( | Signal * | signal | ) | [protected] |
Trigger logging
Definition at line 3975 of file Backup.cpp.
References c_tablePool, c_triggerPool, SimulatedBlock::getOwnNodeId(), jam, jamEntry, Ptr< T >::p, Signal::theData, ZFALSE, and ZTRUE.
Referenced by Backup().
03976 { 03977 /* 03978 TUP asks if this trigger is to be fired on this node. 03979 */ 03980 TriggerPtr trigPtr; 03981 TablePtr tabPtr; 03982 FragmentPtr fragPtr; 03983 Uint32 trigger_id = signal->theData[0]; 03984 Uint32 frag_id = signal->theData[1]; 03985 Uint32 result; 03986 03987 jamEntry(); 03988 03989 c_triggerPool.getPtr(trigPtr, trigger_id); 03990 03991 c_tablePool.getPtr(tabPtr, trigPtr.p->tab_ptr_i); 03992 tabPtr.p->fragments.getPtr(fragPtr, frag_id); 03993 if (fragPtr.p->node != getOwnNodeId()) { 03994 03995 jam(); 03996 result = ZFALSE; 03997 } else { 03998 jam(); 03999 result = ZTRUE; 04000 }//if 04001 signal->theData[0] = result; 04002 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::execCONTINUEB | ( | Signal * | signal | ) | [protected] |
Definition at line 165 of file Backup.cpp.
References BackupContinueB::BACKUP_FRAGMENT_INFO, BACKUP_REF, buf, BackupContinueB::BUFFER_FULL_FRAG_COMPLETE, BackupContinueB::BUFFER_FULL_META, BackupContinueB::BUFFER_FULL_SCAN, BackupContinueB::BUFFER_UNDERFLOW, c_backupFilePool, c_backupPool, c_tablePool, checkFile(), checkScan(), closeFiles(), DBDICT, DBDICT_REF, DEBUG_OUT, SimulatedBlock::EXECUTE_DIRECT(), BackupFormat::CtlFile::FragmentInfo::FilePosHigh, BackupFormat::CtlFile::FragmentInfo::FilePosLow, BackupFormat::FRAGMENT_INFO, fragmentCompleted(), BackupFormat::CtlFile::FragmentInfo::FragmentNo, Signal::getDataPtrSend(), GSN_BACKUP_FRAGMENT_REQ, GSN_CONTINUEB, GSN_GET_TABINFOREQ, Ptr< T >::i, jam, jamEntry, JBB, GetTabInfoReq::LongSignalConf, ndbrequire, BackupFormat::CtlFile::FragmentInfo::NoOfRecordsHigh, BackupFormat::CtlFile::FragmentInfo::NoOfRecordsLow, Ptr< T >::p, SimulatedBlock::reference(), GetTabInfoReq::RequestById, GetTabInfoReq::requestType, RNIL, BackupFormat::CtlFile::FragmentInfo::SectionLength, BackupFormat::CtlFile::FragmentInfo::SectionType, GetTabInfoReq::senderData, GetTabInfoReq::senderRef, SimulatedBlock::sendSignal(), SimulatedBlock::sendSignalWithDelay(), BackupContinueB::START_FILE_THREAD, GetTabInfoReq::tableId, BackupFormat::CtlFile::FragmentInfo::TableId, and Signal::theData.
Referenced by Backup().
00166 { 00167 jamEntry(); 00168 const Uint32 Tdata0 = signal->theData[0]; 00169 const Uint32 Tdata1 = signal->theData[1]; 00170 const Uint32 Tdata2 = signal->theData[2]; 00171 00172 switch(Tdata0) { 00173 case BackupContinueB::BACKUP_FRAGMENT_INFO: 00174 { 00175 const Uint32 ptr_I = Tdata1; 00176 Uint32 tabPtr_I = Tdata2; 00177 Uint32 fragPtr_I = signal->theData[3]; 00178 00179 BackupRecordPtr ptr; 00180 c_backupPool.getPtr(ptr, ptr_I); 00181 TablePtr tabPtr; 00182 ptr.p->tables.getPtr(tabPtr, tabPtr_I); 00183 FragmentPtr fragPtr; 00184 tabPtr.p->fragments.getPtr(fragPtr, fragPtr_I); 00185 00186 BackupFilePtr filePtr; 00187 ptr.p->files.getPtr(filePtr, ptr.p->ctlFilePtr); 00188 00189 const Uint32 sz = sizeof(BackupFormat::CtlFile::FragmentInfo) >> 2; 00190 Uint32 * dst; 00191 if (!filePtr.p->operation.dataBuffer.getWritePtr(&dst, sz)) 00192 { 00193 sendSignalWithDelay(BACKUP_REF, GSN_CONTINUEB, signal, 100, 4); 00194 return; 00195 } 00196 00197 BackupFormat::CtlFile::FragmentInfo * fragInfo = 00198 (BackupFormat::CtlFile::FragmentInfo*)dst; 00199 fragInfo->SectionType = htonl(BackupFormat::FRAGMENT_INFO); 00200 fragInfo->SectionLength = htonl(sz); 00201 fragInfo->TableId = htonl(fragPtr.p->tableId); 00202 fragInfo->FragmentNo = htonl(fragPtr_I); 00203 fragInfo->NoOfRecordsLow = htonl(fragPtr.p->noOfRecords & 0xFFFFFFFF); 00204 fragInfo->NoOfRecordsHigh = htonl(fragPtr.p->noOfRecords >> 32); 00205 fragInfo->FilePosLow = htonl(0 & 0xFFFFFFFF); 00206 fragInfo->FilePosHigh = htonl(0 >> 32); 00207 00208 filePtr.p->operation.dataBuffer.updateWritePtr(sz); 00209 00210 fragPtr_I++; 00211 if (fragPtr_I == tabPtr.p->fragments.getSize()) 00212 { 00213 signal->theData[0] = tabPtr.p->tableId; 00214 signal->theData[1] = 0; // unlock 00215 EXECUTE_DIRECT(DBDICT, GSN_BACKUP_FRAGMENT_REQ, signal, 2); 00216 00217 fragPtr_I = 0; 00218 ptr.p->tables.next(tabPtr); 00219 if ((tabPtr_I = tabPtr.i) == RNIL) 00220 { 00221 closeFiles(signal, ptr); 00222 return; 00223 } 00224 } 00225 signal->theData[0] = BackupContinueB::BACKUP_FRAGMENT_INFO; 00226 signal->theData[1] = ptr_I; 00227 signal->theData[2] = tabPtr_I; 00228 signal->theData[3] = fragPtr_I; 00229 sendSignal(BACKUP_REF, GSN_CONTINUEB, signal, 4, JBB); 00230 return; 00231 } 00232 case BackupContinueB::START_FILE_THREAD: 00233 case BackupContinueB::BUFFER_UNDERFLOW: 00234 { 00235 jam(); 00236 BackupFilePtr filePtr; 00237 c_backupFilePool.getPtr(filePtr, Tdata1); 00238 checkFile(signal, filePtr); 00239 return; 00240 } 00241 break; 00242 case BackupContinueB::BUFFER_FULL_SCAN: 00243 { 00244 jam(); 00245 BackupFilePtr filePtr; 00246 c_backupFilePool.getPtr(filePtr, Tdata1); 00247 checkScan(signal, filePtr); 00248 return; 00249 } 00250 break; 00251 case BackupContinueB::BUFFER_FULL_FRAG_COMPLETE: 00252 { 00253 jam(); 00254 BackupFilePtr filePtr; 00255 c_backupFilePool.getPtr(filePtr, Tdata1); 00256 fragmentCompleted(signal, filePtr); 00257 return; 00258 } 00259 break; 00260 case BackupContinueB::BUFFER_FULL_META: 00261 { 00262 jam(); 00263 BackupRecordPtr ptr; 00264 c_backupPool.getPtr(ptr, Tdata1); 00265 00266 BackupFilePtr filePtr; 00267 ptr.p->files.getPtr(filePtr, ptr.p->ctlFilePtr); 00268 FsBuffer & buf = filePtr.p->operation.dataBuffer; 00269 00270 if(buf.getFreeSize() + buf.getMinRead() < buf.getUsableSize()) { 00271 jam(); 00272 TablePtr tabPtr; 00273 c_tablePool.getPtr(tabPtr, Tdata2); 00274 00275 DEBUG_OUT("Backup - Buffer full - " << buf.getFreeSize() 00276 << " + " << buf.getMinRead() 00277 << " < " << buf.getUsableSize() 00278 << " - tableId = " << tabPtr.p->tableId); 00279 00280 signal->theData[0] = BackupContinueB::BUFFER_FULL_META; 00281 signal->theData[1] = Tdata1; 00282 signal->theData[2] = Tdata2; 00283 sendSignalWithDelay(BACKUP_REF, GSN_CONTINUEB, signal, 100, 3); 00284 return; 00285 }//if 00286 00287 TablePtr tabPtr; 00288 c_tablePool.getPtr(tabPtr, Tdata2); 00289 GetTabInfoReq * req = (GetTabInfoReq *)signal->getDataPtrSend(); 00290 req->senderRef = reference(); 00291 req->senderData = ptr.i; 00292 req->requestType = GetTabInfoReq::RequestById | 00293 GetTabInfoReq::LongSignalConf; 00294 req->tableId = tabPtr.p->tableId; 00295 sendSignal(DBDICT_REF, GSN_GET_TABINFOREQ, signal, 00296 GetTabInfoReq::SignalLength, JBB); 00297 return; 00298 } 00299 default: 00300 ndbrequire(0); 00301 }//switch 00302 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::execCREATE_TRIG_CONF | ( | Signal * | signal | ) | [protected] |
Definition at line 1403 of file Backup.cpp.
References c_backupPool, createTrigReply(), findTable(), CreateTrigConf::getConnectionPtr(), Signal::getDataPtr(), CreateTrigConf::getTableId(), CreateTrigConf::getTriggerEvent(), CreateTrigConf::getTriggerId(), GSN_CREATE_TRIG_REQ, jamEntry, ndbrequire, and Ptr< T >::p.
Referenced by Backup().
01404 { 01405 jamEntry(); 01406 CreateTrigConf * conf = (CreateTrigConf*)signal->getDataPtr(); 01407 01408 const Uint32 ptrI = conf->getConnectionPtr(); 01409 const Uint32 tableId = conf->getTableId(); 01410 const TriggerEvent::Value type = conf->getTriggerEvent(); 01411 const Uint32 triggerId = conf->getTriggerId(); 01412 01413 BackupRecordPtr ptr; 01414 c_backupPool.getPtr(ptr, ptrI); 01415 01422 ndbrequire(ptr.p->slaveData.gsn == GSN_CREATE_TRIG_REQ); 01423 ndbrequire(ptr.p->slaveData.trigSendCounter.done() == false); 01424 ndbrequire(ptr.p->slaveData.createTrig.tableId == tableId); 01425 01426 TablePtr tabPtr; 01427 ndbrequire(findTable(ptr, tabPtr, tableId)); 01428 ndbrequire(type < 3); // if some decides to change the enums 01429 01430 createTrigReply(signal, ptr); 01431 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::execCREATE_TRIG_REF | ( | Signal * | signal | ) | [protected] |
Definition at line 1434 of file Backup.cpp.
References c_backupPool, createTrigReply(), CreateTrigRef::getConnectionPtr(), Signal::getDataPtr(), CreateTrigRef::getErrorCode(), CreateTrigRef::getTableId(), GSN_CREATE_TRIG_REQ, jamEntry, ndbrequire, and Ptr< T >::p.
Referenced by Backup().
01435 { 01436 jamEntry(); 01437 CreateTrigRef* ref = (CreateTrigRef*)signal->getDataPtr(); 01438 01439 const Uint32 ptrI = ref->getConnectionPtr(); 01440 const Uint32 tableId = ref->getTableId(); 01441 01442 BackupRecordPtr ptr; 01443 c_backupPool.getPtr(ptr, ptrI); 01444 01451 ndbrequire(ptr.p->slaveData.gsn == GSN_CREATE_TRIG_REQ); 01452 ndbrequire(ptr.p->slaveData.trigSendCounter.done() == false); 01453 ndbrequire(ptr.p->slaveData.createTrig.tableId == tableId); 01454 01455 ptr.p->setErrorCode(ref->getErrorCode()); 01456 01457 createTrigReply(signal, ptr); 01458 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::execDEFINE_BACKUP_CONF | ( | Signal * | signal | ) | [protected] |
Definition at line 1226 of file Backup.cpp.
References DefineBackupConf::backupPtr, c_backupPool, defineBackupReply(), ERROR_INSERTED, Signal::getDataPtr(), jamEntry, refToNode(), and Signal::senderBlockRef().
Referenced by Backup().
01227 { 01228 jamEntry(); 01229 01230 DefineBackupConf* conf = (DefineBackupConf*)signal->getDataPtr(); 01231 const Uint32 ptrI = conf->backupPtr; 01232 //const Uint32 backupId = conf->backupId; 01233 const Uint32 nodeId = refToNode(signal->senderBlockRef()); 01234 01235 BackupRecordPtr ptr; 01236 c_backupPool.getPtr(ptr, ptrI); 01237 01238 if (ERROR_INSERTED(10024)) 01239 { 01240 ptr.p->setErrorCode(324); 01241 } 01242 01243 defineBackupReply(signal, ptr, nodeId); 01244 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::execDEFINE_BACKUP_REF | ( | Signal * | signal | ) | [protected] |
Definition at line 1208 of file Backup.cpp.
References DefineBackupRef::backupPtr, c_backupPool, defineBackupReply(), DefineBackupRef::errorCode, Signal::getDataPtr(), jamEntry, DefineBackupRef::nodeId, and Ptr< T >::p.
Referenced by Backup().
01209 { 01210 jamEntry(); 01211 01212 DefineBackupRef* ref = (DefineBackupRef*)signal->getDataPtr(); 01213 01214 const Uint32 ptrI = ref->backupPtr; 01215 //const Uint32 backupId = ref->backupId; 01216 const Uint32 nodeId = ref->nodeId; 01217 01218 BackupRecordPtr ptr; 01219 c_backupPool.getPtr(ptr, ptrI); 01220 01221 ptr.p->setErrorCode(ref->errorCode); 01222 defineBackupReply(signal, ptr, nodeId); 01223 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::execDEFINE_BACKUP_REQ | ( | Signal * | signal | ) | [protected] |
Signals sent from master
Signal sent from myself -> record already seized
Allocate files
Not implemented
Definition at line 2338 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, DefineBackupReq::flags, Signal::getDataPtr(), getFragmentInfoDone(), GSN_DEFINE_BACKUP_REQ, Ptr< T >::i, INITIAL, jam, jamEntry, BackupFormat::LOG_FILE, Backup::Config::m_dataBufferSize, Backup::Config::m_lcp_buffer_size, Backup::Config::m_logBufferSize, Backup::Config::m_maxWriteSize, Backup::Config::m_minWriteSize, ndbrequire, DefineBackupReq::nodes, p, Ptr< T >::p, SimulatedBlock::reference(), RNIL, DefineBackupReq::senderRef, DefineBackupRef::Undefined, and verifyNodesAlive().
Referenced by Backup().
02339 { 02340 jamEntry(); 02341 02342 DefineBackupReq* req = (DefineBackupReq*)signal->getDataPtr(); 02343 02344 BackupRecordPtr ptr; 02345 const Uint32 ptrI = req->backupPtr; 02346 const Uint32 backupId = req->backupId; 02347 const BlockReference senderRef = req->senderRef; 02348 02349 if(senderRef == reference()){ 02353 jam(); 02354 c_backupPool.getPtr(ptr, ptrI); 02355 } else { // from other node 02356 jam(); 02357 #ifdef DEBUG_ABORT 02358 dumpUsedResources(); 02359 #endif 02360 if(!c_backups.seizeId(ptr, ptrI)) { 02361 jam(); 02362 ndbrequire(false); // If master has succeeded slave should succed 02363 }//if 02364 }//if 02365 02366 CRASH_INSERTION((10014)); 02367 02368 ptr.p->m_gsn = GSN_DEFINE_BACKUP_REQ; 02369 ptr.p->slaveState.forceState(INITIAL); 02370 ptr.p->slaveState.setState(DEFINING); 02371 ptr.p->slaveData.dropTrig.tableId = RNIL; 02372 ptr.p->errorCode = 0; 02373 ptr.p->clientRef = req->clientRef; 02374 ptr.p->clientData = req->clientData; 02375 if(senderRef == reference()) 02376 ptr.p->flags = req->flags; 02377 else 02378 ptr.p->flags = req->flags & ~((Uint32)0x3); /* remove waitCompleted flags 02379 * as non master should never 02380 * reply 02381 */ 02382 ptr.p->masterRef = senderRef; 02383 ptr.p->nodes = req->nodes; 02384 ptr.p->backupId = backupId; 02385 ptr.p->backupKey[0] = req->backupKey[0]; 02386 ptr.p->backupKey[1] = req->backupKey[1]; 02387 ptr.p->backupDataLen = req->backupDataLen; 02388 ptr.p->masterData.errorCode = 0; 02389 ptr.p->noOfBytes = 0; 02390 ptr.p->noOfRecords = 0; 02391 ptr.p->noOfLogBytes = 0; 02392 ptr.p->noOfLogRecords = 0; 02393 ptr.p->currGCP = 0; 02394 ptr.p->startGCP = 0; 02395 ptr.p->stopGCP = 0; 02396 02400 BackupFilePtr files[3]; 02401 Uint32 noOfPages[] = { 02402 NO_OF_PAGES_META_FILE, 02403 2, // 32k 02404 0 // 3M 02405 }; 02406 const Uint32 maxInsert[] = { 02407 2048, // Temporarily to solve TR515 02408 4096, // 4k 02409 16*3000, // Max 16 tuples 02410 }; 02411 Uint32 minWrite[] = { 02412 8192, 02413 8192, 02414 32768 02415 }; 02416 Uint32 maxWrite[] = { 02417 8192, 02418 8192, 02419 32768 02420 }; 02421 02422 minWrite[1] = c_defaults.m_minWriteSize; 02423 maxWrite[1] = c_defaults.m_maxWriteSize; 02424 noOfPages[1] = (c_defaults.m_logBufferSize + sizeof(Page32) - 1) / 02425 sizeof(Page32); 02426 minWrite[2] = c_defaults.m_minWriteSize; 02427 maxWrite[2] = c_defaults.m_maxWriteSize; 02428 noOfPages[2] = (c_defaults.m_dataBufferSize + sizeof(Page32) - 1) / 02429 sizeof(Page32); 02430 02431 if (ptr.p->is_lcp()) 02432 { 02433 noOfPages[2] = (c_defaults.m_lcp_buffer_size + sizeof(Page32) - 1) / 02434 sizeof(Page32); 02435 } 02436 02437 ptr.p->ctlFilePtr = ptr.p->logFilePtr = ptr.p->dataFilePtr = RNIL; 02438 02439 for(Uint32 i = 0; i<3; i++) { 02440 jam(); 02441 if(ptr.p->is_lcp() && i != 2) 02442 { 02443 files[i].i = RNIL; 02444 continue; 02445 } 02446 if(!ptr.p->files.seize(files[i])) { 02447 jam(); 02448 defineBackupRef(signal, ptr, 02449 DefineBackupRef::FailedToAllocateFileRecord); 02450 return; 02451 }//if 02452 02453 files[i].p->tableId = RNIL; 02454 files[i].p->backupPtr = ptr.i; 02455 files[i].p->filePointer = RNIL; 02456 files[i].p->fileClosing = 0; 02457 files[i].p->fileOpened = 0; 02458 files[i].p->fileRunning = 0; 02459 files[i].p->scanRunning = 0; 02460 files[i].p->errorCode = 0; 02461 02462 if(files[i].p->pages.seize(noOfPages[i]) == false) { 02463 jam(); 02464 DEBUG_OUT("Failed to seize " << noOfPages[i] << " pages"); 02465 defineBackupRef(signal, ptr, DefineBackupRef::FailedToAllocateBuffers); 02466 return; 02467 }//if 02468 Page32Ptr pagePtr; 02469 files[i].p->pages.getPtr(pagePtr, 0); 02470 02471 const char * msg = files[i].p-> 02472 operation.dataBuffer.setup((Uint32*)pagePtr.p, 02473 noOfPages[i] * (sizeof(Page32) >> 2), 02474 128, 02475 minWrite[i] >> 2, 02476 maxWrite[i] >> 2, 02477 maxInsert[i]); 02478 if(msg != 0) { 02479 jam(); 02480 defineBackupRef(signal, ptr, DefineBackupRef::FailedToSetupFsBuffers); 02481 return; 02482 }//if 02483 02484 switch(i){ 02485 case 0: 02486 files[i].p->fileType = BackupFormat::CTL_FILE; 02487 ptr.p->ctlFilePtr = files[i].i; 02488 break; 02489 case 1: 02490 files[i].p->fileType = BackupFormat::LOG_FILE; 02491 ptr.p->logFilePtr = files[i].i; 02492 break; 02493 case 2: 02494 files[i].p->fileType = BackupFormat::DATA_FILE; 02495 ptr.p->dataFilePtr = files[i].i; 02496 } 02497 }//for 02498 02499 if (!verifyNodesAlive(ptr, ptr.p->nodes)) { 02500 jam(); 02501 defineBackupRef(signal, ptr, DefineBackupRef::Undefined); 02502 return; 02503 }//if 02504 if (ERROR_INSERTED(10027)) { 02505 jam(); 02506 defineBackupRef(signal, ptr, 327); 02507 return; 02508 }//if 02509 02510 if(ptr.p->backupDataLen == 0) { 02511 jam(); 02512 backupAllData(signal, ptr); 02513 return; 02514 }//if 02515 02516 if(ptr.p->is_lcp()) 02517 { 02518 jam(); 02519 getFragmentInfoDone(signal, ptr); 02520 return; 02521 } 02522 02526 ndbrequire(0); 02527 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::execDI_FCOUNTCONF | ( | Signal * | signal | ) | [protected] |
DIH signals
Next table
Definition at line 3152 of file Backup.cpp.
References c_backupPool, DBDIH_REF, findTable(), Signal::getDataPtr(), Signal::getDataPtrSend(), getFragmentInfo(), GSN_DI_FCOUNTREQ, jam, jamEntry, JBB, Signal::length(), DihFragCountReq::m_connectionData, DihFragCountConf::m_connectionData, DihFragCountConf::m_fragmentCount, DihFragCountReq::m_senderData, DihFragCountConf::m_senderData, DihFragCountReq::m_tableRef, DihFragCountConf::m_tableRef, ndbrequire, Ptr< T >::p, RNIL, and SimulatedBlock::sendSignal().
Referenced by Backup().
03153 { 03154 jamEntry(); 03155 DihFragCountConf * const conf = (DihFragCountConf*)signal->getDataPtr(); 03156 const Uint32 userPtr = conf->m_connectionData; 03157 const Uint32 fragCount = conf->m_fragmentCount; 03158 const Uint32 tableId = conf->m_tableRef; 03159 const Uint32 senderData = conf->m_senderData; 03160 03161 ndbrequire(userPtr == RNIL && signal->length() == 5); 03162 03163 BackupRecordPtr ptr; 03164 c_backupPool.getPtr(ptr, senderData); 03165 03166 TablePtr tabPtr; 03167 ndbrequire(findTable(ptr, tabPtr, tableId)); 03168 03169 ndbrequire(tabPtr.p->fragments.seize(fragCount) != false); 03170 for(Uint32 i = 0; i<fragCount; i++) { 03171 jam(); 03172 FragmentPtr fragPtr; 03173 tabPtr.p->fragments.getPtr(fragPtr, i); 03174 fragPtr.p->scanned = 0; 03175 fragPtr.p->scanning = 0; 03176 fragPtr.p->tableId = tableId; 03177 fragPtr.p->fragmentId = i; 03178 fragPtr.p->node = RNIL; 03179 }//for 03180 03184 if(ptr.p->tables.next(tabPtr)) { 03185 jam(); 03186 DihFragCountReq * const req = (DihFragCountReq*)signal->getDataPtrSend(); 03187 req->m_connectionData = RNIL; 03188 req->m_tableRef = tabPtr.p->tableId; 03189 req->m_senderData = ptr.i; 03190 sendSignal(DBDIH_REF, GSN_DI_FCOUNTREQ, signal, 03191 DihFragCountReq::SignalLength, JBB); 03192 return; 03193 }//if 03194 03195 ptr.p->tables.first(tabPtr); 03196 getFragmentInfo(signal, ptr, tabPtr, 0); 03197 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::execDIGETPRIMCONF | ( | Signal * | signal | ) | [protected] |
Definition at line 3230 of file Backup.cpp.
References c_backupPool, findTable(), getFragmentInfo(), jamEntry, Signal::length(), MAX_REPLICAS, ndbrequire, Ptr< T >::p, RNIL, and Signal::theData.
Referenced by Backup().
03231 { 03232 jamEntry(); 03233 03234 const Uint32 userPtr = signal->theData[0]; 03235 const Uint32 senderData = signal->theData[1]; 03236 const Uint32 nodeCount = signal->theData[6]; 03237 const Uint32 tableId = signal->theData[7]; 03238 const Uint32 fragNo = signal->theData[8]; 03239 03240 ndbrequire(userPtr == RNIL && signal->length() == 9); 03241 ndbrequire(nodeCount > 0 && nodeCount <= MAX_REPLICAS); 03242 03243 BackupRecordPtr ptr; 03244 c_backupPool.getPtr(ptr, senderData); 03245 03246 TablePtr tabPtr; 03247 ndbrequire(findTable(ptr, tabPtr, tableId)); 03248 03249 FragmentPtr fragPtr; 03250 tabPtr.p->fragments.getPtr(fragPtr, fragNo); 03251 03252 fragPtr.p->node = signal->theData[2]; 03253 03254 getFragmentInfo(signal, ptr, tabPtr, fragNo + 1); 03255 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::execDROP_TRIG_CONF | ( | Signal * | signal | ) | [protected] |
Definition at line 2049 of file Backup.cpp.
References c_backupPool, dropTrigReply(), DropTrigConf::getConnectionPtr(), Signal::getDataPtr(), DropTrigConf::getTriggerId(), and jamEntry.
Referenced by Backup().
02050 { 02051 jamEntry(); 02052 02053 DropTrigConf* conf = (DropTrigConf*)signal->getDataPtr(); 02054 const Uint32 ptrI = conf->getConnectionPtr(); 02055 const Uint32 triggerId= conf->getTriggerId(); 02056 02057 BackupRecordPtr ptr; 02058 c_backupPool.getPtr(ptr, ptrI); 02059 02060 dropTrigReply(signal, ptr); 02061 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::execDROP_TRIG_REF | ( | Signal * | signal | ) | [protected] |
Definition at line 2032 of file Backup.cpp.
References c_backupPool, dropTrigReply(), DropTrigRef::getConf(), DropTrigRef::getConnectionPtr(), Signal::getDataPtr(), DropTrigRef::getErrorCode(), DropTrigConf::getTriggerId(), jamEntry, and ndbout().
Referenced by Backup().
02033 { 02034 jamEntry(); 02035 02036 DropTrigRef* ref = (DropTrigRef*)signal->getDataPtr(); 02037 const Uint32 ptrI = ref->getConnectionPtr(); 02038 02039 BackupRecordPtr ptr; 02040 c_backupPool.getPtr(ptr, ptrI); 02041 02042 ndbout << "ERROR DROPPING TRIGGER: " << ref->getConf()->getTriggerId(); 02043 ndbout << " Err: " << (Uint32)ref->getErrorCode() << endl << endl; 02044 02045 dropTrigReply(signal, ptr); 02046 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::execDUMP_STATE_ORD | ( | Signal * | signal | ) | [protected] |
Definition at line 305 of file Backup.cpp.
References BACKUP_REF, BackupReq::backupDataLen, c_attributePool, c_backupFilePool, c_backupPool, c_backups, c_defaults, c_fragmentPool, c_pagePool, c_tablePool, c_triggerPool, FsRemoveReq::directory, FsRemoveReq::fileNumber, Signal::getDataPtrSend(), Signal::getLength(), SimulatedBlock::getOwnNodeId(), GSN_BACKUP_REQ, GSN_FSREMOVEREQ, Ptr< T >::i, SimulatedBlock::infoEvent(), jam, jamEntry, JBA, JBB, Signal::length(), Backup::Config::m_dataBufferSize, Backup::Config::m_logBufferSize, Backup::Config::m_maxWriteSize, Backup::Config::m_minWriteSize, NDBFS_REF, ndbrequire, NdbTick_CurrentMillisecond(), FsRemoveReq::ownDirectory, Ptr< T >::p, SimulatedBlock::reference(), RNIL, FsOpenReq::S_CTL, BackupReq::senderData, SimulatedBlock::sendSignal(), FsOpenReq::setSuffix(), FsOpenReq::setVersion(), startTime, Signal::theData, FsRemoveReq::userPointer, FsRemoveReq::userReference, FsOpenReq::v2_setNodeId(), and FsOpenReq::v2_setSequence().
Referenced by Backup().
00306 { 00307 jamEntry(); 00308 00309 if(signal->theData[0] == 20){ 00310 if(signal->length() > 1){ 00311 c_defaults.m_dataBufferSize = (signal->theData[1] * 1024 * 1024); 00312 } 00313 if(signal->length() > 2){ 00314 c_defaults.m_logBufferSize = (signal->theData[2] * 1024 * 1024); 00315 } 00316 if(signal->length() > 3){ 00317 c_defaults.m_minWriteSize = signal->theData[3] * 1024; 00318 } 00319 if(signal->length() > 4){ 00320 c_defaults.m_maxWriteSize = signal->theData[4] * 1024; 00321 } 00322 00323 infoEvent("Backup: data: %d log: %d min: %d max: %d", 00324 c_defaults.m_dataBufferSize, 00325 c_defaults.m_logBufferSize, 00326 c_defaults.m_minWriteSize, 00327 c_defaults.m_maxWriteSize); 00328 return; 00329 } 00330 if(signal->theData[0] == 21){ 00331 BackupReq * req = (BackupReq*)signal->getDataPtrSend(); 00332 req->senderData = 23; 00333 req->backupDataLen = 0; 00334 sendSignal(BACKUP_REF, GSN_BACKUP_REQ,signal,BackupReq::SignalLength, JBB); 00335 startTime = NdbTick_CurrentMillisecond(); 00336 return; 00337 } 00338 00339 if(signal->theData[0] == 22){ 00340 const Uint32 seq = signal->theData[1]; 00341 FsRemoveReq * req = (FsRemoveReq *)signal->getDataPtrSend(); 00342 req->userReference = reference(); 00343 req->userPointer = 23; 00344 req->directory = 1; 00345 req->ownDirectory = 1; 00346 FsOpenReq::setVersion(req->fileNumber, 2); 00347 FsOpenReq::setSuffix(req->fileNumber, FsOpenReq::S_CTL); 00348 FsOpenReq::v2_setSequence(req->fileNumber, seq); 00349 FsOpenReq::v2_setNodeId(req->fileNumber, getOwnNodeId()); 00350 sendSignal(NDBFS_REF, GSN_FSREMOVEREQ, signal, 00351 FsRemoveReq::SignalLength, JBA); 00352 return; 00353 } 00354 00355 if(signal->theData[0] == 23){ 00359 BackupRecordPtr ptr; 00360 for(c_backups.first(ptr); ptr.i != RNIL; c_backups.next(ptr)){ 00361 infoEvent("BackupRecord %d: BackupId: %d MasterRef: %x ClientRef: %x", 00362 ptr.i, ptr.p->backupId, ptr.p->masterRef, ptr.p->clientRef); 00363 infoEvent(" State: %d", ptr.p->slaveState.getState()); 00364 BackupFilePtr filePtr; 00365 for(ptr.p->files.first(filePtr); filePtr.i != RNIL; 00366 ptr.p->files.next(filePtr)){ 00367 jam(); 00368 infoEvent(" file %d: type: %d open: %d running: %d done: %d scan: %d", 00369 filePtr.i, filePtr.p->fileType, filePtr.p->fileOpened, 00370 filePtr.p->fileRunning, 00371 filePtr.p->fileClosing, filePtr.p->scanRunning); 00372 } 00373 } 00374 } 00375 if(signal->theData[0] == 24){ 00379 infoEvent("Backup - dump pool sizes"); 00380 infoEvent("BackupPool: %d BackupFilePool: %d TablePool: %d", 00381 c_backupPool.getSize(), c_backupFilePool.getSize(), 00382 c_tablePool.getSize()); 00383 infoEvent("AttrPool: %d TriggerPool: %d FragmentPool: %d", 00384 c_backupPool.getSize(), c_backupFilePool.getSize(), 00385 c_tablePool.getSize()); 00386 infoEvent("PagePool: %d", 00387 c_pagePool.getSize()); 00388 00389 00390 if(signal->getLength() == 2 && signal->theData[1] == 2424) 00391 { 00395 BackupRecordPtr lcp; 00396 ndbrequire(c_backups.first(lcp)); 00397 00398 ndbrequire(c_backupPool.getSize() == c_backupPool.getNoOfFree() + 1); 00399 if(lcp.p->tables.isEmpty()) 00400 { 00401 ndbrequire(c_tablePool.getSize() == c_tablePool.getNoOfFree()); 00402 ndbrequire(c_attributePool.getSize() == c_attributePool.getNoOfFree()); 00403 ndbrequire(c_fragmentPool.getSize() == c_fragmentPool.getNoOfFree()); 00404 ndbrequire(c_triggerPool.getSize() == c_triggerPool.getNoOfFree()); 00405 } 00406 ndbrequire(c_backupFilePool.getSize() == c_backupFilePool.getNoOfFree() + 1); 00407 BackupFilePtr lcp_file; 00408 c_backupFilePool.getPtr(lcp_file, lcp.p->dataFilePtr); 00409 ndbrequire(c_pagePool.getSize() == 00410 c_pagePool.getNoOfFree() + 00411 lcp_file.p->pages.getSize()); 00412 } 00413 } 00414 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::execEND_LCPREQ | ( | Signal * | signal | ) | [protected] |
Definition at line 4762 of file Backup.cpp.
References EndLcpReq::backupId, EndLcpReq::backupPtr, c_backupFilePool, c_backupPool, Signal::getDataPtr(), lcp_send_end_lcp_conf(), ndbrequire, Ptr< T >::p, and STOPPING.
Referenced by Backup().
04763 { 04764 EndLcpReq* req= (EndLcpReq*)signal->getDataPtr(); 04765 04766 BackupRecordPtr ptr; 04767 c_backupPool.getPtr(ptr, req->backupPtr); 04768 ndbrequire(ptr.p->backupId == req->backupId); 04769 04770 ptr.p->slaveState.setState(STOPPING); 04771 04772 TablePtr tabPtr; 04773 if(ptr.p->tables.first(tabPtr)) 04774 { 04775 tabPtr.p->attributes.release(); 04776 tabPtr.p->fragments.release(); 04777 ptr.p->tables.release(); 04778 04779 BackupFilePtr filePtr; 04780 c_backupFilePool.getPtr(filePtr, ptr.p->dataFilePtr); 04781 filePtr.p->operation.dataBuffer.eof(); 04782 return; 04783 } 04784 04785 lcp_send_end_lcp_conf(signal, ptr); 04786 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::execFIRE_TRIG_ORD | ( | Signal * | signal | ) | [protected] |
Definition at line 4087 of file Backup.cpp.
References c_backupPool, c_triggerPool, FireTrigOrd::fragId, Signal::getDataPtr(), FireTrigOrd::getGCI(), FireTrigOrd::getTriggerId(), ILLEGAL_TRIGGER_ID, jam, jamEntry, ndbrequire, and Ptr< T >::p.
Referenced by Backup().
04088 { 04089 jamEntry(); 04090 FireTrigOrd* trg = (FireTrigOrd*)signal->getDataPtr(); 04091 04092 const Uint32 gci = trg->getGCI(); 04093 const Uint32 trI = trg->getTriggerId(); 04094 const Uint32 fragId = trg->fragId; 04095 04096 TriggerPtr trigPtr; 04097 c_triggerPool.getPtr(trigPtr, trI); 04098 04099 ndbrequire(trigPtr.p->event != ILLEGAL_TRIGGER_ID); 04100 04101 if(trigPtr.p->errorCode != 0) { 04102 jam(); 04103 return; 04104 }//if 04105 04106 ndbrequire(trigPtr.p->logEntry != 0); 04107 Uint32 len = trigPtr.p->logEntry->Length; 04108 trigPtr.p->logEntry->FragId = htonl(fragId); 04109 04110 BackupRecordPtr ptr; 04111 c_backupPool.getPtr(ptr, trigPtr.p->backupPtr); 04112 if(gci != ptr.p->currGCP) 04113 { 04114 jam(); 04115 trigPtr.p->logEntry->TriggerEvent|= htonl(0x10000); 04116 trigPtr.p->logEntry->Data[len] = htonl(gci); 04117 len++; 04118 ptr.p->currGCP = gci; 04119 } 04120 04121 len += (sizeof(BackupFormat::LogFile::LogEntry) >> 2) - 2; 04122 trigPtr.p->logEntry->Length = htonl(len); 04123 04124 ndbrequire(len + 1 <= trigPtr.p->operation->dataBuffer.getMaxWrite()); 04125 trigPtr.p->operation->dataBuffer.updateWritePtr(len + 1); 04126 trigPtr.p->logEntry = 0; 04127 04128 trigPtr.p->operation->noOfBytes += (len + 1) << 2; 04129 trigPtr.p->operation->noOfRecords += 1; 04130 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::execFSAPPENDCONF | ( | Signal * | signal | ) | [protected] |
Definition at line 3864 of file Backup.cpp.
References c_backupFilePool, checkFile(), CRASH_INSERTION, Backup::OperationRecord::dataBuffer, jamEntry, Ptr< T >::p, Signal::theData, and FsBuffer::updateReadPtr().
Referenced by Backup().
03865 { 03866 jamEntry(); 03867 03868 CRASH_INSERTION((10018)); 03869 03870 //FsConf * conf = (FsConf*)signal->getDataPtr(); 03871 const Uint32 filePtrI = signal->theData[0]; //conf->userPointer; 03872 const Uint32 bytes = signal->theData[1]; //conf->bytes; 03873 03874 BackupFilePtr filePtr; 03875 c_backupFilePool.getPtr(filePtr, filePtrI); 03876 03877 OperationRecord & op = filePtr.p->operation; 03878 03879 op.dataBuffer.updateReadPtr(bytes >> 2); 03880 03881 checkFile(signal, filePtr); 03882 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::execFSAPPENDREF | ( | Signal * | signal | ) | [protected] |
Reimplemented from SimulatedBlock.
Definition at line 3845 of file Backup.cpp.
References c_backupFilePool, checkFile(), FsRef::errorCode, Signal::getDataPtr(), jamEntry, Ptr< T >::p, and FsRef::userPointer.
Referenced by Backup().
03846 { 03847 jamEntry(); 03848 03849 FsRef * ref = (FsRef *)signal->getDataPtr(); 03850 03851 const Uint32 filePtrI = ref->userPointer; 03852 const Uint32 errCode = ref->errorCode; 03853 03854 BackupFilePtr filePtr; 03855 c_backupFilePool.getPtr(filePtr, filePtrI); 03856 03857 filePtr.p->fileRunning = 0; 03858 filePtr.p->errorCode = errCode; 03859 03860 checkFile(signal, filePtr); 03861 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::execFSCLOSECONF | ( | Signal * | signal | ) | [protected] |
Definition at line 4270 of file Backup.cpp.
References c_backupFilePool, c_backupPool, closeFilesDone(), Signal::getDataPtr(), Ptr< T >::i, jam, jamEntry, ndbout_c(), ndbrequire, Ptr< T >::p, RNIL, and FsConf::userPointer.
Referenced by Backup(), and execFSCLOSEREF().
04271 { 04272 jamEntry(); 04273 04274 FsConf * conf = (FsConf*)signal->getDataPtr(); 04275 const Uint32 filePtrI = conf->userPointer; 04276 04277 BackupFilePtr filePtr; 04278 c_backupFilePool.getPtr(filePtr, filePtrI); 04279 04280 #ifdef DEBUG_ABORT 04281 ndbout_c("***** FSCLOSECONF filePtrI = %u", filePtrI); 04282 #endif 04283 04284 ndbrequire(filePtr.p->fileClosing == 1); 04285 ndbrequire(filePtr.p->fileOpened == 1); 04286 ndbrequire(filePtr.p->fileRunning == 0); 04287 ndbrequire(filePtr.p->scanRunning == 0); 04288 04289 filePtr.p->fileOpened = 0; 04290 filePtr.p->operation.dataBuffer.reset(); 04291 04292 BackupRecordPtr ptr; 04293 c_backupPool.getPtr(ptr, filePtr.p->backupPtr); 04294 for(ptr.p->files.first(filePtr); filePtr.i!=RNIL;ptr.p->files.next(filePtr)) 04295 { 04296 jam(); 04297 if(filePtr.p->fileOpened == 1) { 04298 jam(); 04299 #ifdef DEBUG_ABORT 04300 ndbout_c("waiting for more FSCLOSECONF's filePtr.i = %u", filePtr.i); 04301 #endif 04302 return; // we will be getting more FSCLOSECONF's 04303 }//if 04304 }//for 04305 closeFilesDone(signal, ptr); 04306 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::execFSCLOSEREF | ( | Signal * | signal | ) | [protected] |
Reimplemented from SimulatedBlock.
Definition at line 4249 of file Backup.cpp.
References c_backupFilePool, c_backupPool, execFSCLOSECONF(), Signal::getDataPtr(), jamEntry, Ptr< T >::p, FsConf::userPointer, and FsRef::userPointer.
Referenced by Backup().
04250 { 04251 jamEntry(); 04252 04253 FsRef * ref = (FsRef*)signal->getDataPtr(); 04254 const Uint32 filePtrI = ref->userPointer; 04255 04256 BackupFilePtr filePtr; 04257 c_backupFilePool.getPtr(filePtr, filePtrI); 04258 04259 BackupRecordPtr ptr; 04260 c_backupPool.getPtr(ptr, filePtr.p->backupPtr); 04261 04262 filePtr.p->fileOpened = 1; 04263 FsConf * conf = (FsConf*)signal->getDataPtr(); 04264 conf->userPointer = filePtrI; 04265 04266 execFSCLOSECONF(signal); 04267 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::execFSOPENCONF | ( | Signal * | signal | ) | [protected] |
Definition at line 2679 of file Backup.cpp.
References c_backupFilePool, c_backupPool, FsConf::filePointer, Signal::getDataPtr(), jamEntry, ndbrequire, openFilesReply(), Ptr< T >::p, and FsConf::userPointer.
Referenced by Backup().
02680 { 02681 jamEntry(); 02682 02683 FsConf * conf = (FsConf *)signal->getDataPtr(); 02684 02685 const Uint32 userPtr = conf->userPointer; 02686 const Uint32 filePointer = conf->filePointer; 02687 02688 BackupFilePtr filePtr; 02689 c_backupFilePool.getPtr(filePtr, userPtr); 02690 filePtr.p->filePointer = filePointer; 02691 02692 BackupRecordPtr ptr; 02693 c_backupPool.getPtr(ptr, filePtr.p->backupPtr); 02694 02695 ndbrequire(filePtr.p->fileOpened == 0); 02696 filePtr.p->fileOpened = 1; 02697 openFilesReply(signal, ptr, filePtr); 02698 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::execFSOPENREF | ( | Signal * | signal | ) | [protected] |
FS signals
Reimplemented from SimulatedBlock.
Definition at line 2661 of file Backup.cpp.
References c_backupFilePool, c_backupPool, FsRef::errorCode, Signal::getDataPtr(), jamEntry, openFilesReply(), Ptr< T >::p, and FsRef::userPointer.
Referenced by Backup().
02662 { 02663 jamEntry(); 02664 02665 FsRef * ref = (FsRef *)signal->getDataPtr(); 02666 02667 const Uint32 userPtr = ref->userPointer; 02668 02669 BackupFilePtr filePtr; 02670 c_backupFilePool.getPtr(filePtr, userPtr); 02671 02672 BackupRecordPtr ptr; 02673 c_backupPool.getPtr(ptr, filePtr.p->backupPtr); 02674 ptr.p->setErrorCode(ref->errorCode); 02675 openFilesReply(signal, ptr, filePtr); 02676 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::execFSREMOVECONF | ( | Signal * | signal | ) | [protected] |
Definition at line 4593 of file Backup.cpp.
References c_backupPool, c_backups, Signal::getDataPtr(), jamEntry, and FsConf::userPointer.
Referenced by Backup(), and execFSREMOVEREF().
04593 { 04594 jamEntry(); 04595 04596 FsConf * conf = (FsConf*)signal->getDataPtr(); 04597 const Uint32 ptrI = conf->userPointer; 04598 04602 BackupRecordPtr ptr; 04603 c_backupPool.getPtr(ptr, ptrI); 04604 c_backups.release(ptr); 04605 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::execFSREMOVEREF | ( | Signal * | signal | ) | [protected] |
Reimplemented from SimulatedBlock.
Definition at line 4581 of file Backup.cpp.
References execFSREMOVECONF(), Signal::getDataPtr(), jamEntry, FsConf::userPointer, and FsRef::userPointer.
Referenced by Backup().
04582 { 04583 jamEntry(); 04584 FsRef * ref = (FsRef*)signal->getDataPtr(); 04585 const Uint32 ptrI = ref->userPointer; 04586 04587 FsConf * conf = (FsConf*)signal->getDataPtr(); 04588 conf->userPointer = ptrI; 04589 execFSREMOVECONF(signal); 04590 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::execGET_TABINFO_CONF | ( | Signal * | signal | ) | [protected] |
Definition at line 2871 of file Backup.cpp.
References SimulatedBlock::assembleFragments(), BACKUP_REF, buf, BackupContinueB::BUFFER_FULL_META, c_backupPool, mySTL::copy(), DBDICT, DBDIH_REF, defineBackupRef(), SimulatedBlock::EXECUTE_DIRECT(), DefineBackupRef::FailedAllocateTableMem, findTable(), Signal::getDataPtr(), Signal::getDataPtrSend(), Signal::getSection(), GSN_BACKUP_FRAGMENT_REQ, GSN_CONTINUEB, GSN_DI_FCOUNTREQ, Ptr< T >::i, DictTabInfo::isTable(), jam, jamEntry, JBB, lcp_open_file_done(), 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, GetTabInfoConf::tableId, BackupFormat::CtlFile::TableDescription::TableType, GetTabInfoConf::tableType, Signal::theData, and GetTabInfoConf::totalLen.
Referenced by Backup().
02872 { 02873 jamEntry(); 02874 02875 if(!assembleFragments(signal)) { 02876 jam(); 02877 return; 02878 }//if 02879 02880 GetTabInfoConf * const conf = (GetTabInfoConf*)signal->getDataPtr(); 02881 //const Uint32 senderRef = info->senderRef; 02882 const Uint32 len = conf->totalLen; 02883 const Uint32 senderData = conf->senderData; 02884 const Uint32 tableType = conf->tableType; 02885 const Uint32 tableId = conf->tableId; 02886 02887 BackupRecordPtr ptr; 02888 c_backupPool.getPtr(ptr, senderData); 02889 02890 SegmentedSectionPtr dictTabInfoPtr; 02891 signal->getSection(dictTabInfoPtr, GetTabInfoConf::DICT_TAB_INFO); 02892 ndbrequire(dictTabInfoPtr.sz == len); 02893 02894 TablePtr tabPtr ; 02895 ndbrequire(findTable(ptr, tabPtr, tableId)); 02896 02897 BackupFilePtr filePtr; 02898 ptr.p->files.getPtr(filePtr, ptr.p->ctlFilePtr); 02899 FsBuffer & buf = filePtr.p->operation.dataBuffer; 02900 Uint32* dst = 0; 02901 { // Write into ctl file 02902 Uint32 dstLen = len + 3; 02903 if(!buf.getWritePtr(&dst, dstLen)) { 02904 jam(); 02905 ndbrequire(false); 02906 ptr.p->setErrorCode(DefineBackupRef::FailedAllocateTableMem); 02907 releaseSections(signal); 02908 defineBackupRef(signal, ptr); 02909 return; 02910 }//if 02911 if(dst != 0) { 02912 jam(); 02913 02914 BackupFormat::CtlFile::TableDescription * desc = 02915 (BackupFormat::CtlFile::TableDescription*)dst; 02916 desc->SectionType = htonl(BackupFormat::TABLE_DESCRIPTION); 02917 desc->SectionLength = htonl(len + 3); 02918 desc->TableType = htonl(tableType); 02919 dst += 3; 02920 02921 copy(dst, dictTabInfoPtr); 02922 buf.updateWritePtr(dstLen); 02923 }//if 02924 } 02925 02926 releaseSections(signal); 02927 02928 if(ptr.p->checkError()) { 02929 jam(); 02930 defineBackupRef(signal, ptr); 02931 return; 02932 }//if 02933 02934 if (!DictTabInfo::isTable(tabPtr.p->tableType)) 02935 { 02936 jam(); 02937 02938 TablePtr tmp = tabPtr; 02939 ptr.p->tables.next(tabPtr); 02940 ptr.p->tables.release(tmp); 02941 goto next; 02942 } 02943 02944 if (!parseTableDescription(signal, ptr, tabPtr, dst, len)) 02945 { 02946 jam(); 02947 defineBackupRef(signal, ptr); 02948 return; 02949 } 02950 02951 if(!ptr.p->is_lcp()) 02952 { 02953 jam(); 02954 signal->theData[0] = tabPtr.p->tableId; 02955 signal->theData[1] = 1; // lock 02956 EXECUTE_DIRECT(DBDICT, GSN_BACKUP_FRAGMENT_REQ, signal, 2); 02957 } 02958 02959 ptr.p->tables.next(tabPtr); 02960 02961 next: 02962 if(tabPtr.i == RNIL) 02963 { 02967 jam(); 02968 02969 if(ptr.p->is_lcp()) 02970 { 02971 lcp_open_file_done(signal, ptr); 02972 return; 02973 } 02974 02975 ndbrequire(ptr.p->tables.first(tabPtr)); 02976 DihFragCountReq * const req = (DihFragCountReq*)signal->getDataPtrSend(); 02977 req->m_connectionData = RNIL; 02978 req->m_tableRef = tabPtr.p->tableId; 02979 req->m_senderData = ptr.i; 02980 sendSignal(DBDIH_REF, GSN_DI_FCOUNTREQ, signal, 02981 DihFragCountReq::SignalLength, JBB); 02982 return; 02983 }//if 02984 02988 signal->theData[0] = BackupContinueB::BUFFER_FULL_META; 02989 signal->theData[1] = ptr.i; 02990 signal->theData[2] = tabPtr.i; 02991 sendSignalWithDelay(BACKUP_REF, GSN_CONTINUEB, signal, 100, 3); 02992 return; 02993 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::execGET_TABINFOREF | ( | Signal * | signal | ) | [protected] |
Definition at line 2859 of file Backup.cpp.
References c_backupPool, defineBackupRef(), GetTabInfoRef::errorCode, Signal::getDataPtr(), and GetTabInfoRef::senderData.
Referenced by Backup().
02860 { 02861 GetTabInfoRef * ref = (GetTabInfoRef*)signal->getDataPtr(); 02862 02863 const Uint32 senderData = ref->senderData; 02864 BackupRecordPtr ptr; 02865 c_backupPool.getPtr(ptr, senderData); 02866 02867 defineBackupRef(signal, ptr, ref->errorCode); 02868 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::execINCL_NODEREQ | ( | Signal * | signal | ) | [protected] |
Definition at line 891 of file Backup.cpp.
References c_aliveNodes, c_nodes, BitmaskPOD< size >::get(), GSN_INCL_NODECONF, Ptr< T >::i, jam, jamEntry, JBB, ndbrequire, Ptr< T >::p, SimulatedBlock::reference(), RNIL, SimulatedBlock::sendSignal(), BitmaskPOD< size >::set(), and Signal::theData.
Referenced by Backup().
00892 { 00893 jamEntry(); 00894 00895 const Uint32 senderRef = signal->theData[0]; 00896 const Uint32 inclNode = signal->theData[1]; 00897 00898 NodePtr node; 00899 for(c_nodes.first(node); node.i != RNIL; c_nodes.next(node)) { 00900 jam(); 00901 const Uint32 nodeId = node.p->nodeId; 00902 if(inclNode == nodeId){ 00903 jam(); 00904 00905 ndbrequire(node.p->alive == 0); 00906 ndbrequire(!c_aliveNodes.get(nodeId)); 00907 00908 node.p->alive = 1; 00909 c_aliveNodes.set(nodeId); 00910 00911 break; 00912 }//if 00913 }//for 00914 signal->theData[0] = reference(); 00915 sendSignal(senderRef, GSN_INCL_NODECONF, signal, 1, JBB); 00916 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::execLCP_FRAGMENT_REQ | ( | Signal * | ) | [protected] |
| void Backup::execLCP_PREPARE_REQ | ( | Signal * | signal | ) | [protected] |
LCP
Close previous file
Definition at line 4611 of file Backup.cpp.
References LcpPrepareReq::backupId, LcpPrepareReq::backupPtr, c_backupFilePool, c_backupPool, defineBackupRef(), LcpPrepareReq::fragmentId, Signal::getDataPtr(), Ptr< T >::isNull(), jam, jamEntry, lcp_open_file(), lcp_open_file_done(), LcpPrepareReq::lcpNo, ndbrequire, Ptr< T >::p, LcpPrepareReq::tableId, and DictTabInfo::UserTable.
Referenced by Backup().
04612 { 04613 jamEntry(); 04614 LcpPrepareReq req = *(LcpPrepareReq*)signal->getDataPtr(); 04615 04616 BackupRecordPtr ptr; 04617 c_backupPool.getPtr(ptr, req.backupPtr); 04618 04619 bool first= true; 04620 TablePtr tabPtr; 04621 if(ptr.p->tables.first(tabPtr) && tabPtr.p->tableId != req.tableId) 04622 { 04623 jam(); 04624 first= false; 04625 tabPtr.p->attributes.release(); 04626 tabPtr.p->fragments.release(); 04627 ptr.p->tables.release(); 04628 ptr.p->errorCode = 0; 04629 } 04630 04631 if(ptr.p->tables.first(tabPtr) && ptr.p->errorCode == 0) 04632 { 04633 jam(); 04634 FragmentPtr fragPtr; 04635 tabPtr.p->fragments.getPtr(fragPtr, 0); 04636 fragPtr.p->fragmentId = req.fragmentId; 04637 04638 lcp_open_file_done(signal, ptr); 04639 return; 04640 } 04641 else if(ptr.p->errorCode == 0) 04642 { 04643 jam(); 04644 FragmentPtr fragPtr; 04645 if(!ptr.p->tables.seize(tabPtr) || !tabPtr.p->fragments.seize(1)) 04646 { 04647 if(!tabPtr.isNull()) 04648 ptr.p->tables.release(); 04649 ndbrequire(false); // TODO 04650 } 04651 tabPtr.p->tableId = req.tableId; 04652 tabPtr.p->fragments.getPtr(fragPtr, 0); 04653 tabPtr.p->tableType = DictTabInfo::UserTable; 04654 fragPtr.p->fragmentId = req.fragmentId; 04655 fragPtr.p->lcp_no = req.lcpNo; 04656 fragPtr.p->scanned = 0; 04657 fragPtr.p->scanning = 0; 04658 fragPtr.p->tableId = req.tableId; 04659 } 04660 else 04661 { 04662 jam(); 04663 FragmentPtr fragPtr; 04664 tabPtr.p->fragments.getPtr(fragPtr, 0); 04665 fragPtr.p->fragmentId = req.fragmentId; 04666 defineBackupRef(signal, ptr, ptr.p->errorCode); 04667 return; 04668 } 04669 04670 if(first) 04671 { 04672 jam(); 04673 // start file thread 04674 ptr.p->backupId= req.backupId; 04675 lcp_open_file(signal, ptr); 04676 return; 04677 } 04678 else 04679 { 04680 jam(); 04681 ndbrequire(ptr.p->backupId == req.backupId); 04682 } 04683 04687 jam(); 04688 BackupFilePtr filePtr; 04689 c_backupFilePool.getPtr(filePtr, ptr.p->dataFilePtr); 04690 filePtr.p->operation.dataBuffer.eof(); 04691 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::execLIST_TABLES_CONF | ( | Signal * | signal | ) | [protected] |
DICT signals
Not finished...
All tables fetched
Definition at line 2544 of file Backup.cpp.
References c_backupPool, defineBackupRef(), DefineBackupRef::FailedToAllocateTables, Signal::getDataPtr(), ListTablesConf::getTableId(), ListTablesConf::getTableState(), ListTablesConf::getTableType(), Ptr< T >::i, DictTabInfo::isFile(), DictTabInfo::isFilegroup(), DictTabInfo::isIndex(), DictTabInfo::isTable(), jam, jamEntry, Signal::length(), openFiles(), Ptr< T >::p, RNIL, ListTablesConf::senderData, DictTabInfo::StateOnline, and ListTablesConf::tableData.
Referenced by Backup().
02545 { 02546 jamEntry(); 02547 02548 ListTablesConf* conf = (ListTablesConf*)signal->getDataPtr(); 02549 02550 BackupRecordPtr ptr; 02551 c_backupPool.getPtr(ptr, conf->senderData); 02552 02553 const Uint32 len = signal->length() - ListTablesConf::HeaderLength; 02554 for(unsigned int i = 0; i<len; i++) { 02555 jam(); 02556 Uint32 tableId = ListTablesConf::getTableId(conf->tableData[i]); 02557 Uint32 tableType = ListTablesConf::getTableType(conf->tableData[i]); 02558 Uint32 state= ListTablesConf::getTableState(conf->tableData[i]); 02559 02560 if (! (DictTabInfo::isTable(tableType) || 02561 DictTabInfo::isIndex(tableType) || 02562 DictTabInfo::isFilegroup(tableType) || 02563 DictTabInfo::isFile(tableType))) 02564 { 02565 jam(); 02566 continue; 02567 } 02568 02569 if (state != DictTabInfo::StateOnline) 02570 { 02571 jam(); 02572 continue; 02573 } 02574 02575 TablePtr tabPtr; 02576 ptr.p->tables.seize(tabPtr); 02577 if(tabPtr.i == RNIL) { 02578 jam(); 02579 defineBackupRef(signal, ptr, DefineBackupRef::FailedToAllocateTables); 02580 return; 02581 }//if 02582 tabPtr.p->tableId = tableId; 02583 tabPtr.p->tableType = tableType; 02584 }//for 02585 02586 if(len == ListTablesConf::DataLength) { 02587 jam(); 02591 return; 02592 }//if 02593 02597 openFiles(signal, ptr); 02598 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::execNODE_FAILREP | ( | Signal * | signal | ) | [protected] |
Definition at line 661 of file Backup.cpp.
References c_aliveNodes, c_backups, c_masterNodeId, c_nodes, checkNodeFail(), BitmaskPOD< size >::clear(), BitmaskPOD< size >::get(), Signal::getDataPtr(), Ptr< T >::i, jam, jamEntry, NodeFailRep::masterNodeId, ndbout_c(), ndbrequire, RNIL, and NodeFailRep::theNodes.
Referenced by Backup().
00662 { 00663 jamEntry(); 00664 00665 NodeFailRep * rep = (NodeFailRep*)signal->getDataPtr(); 00666 00667 bool doStuff = false; 00668 /* 00669 Start by saving important signal data which will be destroyed before the 00670 process is completed. 00671 */ 00672 NodeId new_master_node_id = rep->masterNodeId; 00673 Uint32 theFailedNodes[NodeBitmask::Size]; 00674 for (Uint32 i = 0; i < NodeBitmask::Size; i++) 00675 theFailedNodes[i] = rep->theNodes[i]; 00676 00677 c_masterNodeId = new_master_node_id; 00678 00679 NodePtr nodePtr; 00680 for(c_nodes.first(nodePtr); nodePtr.i != RNIL; c_nodes.next(nodePtr)) { 00681 jam(); 00682 if(NodeBitmask::get(theFailedNodes, nodePtr.p->nodeId)){ 00683 if(nodePtr.p->alive){ 00684 jam(); 00685 ndbrequire(c_aliveNodes.get(nodePtr.p->nodeId)); 00686 doStuff = true; 00687 } else { 00688 jam(); 00689 ndbrequire(!c_aliveNodes.get(nodePtr.p->nodeId)); 00690 }//if 00691 nodePtr.p->alive = 0; 00692 c_aliveNodes.clear(nodePtr.p->nodeId); 00693 }//if 00694 }//for 00695 00696 if(!doStuff){ 00697 jam(); 00698 return; 00699 }//if 00700 00701 #ifdef DEBUG_ABORT 00702 ndbout_c("****************** Node fail rep ******************"); 00703 #endif 00704 00705 NodeId newCoordinator = c_masterNodeId; 00706 BackupRecordPtr ptr; 00707 for(c_backups.first(ptr); ptr.i != RNIL; c_backups.next(ptr)) { 00708 jam(); 00709 checkNodeFail(signal, ptr, newCoordinator, theFailedNodes); 00710 } 00711 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::execREAD_CONFIG_REQ | ( | Signal * | signal | ) | [protected] |
Definition at line 138 of file BackupInit.cpp.
References CFG_DB_BACKUP_DATA_BUFFER_MEM, CFG_DB_BACKUP_LOG_BUFFER_MEM, CFG_DB_BACKUP_MAX_WRITE_SIZE, CFG_DB_BACKUP_MEM, CFG_DB_BACKUP_WRITE_SIZE, CFG_DB_DISCLESS, CFG_DB_NO_ATTRIBUTES, CFG_DB_PARALLEL_BACKUPS, CFG_DICT_TABLE, CFG_DIH_FRAG_CONNECT, GSN_READ_CONFIG_CONF, JBB, MAX_ATTRIBUTES_IN_TABLE, MAX_NDB_NODES, ndb_mgm_get_int_parameter(), ndbrequire, ReadConfigReq::noOfParameters, NewVar::nrr, Ptr< T >::p, p, SLListImpl< ArrayPool< T >, T, U >::release(), SLListImpl< ArrayPool< T >, T, U >::seize(), ReadConfigConf::senderData, ReadConfigReq::senderData, ReadConfigConf::senderRef, ReadConfigReq::senderRef, and NewVar::WA.
Referenced by Backup().
00139 { 00140 const ReadConfigReq * req = (ReadConfigReq*)signal->getDataPtr(); 00141 Uint32 ref = req->senderRef; 00142 Uint32 senderData = req->senderData; 00143 ndbrequire(req->noOfParameters == 0); 00144 00145 const ndb_mgm_configuration_iterator * p = 00146 m_ctx.m_config.getOwnConfigIterator(); 00147 ndbrequire(p != 0); 00148 00149 Uint32 noBackups = 0, noTables = 0, noAttribs = 0, noFrags = 0; 00150 ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DB_DISCLESS, &m_diskless)); 00151 ndb_mgm_get_int_parameter(p, CFG_DB_PARALLEL_BACKUPS, &noBackups); 00152 // ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DB_NO_TABLES, &noTables)); 00153 ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DICT_TABLE, &noTables)); 00154 ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DB_NO_ATTRIBUTES, &noAttribs)); 00155 ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DIH_FRAG_CONNECT, &noFrags)); 00156 00157 noAttribs++; //RT 527 bug fix 00158 00159 c_nodePool.setSize(MAX_NDB_NODES); 00160 c_backupPool.setSize(noBackups + 1); 00161 c_backupFilePool.setSize(3 * noBackups + 1); 00162 c_tablePool.setSize(noBackups * noTables + 1); 00163 c_attributePool.setSize(noBackups * noAttribs + MAX_ATTRIBUTES_IN_TABLE); 00164 c_triggerPool.setSize(noBackups * 3 * noTables); 00165 c_fragmentPool.setSize(noBackups * noFrags + 1); 00166 00167 Uint32 szDataBuf = (2 * 1024 * 1024); 00168 Uint32 szLogBuf = (2 * 1024 * 1024); 00169 Uint32 szWrite = 32768, maxWriteSize = (256 * 1024); 00170 ndb_mgm_get_int_parameter(p, CFG_DB_BACKUP_DATA_BUFFER_MEM, &szDataBuf); 00171 ndb_mgm_get_int_parameter(p, CFG_DB_BACKUP_LOG_BUFFER_MEM, &szLogBuf); 00172 ndb_mgm_get_int_parameter(p, CFG_DB_BACKUP_WRITE_SIZE, &szWrite); 00173 ndb_mgm_get_int_parameter(p, CFG_DB_BACKUP_MAX_WRITE_SIZE, &maxWriteSize); 00174 00175 c_defaults.m_logBufferSize = szLogBuf; 00176 c_defaults.m_dataBufferSize = szDataBuf; 00177 c_defaults.m_minWriteSize = szWrite; 00178 c_defaults.m_maxWriteSize = maxWriteSize; 00179 c_defaults.m_lcp_buffer_size = szDataBuf; 00180 00181 00182 Uint32 szMem = 0; 00183 ndb_mgm_get_int_parameter(p, CFG_DB_BACKUP_MEM, &szMem); 00184 Uint32 noPages = (szMem + c_defaults.m_lcp_buffer_size + sizeof(Page32) - 1) 00185 / sizeof(Page32); 00186 // We need to allocate an additional of 2 pages. 1 page because of a bug in 00187 // ArrayPool and another one for DICTTAINFO. 00188 c_pagePool.setSize(noPages + NO_OF_PAGES_META_FILE + 2); 00189 00190 { // Init all tables 00191 SLList<Table> tables(c_tablePool); 00192 TablePtr ptr; 00193 while(tables.seize(ptr)){ 00194 new (ptr.p) Table(c_attributePool, c_fragmentPool); 00195 } 00196 tables.release(); 00197 } 00198 00199 { 00200 SLList<BackupFile> ops(c_backupFilePool); 00201 BackupFilePtr ptr; 00202 while(ops.seize(ptr)){ 00203 new (ptr.p) BackupFile(* this, c_pagePool); 00204 } 00205 ops.release(); 00206 } 00207 00208 { 00209 SLList<BackupRecord> recs(c_backupPool); 00210 BackupRecordPtr ptr; 00211 while(recs.seize(ptr)){ 00212 new (ptr.p) BackupRecord(* this, c_tablePool, 00213 c_backupFilePool, c_triggerPool); 00214 } 00215 recs.release(); 00216 } 00217 00218 // Initialize BAT for interface to file system 00219 { 00220 Page32Ptr p; 00221 ndbrequire(c_pagePool.seizeId(p, 0)); 00222 c_startOfPages = (Uint32 *)p.p; 00223 c_pagePool.release(p); 00224 00225 NewVARIABLE* bat = allocateBat(1); 00226 bat[0].WA = c_startOfPages; 00227 bat[0].nrr = c_pagePool.getSize()*sizeof(Page32)/sizeof(Uint32); 00228 } 00229 00230 ReadConfigConf * conf = (ReadConfigConf*)signal->getDataPtrSend(); 00231 conf->senderRef = reference(); 00232 conf->senderData = senderData; 00233 sendSignal(ref, GSN_READ_CONFIG_CONF, signal, 00234 ReadConfigConf::SignalLength, JBB); 00235 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::execREAD_NODESCONF | ( | Signal * | signal | ) | [protected] |
Definition at line 107 of file Backup.cpp.
References ReadNodesConf::allNodes, c_aliveNodes, c_nodes, BitmaskPOD< size >::clear(), count, BitmaskPOD< size >::get(), Signal::getDataPtr(), ReadNodesConf::inactiveNodes, jam, jamEntry, MAX_NDB_NODES, ndbrequire, Ptr< T >::p, and BitmaskPOD< size >::set().
Referenced by Backup().
00108 { 00109 jamEntry(); 00110 ReadNodesConf * conf = (ReadNodesConf *)signal->getDataPtr(); 00111 00112 c_aliveNodes.clear(); 00113 00114 Uint32 count = 0; 00115 for (Uint32 i = 0; i<MAX_NDB_NODES; i++) { 00116 jam(); 00117 if(NodeBitmask::get(conf->allNodes, i)){ 00118 jam(); 00119 count++; 00120 00121 NodePtr node; 00122 ndbrequire(c_nodes.seize(node)); 00123 00124 node.p->nodeId = i; 00125 if(NodeBitmask::get(conf->inactiveNodes, i)) { 00126 jam(); 00127 node.p->alive = 0; 00128 } else { 00129 jam(); 00130 node.p->alive = 1; 00131 c_aliveNodes.set(i); 00132 }//if 00133 }//if 00134 }//for 00135 c_masterNodeId = conf->masterNodeId; 00136 ndbrequire(count == conf->noOfNodes); 00137 sendSTTORRY(signal); 00138 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::execSCAN_FRAGCONF | ( | Signal * | signal | ) | [protected] |
Definition at line 3694 of file Backup.cpp.
References c_backupFilePool, checkScan(), ScanFragConf::completedOps, CRASH_INSERTION, fragmentCompleted(), ScanFragConf::fragmentCompleted, Signal::getDataPtr(), jam, jamEntry, Ptr< T >::p, Backup::OperationRecord::scanConf(), ScanFragConf::senderData, and ScanFragConf::total_len.
Referenced by Backup().
03695 { 03696 jamEntry(); 03697 03698 CRASH_INSERTION((10017)); 03699 03700 ScanFragConf * conf = (ScanFragConf*)signal->getDataPtr(); 03701 03702 const Uint32 filePtrI = conf->senderData; 03703 BackupFilePtr filePtr; 03704 c_backupFilePool.getPtr(filePtr, filePtrI); 03705 03706 OperationRecord & op = filePtr.p->operation; 03707 03708 op.scanConf(conf->completedOps, conf->total_len); 03709 const Uint32 completed = conf->fragmentCompleted; 03710 if(completed != 2) { 03711 jam(); 03712 03713 checkScan(signal, filePtr); 03714 return; 03715 }//if 03716 03717 fragmentCompleted(signal, filePtr); 03718 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::execSCAN_FRAGREF | ( | Signal * | signal | ) | [protected] |
Definition at line 3677 of file Backup.cpp.
References backupFragmentRef(), c_backupFilePool, ScanFragRef::errorCode, Signal::getDataPtr(), jamEntry, Ptr< T >::p, and ScanFragRef::senderData.
Referenced by Backup().
03678 { 03679 jamEntry(); 03680 03681 ScanFragRef * ref = (ScanFragRef*)signal->getDataPtr(); 03682 03683 const Uint32 filePtrI = ref->senderData; 03684 BackupFilePtr filePtr; 03685 c_backupFilePool.getPtr(filePtr, filePtrI); 03686 03687 filePtr.p->errorCode = ref->errorCode; 03688 filePtr.p->scanRunning = 0; 03689 03690 backupFragmentRef(signal, filePtr); 03691 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::execSCAN_HBREP | ( | Signal * | signal | ) | [protected] |
The actual scan
Definition at line 3478 of file Backup.cpp.
References jamEntry.
Referenced by Backup().
03479 { 03480 jamEntry(); 03481 }
Here is the caller graph for this function:

| void Backup::execSTART_BACKUP_CONF | ( | Signal * | signal | ) | [protected] |
Definition at line 1565 of file Backup.cpp.
References StartBackupConf::backupPtr, c_backupPool, Signal::getDataPtr(), jamEntry, refToNode(), Signal::senderBlockRef(), and startBackupReply().
Referenced by Backup().
01566 { 01567 jamEntry(); 01568 01569 StartBackupConf* conf = (StartBackupConf*)signal->getDataPtr(); 01570 const Uint32 ptrI = conf->backupPtr; 01571 //const Uint32 backupId = conf->backupId; 01572 const Uint32 nodeId = refToNode(signal->senderBlockRef()); 01573 01574 BackupRecordPtr ptr; 01575 c_backupPool.getPtr(ptr, ptrI); 01576 01577 startBackupReply(signal, ptr, nodeId); 01578 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::execSTART_BACKUP_REF | ( | Signal * | signal | ) | [protected] |
Definition at line 1548 of file Backup.cpp.
References StartBackupRef::backupPtr, c_backupPool, StartBackupRef::errorCode, Signal::getDataPtr(), jamEntry, StartBackupRef::nodeId, Ptr< T >::p, and startBackupReply().
Referenced by Backup().
01549 { 01550 jamEntry(); 01551 01552 StartBackupRef* ref = (StartBackupRef*)signal->getDataPtr(); 01553 const Uint32 ptrI = ref->backupPtr; 01554 //const Uint32 backupId = ref->backupId; 01555 const Uint32 nodeId = ref->nodeId; 01556 01557 BackupRecordPtr ptr; 01558 c_backupPool.getPtr(ptr, ptrI); 01559 01560 ptr.p->setErrorCode(ref->errorCode); 01561 startBackupReply(signal, ptr, nodeId); 01562 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::execSTART_BACKUP_REQ | ( | Signal * | signal | ) | [protected] |
Definition at line 3276 of file Backup.cpp.
References BACKUP_REF, StartBackupReq::backupPtr, c_backupPool, CRASH_INSERTION, Signal::getDataPtr(), GSN_CONTINUEB, GSN_START_BACKUP_REQ, Ptr< T >::i, jam, jamEntry, ndbrequire, Ptr< T >::p, RNIL, sendCreateTrig(), SimulatedBlock::sendSignalWithDelay(), BackupContinueB::START_FILE_THREAD, STARTED, and Signal::theData.
Referenced by Backup().
03277 { 03278 jamEntry(); 03279 03280 CRASH_INSERTION((10015)); 03281 03282 StartBackupReq* req = (StartBackupReq*)signal->getDataPtr(); 03283 const Uint32 ptrI = req->backupPtr; 03284 03285 BackupRecordPtr ptr; 03286 c_backupPool.getPtr(ptr, ptrI); 03287 03288 ptr.p->slaveState.setState(STARTED); 03289 ptr.p->m_gsn = GSN_START_BACKUP_REQ; 03290 03294 BackupFilePtr filePtr; 03295 for(ptr.p->files.first(filePtr); 03296 filePtr.i!=RNIL; 03297 ptr.p->files.next(filePtr)){ 03298 jam(); 03299 if(filePtr.p->fileRunning == 0) { 03300 jam(); 03301 filePtr.p->fileRunning = 1; 03302 signal->theData[0] = BackupContinueB::START_FILE_THREAD; 03303 signal->theData[1] = filePtr.i; 03304 sendSignalWithDelay(BACKUP_REF, GSN_CONTINUEB, signal, 100, 2); 03305 }//if 03306 }//for 03307 03311 TablePtr tabPtr; 03312 ndbrequire(ptr.p->tables.first(tabPtr)); 03313 sendCreateTrig(signal, ptr, tabPtr); 03314 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::execSTOP_BACKUP_CONF | ( | Signal * | signal | ) | [protected] |
Definition at line 2122 of file Backup.cpp.
References StopBackupConf::backupPtr, c_backupPool, Signal::getDataPtr(), jamEntry, StopBackupConf::noOfLogBytes, StopBackupConf::noOfLogRecords, refToNode(), Signal::senderBlockRef(), and stopBackupReply().
Referenced by Backup().
02123 { 02124 jamEntry(); 02125 02126 StopBackupConf* conf = (StopBackupConf*)signal->getDataPtr(); 02127 const Uint32 ptrI = conf->backupPtr; 02128 //const Uint32 backupId = conf->backupId; 02129 const Uint32 nodeId = refToNode(signal->senderBlockRef()); 02130 02131 BackupRecordPtr ptr; 02132 c_backupPool.getPtr(ptr, ptrI); 02133 02134 ptr.p->noOfLogBytes += conf->noOfLogBytes; 02135 ptr.p->noOfLogRecords += conf->noOfLogRecords; 02136 02137 stopBackupReply(signal, ptr, nodeId); 02138 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::execSTOP_BACKUP_REF | ( | Signal * | signal | ) | [protected] |
Definition at line 2087 of file Backup.cpp.
References StopBackupRef::backupPtr, c_backupPool, StopBackupRef::errorCode, Signal::getDataPtr(), jamEntry, StopBackupRef::nodeId, Ptr< T >::p, and stopBackupReply().
Referenced by Backup().
02088 { 02089 jamEntry(); 02090 02091 StopBackupRef* ref = (StopBackupRef*)signal->getDataPtr(); 02092 const Uint32 ptrI = ref->backupPtr; 02093 //const Uint32 backupId = ref->backupId; 02094 const Uint32 nodeId = ref->nodeId; 02095 02096 BackupRecordPtr ptr; 02097 c_backupPool.getPtr(ptr, ptrI); 02098 02099 ptr.p->setErrorCode(ref->errorCode); 02100 stopBackupReply(signal, ptr, nodeId); 02101 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::execSTOP_BACKUP_REQ | ( | Signal * | signal | ) | [protected] |
Definition at line 4160 of file Backup.cpp.
References StopBackupReq::backupPtr, c_backupPool, CRASH_INSERTION, Signal::getDataPtr(), GSN_STOP_BACKUP_REQ, jamEntry, ndbrequire, Ptr< T >::p, sendDropTrig(), StopBackupReq::startGCP, StopBackupReq::stopGCP, and STOPPING.
Referenced by Backup().
04161 { 04162 jamEntry(); 04163 StopBackupReq * req = (StopBackupReq*)signal->getDataPtr(); 04164 04165 CRASH_INSERTION((10020)); 04166 04167 const Uint32 ptrI = req->backupPtr; 04168 //const Uint32 backupId = req->backupId; 04169 const Uint32 startGCP = req->startGCP; 04170 const Uint32 stopGCP = req->stopGCP; 04171 04175 ndbrequire(stopGCP > startGCP); 04176 04180 BackupRecordPtr ptr; 04181 c_backupPool.getPtr(ptr, ptrI); 04182 04183 ptr.p->slaveState.setState(STOPPING); 04184 ptr.p->m_gsn = GSN_STOP_BACKUP_REQ; 04185 ptr.p->startGCP= startGCP; 04186 ptr.p->stopGCP= stopGCP; 04187 04191 sendDropTrig(signal, ptr); 04192 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::execSTTOR | ( | Signal * | signal | ) | [protected] |
Definition at line 80 of file Backup.cpp.
References c_masterNodeId, createSequence(), g_TypeOfStart, SimulatedBlock::getOwnNodeId(), GSN_READ_NODESREQ, jam, jamEntry, JBB, NDBCNTR_REF, SimulatedBlock::reference(), SimulatedBlock::sendSignal(), sendSTTORRY(), NodeState::ST_INITIAL_START, and Signal::theData.
Referenced by Backup().
00081 { 00082 jamEntry(); 00083 00084 const Uint32 startphase = signal->theData[1]; 00085 const Uint32 typeOfStart = signal->theData[7]; 00086 00087 if (startphase == 3) { 00088 jam(); 00089 g_TypeOfStart = typeOfStart; 00090 signal->theData[0] = reference(); 00091 sendSignal(NDBCNTR_REF, GSN_READ_NODESREQ, signal, 1, JBB); 00092 return; 00093 }//if 00094 00095 if(startphase == 7 && g_TypeOfStart == NodeState::ST_INITIAL_START && 00096 c_masterNodeId == getOwnNodeId()){ 00097 jam(); 00098 createSequence(signal); 00099 return; 00100 }//if 00101 00102 sendSTTORRY(signal); 00103 return; 00104 }//Dbdict::execSTTOR()
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::execTRANSID_AI | ( | Signal * | signal | ) | [protected] |
Definition at line 3484 of file Backup.cpp.
References Backup::Table::attributes, Backup::Attribute::Data::attrId, Backup::OperationRecord::attrSzTotal, c_backupFilePool, c_tablePool, Backup::Attribute::COL_FIXED, Backup::Attribute::COL_NULLABLE, Backup::Attribute::data, Backup::OperationRecord::dst, Backup::OperationRecord::finished(), AttributeHeader::getAttributeId(), AttributeHeader::getByteSize(), AttributeHeader::getDataSize(), AttributeHeader::getHeaderSize(), AttributeHeader::isNULL(), jam, jamEntry, Signal::length(), Backup::Attribute::Data::m_flags, memcpy, ndbrequire, Backup::OperationRecord::newAttrib(), Backup::OperationRecord::newRecord(), Backup::OperationRecord::newVariable(), Backup::OperationRecord::nullVariable(), Backup::Attribute::Data::offset, Ptr< T >::p, Backup::Attribute::Data::sz32, Backup::OperationRecord::tablePtr, and Signal::theData.
Referenced by Backup().
03485 { 03486 jamEntry(); 03487 03488 const Uint32 filePtrI = signal->theData[0]; 03489 //const Uint32 transId1 = signal->theData[1]; 03490 //const Uint32 transId2 = signal->theData[2]; 03491 const Uint32 dataLen = signal->length() - 3; 03492 03493 BackupFilePtr filePtr; 03494 c_backupFilePool.getPtr(filePtr, filePtrI); 03495 03496 OperationRecord & op = filePtr.p->operation; 03497 03498 TablePtr tabPtr; 03499 c_tablePool.getPtr(tabPtr, op.tablePtr); 03500 03501 Table & table = * tabPtr.p; 03502 03506 op.attrSzTotal += dataLen; 03507 03508 Uint32 srcSz = dataLen; 03509 Uint32 usedSz = 0; 03510 const Uint32 * src = &signal->theData[3]; 03511 03512 Ptr<Attribute> attrPtr; 03513 table.attributes.first(attrPtr); 03514 Uint32 columnNo = 0; 03515 03516 while (usedSz < srcSz) 03517 { 03518 jam(); 03519 03523 const AttributeHeader attrHead(* src); 03524 const Uint32 attrId = attrHead.getAttributeId(); 03525 const bool null = attrHead.isNULL(); 03526 const Attribute::Data attr = attrPtr.p->data; 03527 ndbrequire(attrId == attr.attrId); 03528 03529 usedSz += attrHead.getHeaderSize(); 03530 src += attrHead.getHeaderSize(); 03531 03532 if (null) { 03533 jam(); 03534 ndbrequire(attr.m_flags & Attribute::COL_NULLABLE); 03535 op.nullVariable(); 03536 } else { 03537 Uint32* dst; 03538 Uint32 dstSz = attrHead.getDataSize(); 03539 if (attr.m_flags & Attribute::COL_FIXED && 03540 ! (attr.m_flags & Attribute::COL_NULLABLE)) { 03541 jam(); 03542 dst = op.newAttrib(attr.offset, dstSz); 03543 ndbrequire(dstSz == attr.sz32); 03544 } else { 03545 dst = op.newVariable(columnNo, attrHead.getByteSize()); 03546 ndbrequire(dstSz <= attr.sz32); 03547 } 03548 03549 memcpy(dst, src, (dstSz << 2)); 03550 src += dstSz; 03551 usedSz += dstSz; 03552 } 03553 table.attributes.next(attrPtr); 03554 columnNo++; 03555 } 03556 03557 ndbrequire(usedSz == srcSz); 03558 ndbrequire(op.finished()); 03559 op.newRecord(op.dst); 03560 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::execTRIG_ATTRINFO | ( | Signal * | signal | ) | [protected] |
Definition at line 4005 of file Backup.cpp.
References AbortBackupOrd::backupId, AbortBackupOrd::backupPtr, TrigAttrInfo::BEFORE_VALUES, buf, c_backupPool, c_triggerPool, CRASH_INSERTION, BackupFormat::LogFile::LogEntry::Data, ERROR_INSERTED, TrigAttrInfo::getAttrInfoType(), TrigAttrInfo::getData(), Signal::getDataPtr(), Signal::getDataPtrSend(), TrigAttrInfo::getTriggerId(), GSN_ABORT_BACKUP_ORD, ILLEGAL_TRIGGER_ID, jam, jamEntry, JBB, Signal::length(), BackupFormat::LogFile::LogEntry::Length, AbortBackupOrd::LogBufferFull, memcpy, ndbout(), ndbrequire, Ptr< T >::p, pos(), AbortBackupOrd::requestType, AbortBackupOrd::senderData, SimulatedBlock::sendSignal(), BackupFormat::LogFile::LogEntry::TableId, TriggerEvent::TE_DELETE, TriggerEvent::TE_INSERT, TriggerEvent::TE_UPDATE, and BackupFormat::LogFile::LogEntry::TriggerEvent.
Referenced by Backup().
04005 { 04006 jamEntry(); 04007 04008 CRASH_INSERTION((10019)); 04009 04010 TrigAttrInfo * trg = (TrigAttrInfo*)signal->getDataPtr(); 04011 04012 TriggerPtr trigPtr; 04013 c_triggerPool.getPtr(trigPtr, trg->getTriggerId()); 04014 ndbrequire(trigPtr.p->event != ILLEGAL_TRIGGER_ID); // Online... 04015 04016 if(trigPtr.p->errorCode != 0) { 04017 jam(); 04018 return; 04019 }//if 04020 04021 if(trg->getAttrInfoType() == TrigAttrInfo::BEFORE_VALUES) { 04022 jam(); 04026 return; 04027 }//if 04028 04029 BackupFormat::LogFile::LogEntry * logEntry = trigPtr.p->logEntry; 04030 if(logEntry == 0) 04031 { 04032 jam(); 04033 Uint32 * dst; 04034 FsBuffer & buf = trigPtr.p->operation->dataBuffer; 04035 ndbrequire(trigPtr.p->maxRecordSize <= buf.getMaxWrite()); 04036 04037 if(ERROR_INSERTED(10030) || 04038 !buf.getWritePtr(&dst, trigPtr.p->maxRecordSize)) 04039 { 04040 jam(); 04041 Uint32 save[TrigAttrInfo::StaticLength]; 04042 memcpy(save, signal->getDataPtr(), 4*TrigAttrInfo::StaticLength); 04043 BackupRecordPtr ptr; 04044 c_backupPool.getPtr(ptr, trigPtr.p->backupPtr); 04045 trigPtr.p->errorCode = AbortBackupOrd::LogBufferFull; 04046 AbortBackupOrd *ord = (AbortBackupOrd*)signal->getDataPtrSend(); 04047 ord->backupId = ptr.p->backupId; 04048 ord->backupPtr = ptr.i; 04049 ord->requestType = AbortBackupOrd::LogBufferFull; 04050 ord->senderData= ptr.i; 04051 sendSignal(ptr.p->masterRef, GSN_ABORT_BACKUP_ORD, signal, 04052 AbortBackupOrd::SignalLength, JBB); 04053 04054 memcpy(signal->getDataPtrSend(), save, 4*TrigAttrInfo::StaticLength); 04055 return; 04056 }//if 04057 04058 logEntry = (BackupFormat::LogFile::LogEntry *)dst; 04059 trigPtr.p->logEntry = logEntry; 04060 logEntry->Length = 0; 04061 logEntry->TableId = htonl(trigPtr.p->tableId); 04062 04063 04064 if(trigPtr.p->event==0) 04065 logEntry->TriggerEvent= htonl(TriggerEvent::TE_INSERT); 04066 else if(trigPtr.p->event==1) 04067 logEntry->TriggerEvent= htonl(TriggerEvent::TE_UPDATE); 04068 else if(trigPtr.p->event==2) 04069 logEntry->TriggerEvent= htonl(TriggerEvent::TE_DELETE); 04070 else { 04071 ndbout << "Bad Event: " << trigPtr.p->event << endl; 04072 ndbrequire(false); 04073 } 04074 } else { 04075 ndbrequire(logEntry->TableId == htonl(trigPtr.p->tableId)); 04076 // ndbrequire(logEntry->TriggerEvent == htonl(trigPtr.p->event)); 04077 }//if 04078 04079 const Uint32 pos = logEntry->Length; 04080 const Uint32 dataLen = signal->length() - TrigAttrInfo::StaticLength; 04081 memcpy(&logEntry->Data[pos], trg->getData(), dataLen << 2); 04082 04083 logEntry->Length = pos + dataLen; 04084 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::execUTIL_SEQUENCE_CONF | ( | Signal * | signal | ) | [protected] |
Definition at line 1038 of file Backup.cpp.
References c_backupPool, SimulatedBlock::c_mutexMgr, UtilSequenceReq::Create, defineBackupMutex_locked(), ERROR_INSERTED, Signal::getDataPtr(), SimulatedBlock::getOwnNodeId(), GSN_UTIL_LOCK_REQ, GSN_UTIL_SEQUENCE_REQ, Ptr< T >::i, jam, jamEntry, memcpy, mutex, ndbrequire, NdbTick_CurrentMillisecond(), Ptr< T >::p, UtilSequenceConf::requestType, sendBackupRef(), UtilSequenceConf::senderData, sendSTTORRY(), and UtilSequenceConf::sequenceValue.
Referenced by Backup().
01039 { 01040 jamEntry(); 01041 01042 UtilSequenceConf * conf = (UtilSequenceConf*)signal->getDataPtr(); 01043 01044 if(conf->requestType == UtilSequenceReq::Create) 01045 { 01046 jam(); 01047 sendSTTORRY(signal); // At startup in NDB 01048 return; 01049 } 01050 01051 BackupRecordPtr ptr; 01052 ptr.i = conf->senderData; 01053 c_backupPool.getPtr(ptr); 01054 01055 ndbrequire(ptr.p->masterData.gsn == GSN_UTIL_SEQUENCE_REQ); 01056 01057 if (ptr.p->checkError()) 01058 { 01059 jam(); 01060 sendBackupRef(signal, ptr, ptr.p->errorCode); 01061 return; 01062 }//if 01063 01064 if (ERROR_INSERTED(10023)) 01065 { 01066 sendBackupRef(signal, ptr, 323); 01067 return; 01068 }//if 01069 01070 01071 { 01072 Uint64 backupId; 01073 memcpy(&backupId,conf->sequenceValue,8); 01074 ptr.p->backupId= (Uint32)backupId; 01075 } 01076 ptr.p->backupKey[0] = (getOwnNodeId() << 16) | (ptr.p->backupId & 0xFFFF); 01077 ptr.p->backupKey[1] = NdbTick_CurrentMillisecond(); 01078 01079 ptr.p->masterData.gsn = GSN_UTIL_LOCK_REQ; 01080 Mutex mutex(signal, c_mutexMgr, ptr.p->masterData.m_defineBackupMutex); 01081 Callback c = { safe_cast(&Backup::defineBackupMutex_locked), ptr.i }; 01082 ndbrequire(mutex.lock(c)); 01083 01084 return; 01085 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::execUTIL_SEQUENCE_REF | ( | Signal * | signal | ) | [protected] |
Definition at line 995 of file Backup.cpp.
References c_backupPool, Signal::getDataPtr(), GSN_UTIL_SEQUENCE_REQ, Ptr< T >::i, jamEntry, ndbrequire, Ptr< T >::p, sendBackupRef(), UtilSequenceRef::senderData, and BackupRef::SequenceFailure.
Referenced by Backup().
00996 { 00997 BackupRecordPtr ptr; 00998 jamEntry(); 00999 UtilSequenceRef * utilRef = (UtilSequenceRef*)signal->getDataPtr(); 01000 ptr.i = utilRef->senderData; 01001 c_backupPool.getPtr(ptr); 01002 ndbrequire(ptr.p->masterData.gsn == GSN_UTIL_SEQUENCE_REQ); 01003 sendBackupRef(signal, ptr, BackupRef::SequenceFailure); 01004 }//execUTIL_SEQUENCE_REF()
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::execWAIT_GCP_CONF | ( | Signal * | signal | ) | [protected] |
Definition at line 1641 of file Backup.cpp.
References c_backupPool, WaitGCPReq::CompleteForceStart, CRASH_INSERTION, DBDIH_REF, WaitGCPConf::gcp, Signal::getDataPtr(), Signal::getDataPtrSend(), GSN_BACKUP_FRAGMENT_REQ, GSN_WAIT_GCP_REQ, Ptr< T >::i, jam, jamEntry, JBB, masterAbort(), ndbrequire, nextFragment(), Ptr< T >::p, SimulatedBlock::reference(), WaitGCPReq::requestType, WaitGCPReq::senderData, WaitGCPConf::senderData, WaitGCPReq::senderRef, SimulatedBlock::sendSignal(), and sendStopBackup().
Referenced by Backup().
01641 { 01642 jamEntry(); 01643 01644 CRASH_INSERTION((10007)); 01645 01646 WaitGCPConf * conf = (WaitGCPConf*)signal->getDataPtr(); 01647 const Uint32 ptrI = conf->senderData; 01648 const Uint32 gcp = conf->gcp; 01649 01650 BackupRecordPtr ptr; 01651 c_backupPool.getPtr(ptr, ptrI); 01652 01653 ndbrequire(ptr.p->masterRef == reference()); 01654 ndbrequire(ptr.p->masterData.gsn == GSN_WAIT_GCP_REQ); 01655 01656 if(ptr.p->checkError()) { 01657 jam(); 01658 masterAbort(signal, ptr); 01659 return; 01660 }//if 01661 01662 if(ptr.p->masterData.waitGCP.startBackup) { 01663 jam(); 01664 CRASH_INSERTION((10008)); 01665 ptr.p->startGCP = gcp; 01666 ptr.p->masterData.sendCounter= 0; 01667 ptr.p->masterData.gsn = GSN_BACKUP_FRAGMENT_REQ; 01668 nextFragment(signal, ptr); 01669 return; 01670 } else { 01671 jam(); 01672 if(gcp >= ptr.p->startGCP + 3) 01673 { 01674 CRASH_INSERTION((10009)); 01675 ptr.p->stopGCP = gcp; 01681 sendStopBackup(signal, ptr); 01682 return; 01683 }//if 01684 01688 WaitGCPReq * req = (WaitGCPReq*)signal->getDataPtrSend(); 01689 req->senderRef = reference(); 01690 req->senderData = ptr.i; 01691 req->requestType = WaitGCPReq::CompleteForceStart; 01692 sendSignal(DBDIH_REF, GSN_WAIT_GCP_REQ, signal, 01693 WaitGCPReq::SignalLength,JBB); 01694 return; 01695 } 01696 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::execWAIT_GCP_REF | ( | Signal * | signal | ) | [protected] |
Definition at line 1617 of file Backup.cpp.
References c_backupPool, WaitGCPReq::CompleteForceStart, CRASH_INSERTION, DBDIH_REF, Signal::getDataPtr(), Signal::getDataPtrSend(), GSN_WAIT_GCP_REQ, Ptr< T >::i, jamEntry, JBB, ndbrequire, Ptr< T >::p, SimulatedBlock::reference(), WaitGCPReq::requestType, WaitGCPReq::senderData, WaitGCPRef::senderData, WaitGCPReq::senderRef, and SimulatedBlock::sendSignal().
Referenced by Backup().
01618 { 01619 jamEntry(); 01620 01621 CRASH_INSERTION((10006)); 01622 01623 WaitGCPRef * ref = (WaitGCPRef*)signal->getDataPtr(); 01624 const Uint32 ptrI = ref->senderData; 01625 01626 BackupRecordPtr ptr; 01627 c_backupPool.getPtr(ptr, ptrI); 01628 01629 ndbrequire(ptr.p->masterRef == reference()); 01630 ndbrequire(ptr.p->masterData.gsn == GSN_WAIT_GCP_REQ); 01631 01632 WaitGCPReq * req = (WaitGCPReq*)signal->getDataPtrSend(); 01633 req->senderRef = reference(); 01634 req->senderData = ptr.i; 01635 req->requestType = WaitGCPReq::CompleteForceStart; 01636 sendSignal(DBDIH_REF, GSN_WAIT_GCP_REQ, signal, 01637 WaitGCPReq::SignalLength,JBB); 01638 }
Here is the call graph for this function:

Here is the caller graph for this function:

| bool Backup::findTable | ( | const BackupRecordPtr & | , | |
| TablePtr & | , | |||
| Uint32 | tableId | |||
| ) | const |
Definition at line 417 of file Backup.cpp.
References Ptr< T >::i, jam, Ptr< T >::p, and RNIL.
Referenced by createTrigReply(), execBACKUP_FRAGMENT_COMPLETE_REP(), execBACKUP_FRAGMENT_CONF(), execBACKUP_FRAGMENT_REQ(), execCREATE_TRIG_CONF(), execDI_FCOUNTCONF(), execDIGETPRIMCONF(), execGET_TABINFO_CONF(), and sendDropTrig().
00419 { 00420 for(ptr.p->tables.first(tabPtr); 00421 tabPtr.i != RNIL; 00422 ptr.p->tables.next(tabPtr)) { 00423 jam(); 00424 if(tabPtr.p->tableId == tableId){ 00425 jam(); 00426 return true; 00427 }//if 00428 }//for 00429 tabPtr.i = RNIL; 00430 tabPtr.p = 0; 00431 return false; 00432 }
Here is the caller graph for this function:

| void Backup::fragmentCompleted | ( | Signal * | , | |
| BackupFilePtr | ||||
| ) |
Definition at line 3721 of file Backup.cpp.
References BACKUP_REF, backupFragmentRef(), BackupFragmentConf::backupId, BackupFragmentConf::backupPtr, BackupContinueB::BUFFER_FULL_FRAG_COMPLETE, c_backupPool, Backup::OperationRecord::fragComplete(), BackupFragmentConf::fragmentNo, Signal::getDataPtrSend(), GSN_BACKUP_FRAGMENT_CONF, GSN_CONTINUEB, Ptr< T >::i, jam, JBB, Backup::OperationRecord::noOfBytes, BackupFragmentConf::noOfBytesHigh, BackupFragmentConf::noOfBytesLow, Backup::OperationRecord::noOfRecords, BackupFragmentConf::noOfRecordsHigh, BackupFragmentConf::noOfRecordsLow, Ptr< T >::p, SimulatedBlock::sendSignal(), SimulatedBlock::sendSignalWithDelay(), STARTED, BackupFragmentConf::tableId, and Signal::theData.
Referenced by execCONTINUEB(), and execSCAN_FRAGCONF().
03722 { 03723 jam(); 03724 03725 if(filePtr.p->errorCode != 0) 03726 { 03727 jam(); 03728 filePtr.p->scanRunning = 0; 03729 backupFragmentRef(signal, filePtr); // Scan completed 03730 return; 03731 }//if 03732 03733 OperationRecord & op = filePtr.p->operation; 03734 if(!op.fragComplete(filePtr.p->tableId, filePtr.p->fragmentNo)) { 03735 jam(); 03736 signal->theData[0] = BackupContinueB::BUFFER_FULL_FRAG_COMPLETE; 03737 signal->theData[1] = filePtr.i; 03738 sendSignalWithDelay(BACKUP_REF, GSN_CONTINUEB, signal, 50, 2); 03739 return; 03740 }//if 03741 03742 filePtr.p->scanRunning = 0; 03743 03744 BackupRecordPtr ptr; 03745 c_backupPool.getPtr(ptr, filePtr.p->backupPtr); 03746 03747 BackupFragmentConf * conf = (BackupFragmentConf*)signal->getDataPtrSend(); 03748 conf->backupId = ptr.p->backupId; 03749 conf->backupPtr = ptr.i; 03750 conf->tableId = filePtr.p->tableId; 03751 conf->fragmentNo = filePtr.p->fragmentNo; 03752 conf->noOfRecordsLow = (Uint32)(op.noOfRecords & 0xFFFFFFFF); 03753 conf->noOfRecordsHigh = (Uint32)(op.noOfRecords >> 32); 03754 conf->noOfBytesLow = (Uint32)(op.noOfBytes & 0xFFFFFFFF); 03755 conf->noOfBytesHigh = (Uint32)(op.noOfBytes >> 32); 03756 sendSignal(ptr.p->masterRef, GSN_BACKUP_FRAGMENT_CONF, signal, 03757 BackupFragmentConf::SignalLength, JBB); 03758 03759 ptr.p->m_gsn = GSN_BACKUP_FRAGMENT_CONF; 03760 ptr.p->slaveState.setState(STARTED); 03761 return; 03762 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::getFragmentInfo | ( | Signal * | , | |
| BackupRecordPtr | , | |||
| TablePtr | , | |||
| Uint32 | fragNo | |||
| ) |
Definition at line 3200 of file Backup.cpp.
References DBDIH_REF, getFragmentInfoDone(), GSN_DIGETPRIMREQ, Ptr< T >::i, jam, JBB, Ptr< T >::p, RNIL, SimulatedBlock::sendSignal(), and Signal::theData.
Referenced by execDI_FCOUNTCONF(), and execDIGETPRIMCONF().
03202 { 03203 jam(); 03204 03205 for(; tabPtr.i != RNIL; ptr.p->tables.next(tabPtr)) { 03206 jam(); 03207 const Uint32 fragCount = tabPtr.p->fragments.getSize(); 03208 for(; fragNo < fragCount; fragNo ++) { 03209 jam(); 03210 FragmentPtr fragPtr; 03211 tabPtr.p->fragments.getPtr(fragPtr, fragNo); 03212 03213 if(fragPtr.p->scanned == 0 && fragPtr.p->scanning == 0) { 03214 jam(); 03215 signal->theData[0] = RNIL; 03216 signal->theData[1] = ptr.i; 03217 signal->theData[2] = tabPtr.p->tableId; 03218 signal->theData[3] = fragNo; 03219 sendSignal(DBDIH_REF, GSN_DIGETPRIMREQ, signal, 4, JBB); 03220 return; 03221 }//if 03222 }//for 03223 fragNo = 0; 03224 }//for 03225 03226 getFragmentInfoDone(signal, ptr); 03227 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::getFragmentInfoDone | ( | Signal * | , | |
| BackupRecordPtr | ||||
| ) |
Definition at line 3258 of file Backup.cpp.
References DefineBackupConf::backupId, DefineBackupConf::backupPtr, DEFINED, Signal::getDataPtr(), GSN_DEFINE_BACKUP_CONF, Ptr< T >::i, JBB, Ptr< T >::p, and SimulatedBlock::sendSignal().
Referenced by execDEFINE_BACKUP_REQ(), and getFragmentInfo().
03259 { 03260 ptr.p->m_gsn = GSN_DEFINE_BACKUP_CONF; 03261 ptr.p->slaveState.setState(DEFINED); 03262 DefineBackupConf * conf = (DefineBackupConf*)signal->getDataPtr(); 03263 conf->backupPtr = ptr.i; 03264 conf->backupId = ptr.p->backupId; 03265 sendSignal(ptr.p->masterRef, GSN_DEFINE_BACKUP_CONF, signal, 03266 DefineBackupConf::SignalLength, JBB); 03267 }
Here is the call graph for this function:

Here is the caller graph for this function:

| NodeId Backup::getMasterNodeId | ( | ) | const [inline] |
Definition at line 613 of file Backup.hpp.
References c_masterNodeId.
Referenced by execABORT_BACKUP_ORD(), execBACKUP_REQ(), and sendBackupRef().
00613 { return c_masterNodeId; }
Here is the caller graph for this function:

| bool Backup::haveAllSignals | ( | BackupRecordPtr | ptr, | |
| Uint32 | gsn, | |||
| Uint32 | nodeId | |||
| ) |
Definition at line 1154 of file Backup.cpp.
References ndbrequire, Ptr< T >::p, and SimulatedBlock::reference().
Referenced by defineBackupReply(), startBackupReply(), and stopBackupReply().
01155 { 01156 ndbrequire(ptr.p->masterRef == reference()); 01157 ndbrequire(ptr.p->masterData.gsn == gsn); 01158 ndbrequire(!ptr.p->masterData.sendCounter.done()); 01159 ndbrequire(ptr.p->masterData.sendCounter.isWaitingFor(nodeId)); 01160 01161 ptr.p->masterData.sendCounter.clearWaitingFor(nodeId); 01162 return ptr.p->masterData.sendCounter.done(); 01163 }
Here is the call graph for this function:

Here is the caller graph for this function:

| bool Backup::insertFileHeader | ( | BackupFormat::FileType | , | |
| BackupRecord * | , | |||
| BackupFile * | ||||
| ) |
Definition at line 2828 of file Backup.cpp.
References BACKUP_MAGIC, Backup::BackupRecord::backupId, BackupFormat::FileHeader::BackupId, Backup::BackupRecord::backupKey, BackupFormat::FileHeader::BackupKey_0, BackupFormat::FileHeader::BackupKey_1, buf, BackupFormat::FileHeader::ByteOrder, Backup::OperationRecord::dataBuffer, BackupFormat::FILE_HEADER, BackupFormat::FileHeader::FileType, jam, BackupFormat::FileHeader::Magic, memcpy, NDB_VERSION, ndbrequire, BackupFormat::FileHeader::NdbVersion, Backup::BackupFile::operation, BackupFormat::FileHeader::SectionLength, and BackupFormat::FileHeader::SectionType.
Referenced by openFilesReply().
02830 { 02831 FsBuffer & buf = filePtrP->operation.dataBuffer; 02832 02833 const Uint32 sz = sizeof(BackupFormat::FileHeader) >> 2; 02834 02835 Uint32 * dst; 02836 ndbrequire(sz < buf.getMaxWrite()); 02837 if(!buf.getWritePtr(&dst, sz)) { 02838 jam(); 02839 return false; 02840 }//if 02841 02842 BackupFormat::FileHeader* header = (BackupFormat::FileHeader*)dst; 02843 ndbrequire(sizeof(header->Magic) == sizeof(BACKUP_MAGIC)); 02844 memcpy(header->Magic, BACKUP_MAGIC, sizeof(BACKUP_MAGIC)); 02845 header->NdbVersion = htonl(NDB_VERSION); 02846 header->SectionType = htonl(BackupFormat::FILE_HEADER); 02847 header->SectionLength = htonl(sz - 3); 02848 header->FileType = htonl(ft); 02849 header->BackupId = htonl(ptrP->backupId); 02850 header->BackupKey_0 = htonl(ptrP->backupKey[0]); 02851 header->BackupKey_1 = htonl(ptrP->backupKey[1]); 02852 header->ByteOrder = 0x12345678; 02853 02854 buf.updateWritePtr(sz); 02855 return true; 02856 }
Here is the caller graph for this function:

| void Backup::lcp_close_file_conf | ( | Signal * | signal, | |
| BackupRecordPtr | ||||
| ) |
Definition at line 4694 of file Backup.cpp.
References jam, lcp_open_file(), lcp_send_end_lcp_conf(), and Ptr< T >::p.
Referenced by closeFilesDone().
04695 { 04696 if(!ptr.p->tables.isEmpty()) 04697 { 04698 jam(); 04699 lcp_open_file(signal, ptr); 04700 return; 04701 } 04702 04703 lcp_send_end_lcp_conf(signal, ptr); 04704 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::lcp_open_file | ( | Signal * | signal, | |
| BackupRecordPtr | ptr | |||
| ) |
Definition at line 4707 of file Backup.cpp.
References c_backupFilePool, FsOpenReq::fileFlags, FsOpenReq::fileNumber, Signal::getDataPtrSend(), GSN_FSOPENREQ, Ptr< T >::i, JBA, NDBFS_REF, ndbrequire, Ptr< T >::p, SimulatedBlock::reference(), FsOpenReq::S_DATA, SimulatedBlock::sendSignal(), FsOpenReq::setSuffix(), FsOpenReq::setVersion(), FsOpenReq::userPointer, FsOpenReq::userReference, FsOpenReq::v2_setCount(), FsOpenReq::v5_setLcpNo(), and FsOpenReq::v5_setTableId().
Referenced by execLCP_PREPARE_REQ(), and lcp_close_file_conf().
04708 { 04709 FsOpenReq * req = (FsOpenReq *)signal->getDataPtrSend(); 04710 req->userReference = reference(); 04711 req->fileFlags = 04712 FsOpenReq::OM_WRITEONLY | 04713 FsOpenReq::OM_TRUNCATE | 04714 FsOpenReq::OM_CREATE | 04715 FsOpenReq::OM_APPEND; 04716 FsOpenReq::v2_setCount(req->fileNumber, 0xFFFFFFFF); 04717 04718 TablePtr tabPtr; 04719 FragmentPtr fragPtr; 04720 04721 ndbrequire(ptr.p->tables.first(tabPtr)); 04722 tabPtr.p->fragments.getPtr(fragPtr, 0); 04723 04727 BackupFilePtr filePtr; 04728 c_backupFilePool.getPtr(filePtr, ptr.p->dataFilePtr); 04729 ndbrequire(filePtr.p->fileRunning == 0); 04730 filePtr.p->fileClosing = 0; 04731 filePtr.p->fileRunning = 1; 04732 04733 req->userPointer = filePtr.i; 04734 FsOpenReq::setVersion(req->fileNumber, 5); 04735 FsOpenReq::setSuffix(req->fileNumber, FsOpenReq::S_DATA); 04736 FsOpenReq::v5_setLcpNo(req->fileNumber, fragPtr.p->lcp_no); 04737 FsOpenReq::v5_setTableId(req->fileNumber, tabPtr.p->tableId); 04738 sendSignal(NDBFS_REF, GSN_FSOPENREQ, signal, FsOpenReq::SignalLength, JBA); 04739 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::lcp_open_file_done | ( | Signal * | , | |
| BackupRecordPtr | ||||
| ) |
Definition at line 4742 of file Backup.cpp.
References LcpPrepareConf::fragmentId, Signal::getDataPtrSend(), GSN_LCP_PREPARE_CONF, JBB, ndbrequire, Ptr< T >::p, SimulatedBlock::reference(), LcpPrepareConf::senderData, LcpPrepareConf::senderRef, SimulatedBlock::sendSignal(), STARTED, and LcpPrepareConf::tableId.
Referenced by execGET_TABINFO_CONF(), and execLCP_PREPARE_REQ().
04743 { 04744 TablePtr tabPtr; 04745 FragmentPtr fragPtr; 04746 04747 ndbrequire(ptr.p->tables.first(tabPtr)); 04748 tabPtr.p->fragments.getPtr(fragPtr, 0); 04749 04750 ptr.p->slaveState.setState(STARTED); 04751 04752 LcpPrepareConf* conf= (LcpPrepareConf*)signal->getDataPtrSend(); 04753 conf->senderData = ptr.p->clientData; 04754 conf->senderRef = reference(); 04755 conf->tableId = tabPtr.p->tableId; 04756 conf->fragmentId = fragPtr.p->fragmentId; 04757 sendSignal(ptr.p->masterRef, GSN_LCP_PREPARE_CONF, 04758 signal, LcpPrepareConf::SignalLength, JBB); 04759 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::lcp_send_end_lcp_conf | ( | Signal * | signal, | |
| BackupRecordPtr | ||||
| ) |
Definition at line 4789 of file Backup.cpp.
References CLEANING, DEFINED, DEFINING, Signal::getDataPtr(), GSN_END_LCPCONF, INITIAL, JBB, Ptr< T >::p, SimulatedBlock::reference(), EndLcpConf::senderData, EndLcpConf::senderRef, and SimulatedBlock::sendSignal().
Referenced by execEND_LCPREQ(), and lcp_close_file_conf().
04790 { 04791 EndLcpConf* conf= (EndLcpConf*)signal->getDataPtr(); 04792 04793 conf->senderData = ptr.p->clientData; 04794 conf->senderRef = reference(); 04795 04796 ptr.p->errorCode = 0; 04797 ptr.p->slaveState.setState(CLEANING); 04798 ptr.p->slaveState.setState(INITIAL); 04799 ptr.p->slaveState.setState(DEFINING); 04800 ptr.p->slaveState.setState(DEFINED); 04801 04802 sendSignal(ptr.p->masterRef, GSN_END_LCPCONF, 04803 signal, EndLcpConf::SignalLength, JBB); 04804 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::masterAbort | ( | Signal * | , | |
| BackupRecordPtr | ptr | |||
| ) |
Definition at line 2198 of file Backup.cpp.
References BACKUP, AbortBackupOrd::BackupFailure, AbortBackupOrd::backupId, BackupAbortRep::backupId, AbortBackupOrd::backupPtr, CMVMI_REF, Signal::getDataPtrSend(), GSN_ABORT_BACKUP_ORD, GSN_ALTER_TRIG_REQ, GSN_BACKUP_ABORT_REP, GSN_BACKUP_FRAGMENT_REQ, GSN_CREATE_TRIG_REQ, GSN_DEFINE_BACKUP_REQ, GSN_DROP_TRIG_REQ, GSN_EVENT_REP, GSN_START_BACKUP_REQ, GSN_STOP_BACKUP_REQ, GSN_UTIL_LOCK_REQ, GSN_UTIL_SEQUENCE_REQ, GSN_WAIT_GCP_REQ, Ptr< T >::i, jam, JBB, NDB_LE_BackupAborted, ndbassert, ndbout_c(), ndbrequire, Ptr< T >::p, BackupAbortRep::reason, SimulatedBlock::reference(), AbortBackupOrd::requestType, SEND_BACKUP_COMPLETED_FLAG, AbortBackupOrd::senderData, BackupAbortRep::senderData, SimulatedBlock::sendSignal(), sendStopBackup(), and Signal::theData.
Referenced by checkNodeFail(), defineBackupReply(), execBACKUP_FRAGMENT_CONF(), execBACKUP_FRAGMENT_REF(), execWAIT_GCP_CONF(), startBackupReply(), and stopBackupReply().
02199 { 02200 jam(); 02201 #ifdef DEBUG_ABORT 02202 ndbout_c("************ masterAbort"); 02203 #endif 02204 02205 ndbassert(ptr.p->masterRef == reference()); 02206 02207 if(ptr.p->masterData.errorCode != 0) 02208 { 02209 jam(); 02210 return; 02211 } 02212 02213 if (SEND_BACKUP_COMPLETED_FLAG(ptr.p->flags)) 02214 { 02215 BackupAbortRep* rep = (BackupAbortRep*)signal->getDataPtrSend(); 02216 rep->backupId = ptr.p->backupId; 02217 rep->senderData = ptr.p->clientData; 02218 rep->reason = ptr.p->errorCode; 02219 sendSignal(ptr.p->clientRef, GSN_BACKUP_ABORT_REP, signal, 02220 BackupAbortRep::SignalLength, JBB); 02221 } 02222 signal->theData[0] = NDB_LE_BackupAborted; 02223 signal->theData[1] = ptr.p->clientRef; 02224 signal->theData[2] = ptr.p->backupId; 02225 signal->theData[3] = ptr.p->errorCode; 02226 sendSignal(CMVMI_REF, GSN_EVENT_REP, signal, 4, JBB); 02227 02228 ndbrequire(ptr.p->errorCode); 02229 ptr.p->masterData.errorCode = ptr.p->errorCode; 02230 02231 AbortBackupOrd *ord = (AbortBackupOrd*)signal->getDataPtrSend(); 02232 ord->backupId = ptr.p->backupId; 02233 ord->backupPtr = ptr.i; 02234 ord->senderData= ptr.i; 02235 NodeReceiverGroup rg(BACKUP, ptr.p->nodes); 02236 02237 switch(ptr.p->masterData.gsn){ 02238 case GSN_DEFINE_BACKUP_REQ: 02239 ord->requestType = AbortBackupOrd::BackupFailure; 02240 sendSignal(rg, GSN_ABORT_BACKUP_ORD, signal, 02241 AbortBackupOrd::SignalLength, JBB); 02242 return; 02243 case GSN_CREATE_TRIG_REQ: 02244 case GSN_START_BACKUP_REQ: 02245 case GSN_ALTER_TRIG_REQ: 02246 case GSN_WAIT_GCP_REQ: 02247 case GSN_BACKUP_FRAGMENT_REQ: 02248 jam(); 02249 ptr.p->stopGCP= ptr.p->startGCP + 1; 02250 sendStopBackup(signal, ptr); // dropping due to error 02251 return; 02252 case GSN_UTIL_SEQUENCE_REQ: 02253 case GSN_UTIL_LOCK_REQ: 02254 ndbrequire(false); 02255 return; 02256 case GSN_DROP_TRIG_REQ: 02257 case GSN_STOP_BACKUP_REQ: 02258 return; 02259 } 02260 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::masterSendAbortBackup | ( | Signal * | , | |
| BackupRecordPtr | ptr | |||
| ) |
| void Backup::masterTakeOver | ( | Signal * | signal, | |
| BackupRecordPtr | ptr | |||
| ) |
| void Backup::nextFragment | ( | Signal * | , | |
| BackupRecordPtr | ||||
| ) |
Definition at line 1704 of file Backup.cpp.
References BACKUP, BackupFragmentReq::backupId, BackupFragmentReq::backupPtr, BitmaskPOD< size >::clear(), WaitGCPReq::CompleteForceStart, BackupFragmentReq::count, BitmaskPOD< size >::count(), DBDIH_REF, BackupFragmentReq::fragmentNo, BitmaskPOD< size >::get(), Signal::getDataPtrSend(), Array< T >::getSize(), GSN_BACKUP_FRAGMENT_REQ, GSN_WAIT_GCP_REQ, Ptr< T >::i, jam, JBB, ndbrequire, numberToRef(), Ptr< T >::p, SimulatedBlock::reference(), WaitGCPReq::requestType, RNIL, WaitGCPReq::senderData, WaitGCPReq::senderRef, SimulatedBlock::sendSignal(), and BackupFragmentReq::tableId.
Referenced by execBACKUP_FRAGMENT_CONF(), and execWAIT_GCP_CONF().
01705 { 01706 jam(); 01707 01708 BackupFragmentReq* req = (BackupFragmentReq*)signal->getDataPtrSend(); 01709 req->backupPtr = ptr.i; 01710 req->backupId = ptr.p->backupId; 01711 01712 NodeBitmask nodes = ptr.p->nodes; 01713 Uint32 idleNodes = nodes.count(); 01714 Uint32 saveIdleNodes = idleNodes; 01715 ndbrequire(idleNodes > 0); 01716 01717 TablePtr tabPtr; 01718 ptr.p->tables.first(tabPtr); 01719 for(; tabPtr.i != RNIL && idleNodes > 0; ptr.p->tables.next(tabPtr)) { 01720 jam(); 01721 FragmentPtr fragPtr; 01722 Array<Fragment> & frags = tabPtr.p->fragments; 01723 const Uint32 fragCount = frags.getSize(); 01724 01725 for(Uint32 i = 0; i<fragCount && idleNodes > 0; i++) { 01726 jam(); 01727 tabPtr.p->fragments.getPtr(fragPtr, i); 01728 const Uint32 nodeId = fragPtr.p->node; 01729 if(fragPtr.p->scanning != 0) { 01730 jam(); 01731 ndbrequire(nodes.get(nodeId)); 01732 nodes.clear(nodeId); 01733 idleNodes--; 01734 } else if(fragPtr.p->scanned == 0 && nodes.get(nodeId)){ 01735 jam(); 01736 fragPtr.p->scanning = 1; 01737 nodes.clear(nodeId); 01738 idleNodes--; 01739 01740 req->tableId = tabPtr.p->tableId; 01741 req->fragmentNo = i; 01742 req->count = 0; 01743 01744 ptr.p->masterData.sendCounter++; 01745 const BlockReference ref = numberToRef(BACKUP, nodeId); 01746 sendSignal(ref, GSN_BACKUP_FRAGMENT_REQ, signal, 01747 BackupFragmentReq::SignalLength, JBB); 01748 }//if 01749 }//for 01750 }//for 01751 01752 if(idleNodes != saveIdleNodes){ 01753 jam(); 01754 return; 01755 }//if 01756 01760 { 01761 ptr.p->masterData.gsn = GSN_WAIT_GCP_REQ; 01762 ptr.p->masterData.waitGCP.startBackup = false; 01763 01764 WaitGCPReq * req = (WaitGCPReq*)signal->getDataPtrSend(); 01765 req->senderRef = reference(); 01766 req->senderData = ptr.i; 01767 req->requestType = WaitGCPReq::CompleteForceStart; 01768 sendSignal(DBDIH_REF, GSN_WAIT_GCP_REQ, signal, 01769 WaitGCPReq::SignalLength, JBB); 01770 } 01771 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::openFiles | ( | Signal * | signal, | |
| BackupRecordPtr | ptr | |||
| ) |
Definition at line 2601 of file Backup.cpp.
References c_backupFilePool, FsOpenReq::fileFlags, FsOpenReq::fileNumber, Signal::getDataPtrSend(), SimulatedBlock::getOwnNodeId(), GSN_FSOPENREQ, Ptr< T >::i, jam, JBA, NDBFS_REF, ndbrequire, Ptr< T >::p, SimulatedBlock::reference(), FsOpenReq::S_CTL, FsOpenReq::S_DATA, FsOpenReq::S_LOG, SimulatedBlock::sendSignal(), FsOpenReq::setSuffix(), FsOpenReq::setVersion(), FsOpenReq::userPointer, FsOpenReq::userReference, FsOpenReq::v2_setCount(), FsOpenReq::v2_setNodeId(), and FsOpenReq::v2_setSequence().
Referenced by execLIST_TABLES_CONF().
02602 { 02603 jam(); 02604 02605 BackupFilePtr filePtr; 02606 02607 FsOpenReq * req = (FsOpenReq *)signal->getDataPtrSend(); 02608 req->userReference = reference(); 02609 req->fileFlags = 02610 FsOpenReq::OM_WRITEONLY | 02611 FsOpenReq::OM_TRUNCATE | 02612 FsOpenReq::OM_CREATE | 02613 FsOpenReq::OM_APPEND; 02614 FsOpenReq::v2_setCount(req->fileNumber, 0xFFFFFFFF); 02615 02619 c_backupFilePool.getPtr(filePtr, ptr.p->ctlFilePtr); 02620 ndbrequire(filePtr.p->fileRunning == 0); 02621 filePtr.p->fileRunning = 1; 02622 02623 req->userPointer = filePtr.i; 02624 FsOpenReq::setVersion(req->fileNumber, 2); 02625 FsOpenReq::setSuffix(req->fileNumber, FsOpenReq::S_CTL); 02626 FsOpenReq::v2_setSequence(req->fileNumber, ptr.p->backupId); 02627 FsOpenReq::v2_setNodeId(req->fileNumber, getOwnNodeId()); 02628 sendSignal(NDBFS_REF, GSN_FSOPENREQ, signal, FsOpenReq::SignalLength, JBA); 02629 02633 c_backupFilePool.getPtr(filePtr, ptr.p->logFilePtr); 02634 ndbrequire(filePtr.p->fileRunning == 0); 02635 filePtr.p->fileRunning = 1; 02636 02637 req->userPointer = filePtr.i; 02638 FsOpenReq::setVersion(req->fileNumber, 2); 02639 FsOpenReq::setSuffix(req->fileNumber, FsOpenReq::S_LOG); 02640 FsOpenReq::v2_setSequence(req->fileNumber, ptr.p->backupId); 02641 FsOpenReq::v2_setNodeId(req->fileNumber, getOwnNodeId()); 02642 sendSignal(NDBFS_REF, GSN_FSOPENREQ, signal, FsOpenReq::SignalLength, JBA); 02643 02647 c_backupFilePool.getPtr(filePtr, ptr.p->dataFilePtr); 02648 ndbrequire(filePtr.p->fileRunning == 0); 02649 filePtr.p->fileRunning = 1; 02650 02651 req->userPointer = filePtr.i; 02652 FsOpenReq::setVersion(req->fileNumber, 2); 02653 FsOpenReq::setSuffix(req->fileNumber, FsOpenReq::S_DATA); 02654 FsOpenReq::v2_setSequence(req->fileNumber, ptr.p->backupId); 02655 FsOpenReq::v2_setNodeId(req->fileNumber, getOwnNodeId()); 02656 FsOpenReq::v2_setCount(req->fileNumber, 0); 02657 sendSignal(NDBFS_REF, GSN_FSOPENREQ, signal, FsOpenReq::SignalLength, JBA); 02658 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::openFilesReply | ( | Signal * | , | |
| BackupRecordPtr | ptr, | |||
| BackupFilePtr | ||||
| ) |
Definition at line 2701 of file Backup.cpp.
References BACKUP_REF, buf, BackupContinueB::BUFFER_FULL_META, count, BackupFormat::CTL_FILE, BackupFormat::DATA_FILE, defineBackupRef(), DefineBackupRef::FailedInsertFileHeader, DefineBackupRef::FailedInsertTableList, GSN_CONTINUEB, Ptr< T >::i, insertFileHeader(), jam, BackupFormat::LCP_FILE, BackupFormat::LOG_FILE, ndbrequire, Ptr< T >::p, RNIL, BackupFormat::CtlFile::TableList::SectionLength, BackupFormat::CtlFile::TableList::SectionType, SimulatedBlock::sendSignalWithDelay(), BackupContinueB::START_FILE_THREAD, BackupFormat::TABLE_LIST, BackupFormat::CtlFile::TableList::TableIds, and Signal::theData.
Referenced by execFSOPENCONF(), and execFSOPENREF().
02703 { 02704 jam(); 02705 02709 ndbrequire(filePtr.p->fileRunning == 1); 02710 filePtr.p->fileRunning = 0; 02711 02715 for(ptr.p->files.first(filePtr); filePtr.i!=RNIL;ptr.p->files.next(filePtr)) 02716 { 02717 jam(); 02718 if(filePtr.p->fileRunning == 1) { 02719 jam(); 02720 return; 02721 }//if 02722 }//for 02723 02727 if(ptr.p->checkError()) { 02728 jam(); 02729 defineBackupRef(signal, ptr); 02730 return; 02731 }//if 02732 02733 if(!ptr.p->is_lcp()) 02734 { 02738 ptr.p->files.getPtr(filePtr, ptr.p->ctlFilePtr); 02739 if(!insertFileHeader(BackupFormat::CTL_FILE, ptr.p, filePtr.p)) { 02740 jam(); 02741 defineBackupRef(signal, ptr, DefineBackupRef::FailedInsertFileHeader); 02742 return; 02743 }//if 02744 02745 ptr.p->files.getPtr(filePtr, ptr.p->logFilePtr); 02746 if(!insertFileHeader(BackupFormat::LOG_FILE, ptr.p, filePtr.p)) { 02747 jam(); 02748 defineBackupRef(signal, ptr, DefineBackupRef::FailedInsertFileHeader); 02749 return; 02750 }//if 02751 02752 ptr.p->files.getPtr(filePtr, ptr.p->dataFilePtr); 02753 if(!insertFileHeader(BackupFormat::DATA_FILE, ptr.p, filePtr.p)) { 02754 jam(); 02755 defineBackupRef(signal, ptr, DefineBackupRef::FailedInsertFileHeader); 02756 return; 02757 }//if 02758 } 02759 else 02760 { 02761 ptr.p->files.getPtr(filePtr, ptr.p->dataFilePtr); 02762 if(!insertFileHeader(BackupFormat::LCP_FILE, ptr.p, filePtr.p)) { 02763 jam(); 02764 defineBackupRef(signal, ptr, DefineBackupRef::FailedInsertFileHeader); 02765 return; 02766 }//if 02767 02768 ptr.p->ctlFilePtr = ptr.p->dataFilePtr; 02769 } 02770 02774 ptr.p->files.getPtr(filePtr, ptr.p->ctlFilePtr); 02775 filePtr.p->fileRunning = 1; 02776 02777 signal->theData[0] = BackupContinueB::START_FILE_THREAD; 02778 signal->theData[1] = filePtr.i; 02779 sendSignalWithDelay(BACKUP_REF, GSN_CONTINUEB, signal, 100, 2); 02780 02784 FsBuffer & buf = filePtr.p->operation.dataBuffer; 02785 02786 const Uint32 sz = 02787 (sizeof(BackupFormat::CtlFile::TableList) >> 2) + 02788 ptr.p->tables.count() - 1; 02789 02790 Uint32 * dst; 02791 ndbrequire(sz < buf.getMaxWrite()); 02792 if(!buf.getWritePtr(&dst, sz)) { 02793 jam(); 02794 defineBackupRef(signal, ptr, DefineBackupRef::FailedInsertTableList); 02795 return; 02796 }//if 02797 02798 BackupFormat::CtlFile::TableList* tl = 02799 (BackupFormat::CtlFile::TableList*)dst; 02800 tl->SectionType = htonl(BackupFormat::TABLE_LIST); 02801 tl->SectionLength = htonl(sz); 02802 02803 TablePtr tabPtr; 02804 Uint32 count = 0; 02805 for(ptr.p->tables.first(tabPtr); 02806 tabPtr.i != RNIL; 02807 ptr.p->tables.next(tabPtr)){ 02808 jam(); 02809 tl->TableIds[count] = htonl(tabPtr.p->tableId); 02810 count++; 02811 }//for 02812 02813 buf.updateWritePtr(sz); 02814 02818 ndbrequire(ptr.p->tables.first(tabPtr)); 02819 02820 signal->theData[0] = BackupContinueB::BUFFER_FULL_META; 02821 signal->theData[1] = ptr.i; 02822 signal->theData[2] = tabPtr.i; 02823 sendSignalWithDelay(BACKUP_REF, GSN_CONTINUEB, signal, 100, 3); 02824 return; 02825 }
Here is the call graph for this function:

Here is the caller graph for this function:

| bool Backup::parseTableDescription | ( | Signal * | , | |
| BackupRecordPtr | ptr, | |||
| TablePtr | , | |||
| const Uint32 * | , | |||
| Uint32 | ||||
| ) |
Definition at line 2996 of file Backup.cpp.
References DictTabInfo::Attribute::AttributeArraySize, DictTabInfo::Attribute::AttributeArrayType, DictTabInfo::Attribute::AttributeId, DictTabInfo::AttributeMapping, DictTabInfo::AttributeMappingSize, DictTabInfo::Attribute::AttributeNullableFlag, DictTabInfo::Attribute::AttributeSize, DictTabInfo::Attribute::AttributeStorageType, SimpleProperties::Break, Backup::Attribute::COL_FIXED, Backup::Attribute::COL_NULLABLE, count, DefineBackupRef::FailedToAllocateAttributeRecord, SimpleProperties::Reader::first(), ILLEGAL_TRIGGER_ID, DictTabInfo::Attribute::init(), DictTabInfo::Table::init(), jam, NDB_ARRAYTYPE_FIXED, NDB_STORAGETYPE_DISK, ndbrequire, SimpleProperties::Reader::next(), DictTabInfo::Table::NoOfAttributes, Ptr< T >::p, DictTabInfo::Table::RowGCIFlag, DictTabInfo::Table::TableId, DictTabInfo::TableMapping, DictTabInfo::TableMappingSize, DictTabInfo::Table::TableType, DictTabInfo::Table::TableVersion, and SimpleProperties::unpack().
Referenced by execGET_TABINFO_CONF().
03001 { 03002 SimplePropertiesLinearReader it(tabdescptr, len); 03003 03004 it.first(); 03005 03006 DictTabInfo::Table tmpTab; tmpTab.init(); 03007 SimpleProperties::UnpackStatus stat; 03008 stat = SimpleProperties::unpack(it, &tmpTab, 03009 DictTabInfo::TableMapping, 03010 DictTabInfo::TableMappingSize, 03011 true, true); 03012 ndbrequire(stat == SimpleProperties::Break); 03013 03014 bool lcp = ptr.p->is_lcp(); 03015 03016 ndbrequire(tabPtr.p->tableId == tmpTab.TableId); 03017 ndbrequire(lcp || (tabPtr.p->tableType == tmpTab.TableType)); 03018 03026 tabPtr.p->noOfRecords = 0; 03027 tabPtr.p->schemaVersion = tmpTab.TableVersion; 03028 tabPtr.p->noOfAttributes = tmpTab.NoOfAttributes; 03029 tabPtr.p->noOfNull = 0; 03030 tabPtr.p->noOfVariable = 0; // Computed while iterating over attribs 03031 tabPtr.p->sz_FixedAttributes = 0; // Computed while iterating over attribs 03032 tabPtr.p->triggerIds[0] = ILLEGAL_TRIGGER_ID; 03033 tabPtr.p->triggerIds[1] = ILLEGAL_TRIGGER_ID; 03034 tabPtr.p->triggerIds[2] = ILLEGAL_TRIGGER_ID; 03035 tabPtr.p->triggerAllocated[0] = false; 03036 tabPtr.p->triggerAllocated[1] = false; 03037 tabPtr.p->triggerAllocated[2] = false; 03038 03039 Uint32 disk = 0; 03040 const Uint32 count = tabPtr.p->noOfAttributes; 03041 for(Uint32 i = 0; i<count; i++) { 03042 jam(); 03043 DictTabInfo::Attribute tmp; tmp.init(); 03044 stat = SimpleProperties::unpack(it, &tmp, 03045 DictTabInfo::AttributeMapping, 03046 DictTabInfo::AttributeMappingSize, 03047 true, true); 03048 03049 ndbrequire(stat == SimpleProperties::Break); 03050 it.next(); // Move Past EndOfAttribute 03051 03052 const Uint32 arr = tmp.AttributeArraySize; 03053 const Uint32 sz = 1 << tmp.AttributeSize; 03054 const Uint32 sz32 = (sz * arr + 31) >> 5; 03055 03056 if(lcp && tmp.AttributeStorageType == NDB_STORAGETYPE_DISK) 03057 { 03058 disk++; 03059 continue; 03060 } 03061 03062 AttributePtr attrPtr; 03063 if(!tabPtr.p->attributes.seize(attrPtr)) 03064 { 03065 jam(); 03066 ptr.p->setErrorCode(DefineBackupRef::FailedToAllocateAttributeRecord); 03067 return false; 03068 } 03069 03070 attrPtr.p->data.m_flags = 0; 03071 attrPtr.p->data.attrId = tmp.AttributeId; 03072 03073 attrPtr.p->data.m_flags |= 03074 (tmp.AttributeNullableFlag ? Attribute::COL_NULLABLE : 0); 03075 attrPtr.p->data.m_flags |= (tmp.AttributeArrayType == NDB_ARRAYTYPE_FIXED)? 03076 Attribute::COL_FIXED : 0; 03077 attrPtr.p->data.sz32 = sz32; 03078 03083 if(attrPtr.p->data.m_flags & Attribute::COL_FIXED && 03084 !(attrPtr.p->data.m_flags & Attribute::COL_NULLABLE)) { 03085 jam(); 03086 attrPtr.p->data.offset = tabPtr.p->sz_FixedAttributes; 03087 tabPtr.p->sz_FixedAttributes += sz32; 03088 } else { 03089 attrPtr.p->data.offset = ~0; 03090 tabPtr.p->noOfVariable++; 03091 } 03092 }//for 03093 03094 03095 if(lcp) 03096 { 03097 if (disk) 03098 { 03102 tabPtr.p->noOfAttributes -= disk; 03103 03104 { 03105 AttributePtr attrPtr; 03106 ndbrequire(tabPtr.p->attributes.seize(attrPtr)); 03107 03108 Uint32 sz32 = 2; 03109 attrPtr.p->data.attrId = AttributeHeader::DISK_REF; 03110 attrPtr.p->data.m_flags = Attribute::COL_FIXED; 03111 attrPtr.p->data.sz32 = 2; 03112 03113 attrPtr.p->data.offset = tabPtr.p->sz_FixedAttributes; 03114 tabPtr.p->sz_FixedAttributes += sz32; 03115 tabPtr.p->noOfAttributes ++; 03116 } 03117 } 03118 03119 { 03120 AttributePtr attrPtr; 03121 ndbrequire(tabPtr.p->attributes.seize(attrPtr)); 03122 03123 Uint32 sz32 = 2; 03124 attrPtr.p->data.attrId = AttributeHeader::ROWID; 03125 attrPtr.p->data.m_flags = Attribute::COL_FIXED; 03126 attrPtr.p->data.sz32 = 2; 03127 03128 attrPtr.p->data.offset = tabPtr.p->sz_FixedAttributes; 03129 tabPtr.p->sz_FixedAttributes += sz32; 03130 tabPtr.p->noOfAttributes ++; 03131 } 03132 03133 if (tmpTab.RowGCIFlag) 03134 { 03135 AttributePtr attrPtr; 03136 ndbrequire(tabPtr.p->attributes.seize(attrPtr)); 03137 03138 Uint32 sz32 = 2; 03139 attrPtr.p->data.attrId = AttributeHeader::ROW_GCI; 03140 attrPtr.p->data.m_flags = Attribute::COL_FIXED; 03141 attrPtr.p->data.sz32 = 2; 03142 03143 attrPtr.p->data.offset = tabPtr.p->sz_FixedAttributes; 03144 tabPtr.p->sz_FixedAttributes += sz32; 03145 tabPtr.p->noOfAttributes ++; 03146 } 03147 } 03148 return true; 03149 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::removeBackup | ( | Signal * | , | |
| BackupRecordPtr | ptr | |||
| ) |
Definition at line 4563 of file Backup.cpp.
References FsRemoveReq::directory, FsRemoveReq::fileNumber, Signal::getDataPtrSend(), SimulatedBlock::getOwnNodeId(), GSN_FSREMOVEREQ, Ptr< T >::i, jam, JBA, NDBFS_REF, FsRemoveReq::ownDirectory, Ptr< T >::p, SimulatedBlock::reference(), FsOpenReq::S_CTL, SimulatedBlock::sendSignal(), FsOpenReq::setSuffix(), FsOpenReq::setVersion(), FsRemoveReq::userPointer, FsRemoveReq::userReference, FsOpenReq::v2_setNodeId(), and FsOpenReq::v2_setSequence().
04564 { 04565 jam(); 04566 04567 FsRemoveReq * req = (FsRemoveReq *)signal->getDataPtrSend(); 04568 req->userReference = reference(); 04569 req->userPointer = ptr.i; 04570 req->directory = 1; 04571 req->ownDirectory = 1; 04572 FsOpenReq::setVersion(req->fileNumber, 2); 04573 FsOpenReq::setSuffix(req->fileNumber, FsOpenReq::S_CTL); 04574 FsOpenReq::v2_setSequence(req->fileNumber, ptr.p->backupId); 04575 FsOpenReq::v2_setNodeId(req->fileNumber, getOwnNodeId()); 04576 sendSignal(NDBFS_REF, GSN_FSREMOVEREQ, signal, 04577 FsRemoveReq::SignalLength, JBA); 04578 }
Here is the call graph for this function:

| void Backup::sendAbortBackupOrd | ( | Signal * | signal, | |
| BackupRecordPtr | ptr, | |||
| Uint32 | errCode | |||
| ) |
Definition at line 4133 of file Backup.cpp.
References BACKUP, AbortBackupOrd::backupId, AbortBackupOrd::backupPtr, c_nodes, Signal::getDataPtrSend(), GSN_ABORT_BACKUP_ORD, Ptr< T >::i, jam, JBB, numberToRef(), Ptr< T >::p, AbortBackupOrd::requestType, RNIL, AbortBackupOrd::senderData, and SimulatedBlock::sendSignal().
Referenced by stopBackupReply().
04135 { 04136 jam(); 04137 AbortBackupOrd *ord = (AbortBackupOrd*)signal->getDataPtrSend(); 04138 ord->backupId = ptr.p->backupId; 04139 ord->backupPtr = ptr.i; 04140 ord->requestType = requestType; 04141 ord->senderData= ptr.i; 04142 NodePtr node; 04143 for(c_nodes.first(node); node.i != RNIL; c_nodes.next(node)) { 04144 jam(); 04145 const Uint32 nodeId = node.p->nodeId; 04146 if(node.p->alive && ptr.p->nodes.get(nodeId)) { 04147 jam(); 04148 sendSignal(numberToRef(BACKUP, nodeId), GSN_ABORT_BACKUP_ORD, signal, 04149 AbortBackupOrd::SignalLength, JBB); 04150 }//if 04151 }//for 04152 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::sendAbortBackupOrdSlave | ( | Signal * | signal, | |
| BackupRecordPtr | ptr, | |||
| Uint32 | errCode | |||
| ) |
| void Backup::sendAlterTrig | ( | Signal * | , | |
| BackupRecordPtr | ptr | |||
| ) |
| void Backup::sendBackupRef | ( | BlockReference | ref, | |
| Uint32 | flags, | |||
| Signal * | signal, | |||
| Uint32 | senderData, | |||
| Uint32 | errorCode | |||
| ) |
Definition at line 1016 of file Backup.cpp.
References BACKUP, CMVMI_REF, BackupRef::errorCode, Signal::getDataPtrSend(), getMasterNodeId(), GSN_BACKUP_REF, GSN_EVENT_REP, BackupRef::IAmNotMaster, jam, JBB, BackupRef::masterRef, NDB_LE_BackupFailedToStart, numberToRef(), SEND_BACKUP_STARTED_FLAG, BackupRef::senderData, SimulatedBlock::sendSignal(), and Signal::theData.
01018 { 01019 jam(); 01020 if (SEND_BACKUP_STARTED_FLAG(flags)) 01021 { 01022 BackupRef* ref = (BackupRef*)signal->getDataPtrSend(); 01023 ref->senderData = senderData; 01024 ref->errorCode = errorCode; 01025 ref->masterRef = numberToRef(BACKUP, getMasterNodeId()); 01026 sendSignal(senderRef, GSN_BACKUP_REF, signal, BackupRef::SignalLength, JBB); 01027 } 01028 01029 if(errorCode != BackupRef::IAmNotMaster){ 01030 signal->theData[0] = NDB_LE_BackupFailedToStart; 01031 signal->theData[1] = senderRef; 01032 signal->theData[2] = errorCode; 01033 sendSignal(CMVMI_REF, GSN_EVENT_REP, signal, 3, JBB); 01034 } 01035 }
Here is the call graph for this function:

| void Backup::sendBackupRef | ( | Signal * | signal, | |
| BackupRecordPtr | ptr, | |||
| Uint32 | errorCode | |||
| ) |
Definition at line 1008 of file Backup.cpp.
References cleanup(), jam, and Ptr< T >::p.
Referenced by dictCommitTableMutex_locked(), execBACKUP_REQ(), execUTIL_SEQUENCE_CONF(), and execUTIL_SEQUENCE_REF().
01009 { 01010 jam(); 01011 sendBackupRef(ptr.p->clientRef, ptr.p->flags, signal, ptr.p->clientData, errorCode); 01012 cleanup(signal, ptr); 01013 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::sendCreateTrig | ( | Signal * | , | |
| BackupRecordPtr | ptr, | |||
| TablePtr | tabPtr | |||
| ) |
Definition at line 1329 of file Backup.cpp.
References StartBackupRef::backupId, StartBackupRef::backupPtr, createAttributeMask(), DBTUP_REF, StartBackupRef::errorCode, StartBackupRef::FailedToAllocateTriggerRecord, Signal::getDataPtrSend(), SimulatedBlock::getOwnNodeId(), GSN_CREATE_TRIG_REQ, GSN_START_BACKUP_REF, Ptr< T >::i, jam, JBB, StartBackupRef::nodeId, Ptr< T >::p, SimulatedBlock::reference(), RNIL, CreateTrigReq::RT_USER, SimulatedBlock::sendSignal(), CreateTrigReq::setAttributeMask(), CreateTrigReq::setConnectionPtr(), CreateTrigReq::setIndexId(), CreateTrigReq::setMonitorAllAttributes(), CreateTrigReq::setMonitorReplicas(), CreateTrigReq::setOnline(), CreateTrigReq::setReceiverRef(), CreateTrigReq::setRequestType(), CreateTrigReq::setTableId(), CreateTrigReq::setTriggerActionTime(), CreateTrigReq::setTriggerEvent(), CreateTrigReq::setTriggerId(), CreateTrigReq::setTriggerType(), CreateTrigReq::setUserRef(), TriggerType::SUBSCRIPTION, TriggerActionTime::TA_DETACHED, and triggerEventValues.
Referenced by createTrigReply(), and execSTART_BACKUP_REQ().
01331 { 01332 CreateTrigReq * req =(CreateTrigReq *)signal->getDataPtrSend(); 01333 01334 /* 01335 * First, setup the structures 01336 */ 01337 for(Uint32 j=0; j<3; j++) { 01338 jam(); 01339 01340 TriggerPtr trigPtr; 01341 if(!ptr.p->triggers.seize(trigPtr)) { 01342 jam(); 01343 ptr.p->m_gsn = GSN_START_BACKUP_REF; 01344 StartBackupRef* ref = (StartBackupRef*)signal->getDataPtrSend(); 01345 ref->backupPtr = ptr.i; 01346 ref->backupId = ptr.p->backupId; 01347 ref->errorCode = StartBackupRef::FailedToAllocateTriggerRecord; 01348 ref->nodeId = getOwnNodeId(); 01349 sendSignal(ptr.p->masterRef, GSN_START_BACKUP_REF, signal, 01350 StartBackupRef::SignalLength, JBB); 01351 return; 01352 } // if 01353 01354 const Uint32 triggerId= trigPtr.i; 01355 tabPtr.p->triggerIds[j] = triggerId; 01356 tabPtr.p->triggerAllocated[j] = true; 01357 trigPtr.p->backupPtr = ptr.i; 01358 trigPtr.p->tableId = tabPtr.p->tableId; 01359 trigPtr.p->tab_ptr_i = tabPtr.i; 01360 trigPtr.p->logEntry = 0; 01361 trigPtr.p->event = j; 01362 trigPtr.p->maxRecordSize = 4096; 01363 trigPtr.p->operation = 01364 &ptr.p->files.getPtr(ptr.p->logFilePtr)->operation; 01365 trigPtr.p->operation->noOfBytes = 0; 01366 trigPtr.p->operation->noOfRecords = 0; 01367 trigPtr.p->errorCode = 0; 01368 } // for 01369 01370 /* 01371 * now ask DBTUP to create 01372 */ 01373 ptr.p->slaveData.gsn = GSN_CREATE_TRIG_REQ; 01374 ptr.p->slaveData.trigSendCounter = 3; 01375 ptr.p->slaveData.createTrig.tableId = tabPtr.p->tableId; 01376 01377 req->setUserRef(reference()); 01378 req->setReceiverRef(reference()); 01379 req->setConnectionPtr(ptr.i); 01380 req->setRequestType(CreateTrigReq::RT_USER); 01381 01382 Bitmask<MAXNROFATTRIBUTESINWORDS> attrMask; 01383 createAttributeMask(tabPtr, attrMask); 01384 req->setAttributeMask(attrMask); 01385 req->setTableId(tabPtr.p->tableId); 01386 req->setIndexId(RNIL); // not used 01387 req->setTriggerType(TriggerType::SUBSCRIPTION); 01388 req->setTriggerActionTime(TriggerActionTime::TA_DETACHED); 01389 req->setMonitorReplicas(true); 01390 req->setMonitorAllAttributes(false); 01391 req->setOnline(true); 01392 01393 for (int i=0; i < 3; i++) { 01394 req->setTriggerId(tabPtr.p->triggerIds[i]); 01395 req->setTriggerEvent(triggerEventValues[i]); 01396 01397 sendSignal(DBTUP_REF, GSN_CREATE_TRIG_REQ, 01398 signal, CreateTrigReq::SignalLength, JBB); 01399 } 01400 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::sendDefineBackupReq | ( | Signal * | signal, | |
| BackupRecordPtr | ptr | |||
| ) |
Definition at line 1166 of file Backup.cpp.
References BACKUP, DefineBackupReq::backupDataLen, DefineBackupReq::backupId, DefineBackupReq::backupKey, DefineBackupReq::backupPtr, DefineBackupReq::clientData, DefineBackupReq::clientRef, DefineBackupReq::flags, Signal::getDataPtrSend(), GSN_DEFINE_BACKUP_REQ, Ptr< T >::i, jam, JBB, ndbrequire, DefineBackupReq::nodes, Ptr< T >::p, SimulatedBlock::reference(), DefineBackupReq::senderRef, and SimulatedBlock::sendSignal().
Referenced by dictCommitTableMutex_locked().
01167 { 01171 DefineBackupReq * req = (DefineBackupReq*)signal->getDataPtrSend(); 01172 req->backupId = ptr.p->backupId; 01173 req->clientRef = ptr.p->clientRef; 01174 req->clientData = ptr.p->clientData; 01175 req->senderRef = reference(); 01176 req->backupPtr = ptr.i; 01177 req->backupKey[0] = ptr.p->backupKey[0]; 01178 req->backupKey[1] = ptr.p->backupKey[1]; 01179 req->nodes = ptr.p->nodes; 01180 req->backupDataLen = ptr.p->backupDataLen; 01181 req->flags = ptr.p->flags; 01182 01183 ptr.p->masterData.gsn = GSN_DEFINE_BACKUP_REQ; 01184 ptr.p->masterData.sendCounter = ptr.p->nodes; 01185 NodeReceiverGroup rg(BACKUP, ptr.p->nodes); 01186 sendSignal(rg, GSN_DEFINE_BACKUP_REQ, signal, 01187 DefineBackupReq::SignalLength, JBB); 01188 01192 const Uint32 len = ptr.p->backupDataLen; 01193 if(len == 0){ 01197 jam(); 01198 return; 01199 }//if 01200 01204 ndbrequire(0); 01205 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void Backup::sendDropTrig | ( | Signal * | signal, | |
| BackupRecordPtr | ptr, | |||
| TablePtr | tabPtr | |||
| ) |
Definition at line 2003 of file Backup.cpp.
References DBTUP_REF, Signal::getDataPtrSend(), GSN_DROP_TRIG_REQ, Ptr< T >::i, jam, JBB, Ptr< T >::p, SimulatedBlock::reference(), RNIL, DropTrigReq::RT_USER, SimulatedBlock::sendSignal(), DropTrigReq::setConnectionPtr(), DropTrigReq::setIndexId(), DropTrigReq::setRequestType(), DropTrigReq::setTableId(), DropTrigReq::setTriggerActionTime(), DropTrigReq::setTriggerEvent(), DropTrigReq::setTriggerId(), DropTrigReq::setTriggerInfo(), DropTrigReq::setTriggerType(), DropTrigReq::setUserRef(),

