📄 dblqh.hpp
字号:
* The LCP identifier of the LCP's. * =0 means that the LCP number has not been stored. * The LCP identifier is supplied by DIH when starting the LCP. */ UintR lcpId[MAX_LCP_STORED]; UintR maxGciInLcp; /** * This variable contains the maximum global checkpoint * identifier that exists in a certain local checkpoint. * Maximum 4 local checkpoints is possible in this release. */ UintR maxGciCompletedInLcp; UintR srLastGci[4]; UintR srStartGci[4]; /** * The fragment pointers in ACC */ UintR accFragptr[2]; /** * The EXEC_SR variables are used to keep track of which fragments * that are interested in being executed as part of executing the * fragment loop. * It is initialised for every phase of executing the * fragment log (the fragment log can be executed upto four times). * * Each execution is capable of executing the log records on four * fragment replicas. */ /** * Requesting block reference for executing the fragment log * in this phase. */ BlockReference execSrBlockref[4]; /** * This variable contains references to active scan and copy * fragment operations on the fragment. * A maximum of four concurrently active is allowed. */ typedef Bitmask<4> ScanNumberMask; ScanNumberMask m_scanNumberMask; DLList<ScanRecord>::Head m_activeScans; DLFifoList<ScanRecord>::Head m_queuedScans; Uint16 srLqhLognode[4]; /** * The fragment pointers in TUP and TUX */ UintR tupFragptr[2]; UintR tuxFragptr[2]; /** * This queue is where operations are put when blocked in ACC * during start of a local chkp. */ UintR accBlockedList; /** * This is the queue where all operations that are active on the * fragment is put. * This is used to deduct when the fragment do * no longer contain any active operations. * This is needed when starting a local checkpoint. */ UintR activeList; /** * This variable keeps track of how many operations that are * active that have skipped writing the log but not yet committed * or aborted. This is used during start of fragment. */ UintR activeTcCounter; /** * This status specifies whether this fragment is actively * engaged in executing the fragment log. */ ExecSrStatus execSrStatus; /** * The fragment id of this fragment. */ UintR fragId; /** * Status of fragment */ FragStatus fragStatus; /** * Indicates a local checkpoint is active and thus can generate * UNDO log records. */ UintR fragActiveStatus; /** * Reference to current LCP record. * If no LCP is ongoing on the fragment then the value is RNIL. * If LCP_REF /= RNIL then a local checkpoint is ongoing in the * fragment. * LCP_STATE in LCP_RECORD specifies the state of the * local checkpoint. */ UintR lcpRef; /** * This flag indicates whether logging is currently activated at * the fragment. * During a system restart it is temporarily shut off. * Some fragments have it permanently shut off. */ LogFlag logFlag; UintR masterPtr; /** * This variable contains the maximum global checkpoint identifier * which was completed when the local checkpoint was started. */ /** * Reference to the next fragment record in a free list of fragment * records. */ UintR nextFrag; /** * The newest GCI that has been committed on fragment */ UintR newestGci; SrStatus srStatus; UintR srUserptr; /** * The starting global checkpoint of this fragment. */ UintR startGci; /** * A reference to the table owning this fragment. */ UintR tabRef; /** * This is the queue to put operations that have been blocked * during start of a local chkp. */ UintR firstWaitQueue; UintR lastWaitQueue; /** * The block reference to ACC on the fragment makes it * possible to have different ACC blocks for different * fragments in the future. */ BlockReference accBlockref; /** * Ordered index block. */ BlockReference tuxBlockref; /** * The master block reference as sent in COPY_ACTIVEREQ. */ BlockReference masterBlockref; /** * These variables are used during system restart to recall * from which node to execute the fragment log and which GCI's * this node should start and stop from. Also to remember who * to send the response to when system restart is completed. */ BlockReference srBlockref; /** * The block reference to TUP on the fragment makes it * possible to have different TUP blocks for different * fragments in the future. */ BlockReference tupBlockref; /** * This state indicates if the fragment will participate in a * checkpoint. * Temporary tables with Fragrecord::logFlag permanently off * will also have Fragrecord::lcpFlag off. */ LcpFlag lcpFlag; /** * Used to ensure that updates started with old * configuration do not arrive here after the copy fragment * has started. * If they are allowed to arrive after they * could update a record that has already been replicated to * the new node. This type of arrival should be extremely * rare but we must anyway ensure that no harm is done. */ Uint16 copyNode; /** * This variable ensures that only one copy fragment is * active at a time on the fragment. */ Uint8 copyFragState; /** * The number of fragment replicas that will execute the log * records in this round of executing the fragment * log. Maximum four is possible. */ Uint8 execSrNoReplicas; /** * This variable contains what type of replica this fragment * is. Two types are possible: * - Primary/Backup replica = 0 * - Stand-by replica = 1 * * It is not possible to distinguish between primary and * backup on a fragment. * This can only be done per transaction. * DIH can change from primary to backup without informing * the various replicas about this change. */ Uint8 fragCopy; /** * This is the last fragment distribution key that we have * heard of. */ Uint8 fragDistributionKey; /** * The identity of the next local checkpoint this fragment * should perform. */ Uint8 nextLcp; /** * How many local checkpoints does the fragment contain */ Uint8 srChkpnr; Uint8 srNoLognodes; /** * Table type. */ Uint8 tableType; /** * For ordered index fragment, i-value of corresponding * fragment in primary table. */ UintR tableFragptr; }; typedef Ptr<Fragrecord> FragrecordPtr; /* $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ */ /* $$$$$$$ GLOBAL CHECKPOINT RECORD $$$$$$ */ /* $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ */ /** * This record describes a global checkpoint that is * completed. It waits for all log records belonging to this * global checkpoint to be saved on disk. */ struct GcpRecord { /** * The file number within each log part where the log was * located when gcp_savereq was received. The last record * belonging to this global checkpoint is certainly before * this place in the log. We could come even closer but it * would cost performance and doesn't seem like a good * idea. This is simple and it works. */ Uint16 gcpFilePtr[4]; /** * The page number within the file for each log part. */ Uint16 gcpPageNo[4]; /** * The word number within the last page that was written for * each log part. */ Uint16 gcpWordNo[4]; /** * The identity of this global checkpoint. */ UintR gcpId; /** * The state of this global checkpoint, one for each log part. */ Uint8 gcpLogPartState[4]; /** * The sync state of this global checkpoint, one for each * log part. */ Uint8 gcpSyncReady[4]; /** * User pointer of the sender of gcp_savereq (= master DIH). */ UintR gcpUserptr; /** * Block reference of the sender of gcp_savereq * (= master DIH). */ BlockReference gcpBlockref; }; // Size 44 bytes typedef Ptr<GcpRecord> GcpRecordPtr; struct HostRecord { bool inPackedList; UintR noOfPackedWordsLqh; UintR packedWordsLqh[30]; UintR noOfPackedWordsTc; UintR packedWordsTc[29]; BlockReference hostLqhBlockRef; BlockReference hostTcBlockRef; };// Size 128 bytes typedef Ptr<HostRecord> HostRecordPtr; /* $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ */ /* $$$$$$$ LOCAL CHECKPOINT RECORD $$$$$$$ */ /* $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ */ /** * This record contains the information about a local * checkpoint that is ongoing. This record is also used as a * system restart record. */ struct LcpRecord { LcpRecord() { m_EMPTY_LCP_REQ.clear(); } enum LcpState { LCP_IDLE = 0, LCP_COMPLETED = 2, LCP_WAIT_FRAGID = 3, LCP_WAIT_TUP_PREPLCP = 4, LCP_WAIT_HOLDOPS = 5, LCP_WAIT_ACTIVE_FINISH = 6, LCP_START_CHKP = 7, LCP_BLOCKED_COMP = 8, LCP_SR_WAIT_FRAGID = 9, LCP_SR_STARTED = 10, LCP_SR_COMPLETED = 11 }; Uint32 firstLcpLocAcc; Uint32 firstLcpLocTup; Uint32 lcpAccptr; LcpState lcpState; bool lastFragmentFlag; struct FragOrd { Uint32 fragPtrI; LcpFragOrd lcpFragOrd; }; FragOrd currentFragment; bool lcpQueued; FragOrd queuedFragment; bool reportEmpty; NdbNodeBitmask m_EMPTY_LCP_REQ; }; // Size 76 bytes typedef Ptr<LcpRecord> LcpRecordPtr; /* $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ */ /* $$$$$$ LOCAL CHECKPOINT SUPPORT RECORD $$$$$$$ */ /* $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ */ /** * This record contains the information about an outstanding
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -