21 #include <ndb_limits.h>
23 #include <SimulatedBlock.hpp>
24 #include <DLHashTable.hpp>
27 #include <DLFifoList.hpp>
28 #include <DataBuffer.hpp>
29 #include <Bitmask.hpp>
30 #include <AttributeList.hpp>
31 #include <signaldata/AttrInfo.hpp>
32 #include <signaldata/LqhTransConf.hpp>
33 #include <signaldata/LqhKey.hpp>
34 #include <signaldata/TrigAttrInfo.hpp>
35 #include <signaldata/TcIndx.hpp>
36 #include <signaldata/TransIdAI.hpp>
37 #include <signaldata/EventReport.hpp>
38 #include <trigger_definitions.h>
39 #include <SignalCounter.hpp>
47 #define ZAPI_CONNECT_FILESIZE 20
50 #define ZCOMMIT_SETUP 2
51 #define ZCONTINUE_ABORT_080 4
52 #define ZGCP_FILESIZE 10
57 #define ZLASTPHASE 255
58 #define ZNODEBUF_FILESIZE 2000
59 #define ZNR_OF_SEIZE 10
60 #define ZSCANREC_FILE_SIZE 100
61 #define ZSCAN_FRAGREC_FILE_SIZE 400
62 #define ZSCAN_OPREC_FILE_SIZE 400
64 #define ZTABREC_FILESIZE 16
65 #define ZTAKE_OVER_ACTIVE 1
66 #define ZTAKE_OVER_IDLE 0
67 #define ZTC_CONNECT_FILESIZE 200
68 #define ZTCOPCONF_SIZE 6
73 #define ZNO_CONCURRENCY_ERROR 242
74 #define ZTOO_HIGH_CONCURRENCY_ERROR 244
75 #define ZNO_SCANREC_ERROR 245
76 #define ZNO_FRAGMENT_ERROR 246
77 #define ZSCAN_AI_LEN_ERROR 269
78 #define ZSCAN_LQH_ERROR 270
79 #define ZSCAN_FRAG_LQH_ERROR 274
81 #define ZSCANTIME_OUT_ERROR 296
82 #define ZSCANTIME_OUT_ERROR2 297
87 #define ZSTATE_ERROR 202
88 #define ZLENGTH_ERROR 207 // Also Scan
89 #define ZERO_KEYLEN_ERROR 208
90 #define ZSIGNAL_ERROR 209
91 #define ZGET_ATTRBUF_ERROR 217 // Also Scan
92 #define ZGET_DATAREC_ERROR 218
93 #define ZMORE_AI_IN_TCKEYREQ_ERROR 220
94 #define ZCOMMITINPROGRESS 230
95 #define ZROLLBACKNOTALLOWED 232
96 #define ZNO_FREE_TC_CONNECTION 233 // Also Scan
97 #define ZABORTINPROGRESS 237
98 #define ZPREPAREINPROGRESS 238
99 #define ZWRONG_SCHEMA_VERSION_ERROR 241 // Also Scan
100 #define ZSCAN_NODE_ERROR 250
101 #define ZTRANS_STATUS_ERROR 253
102 #define ZTIME_OUT_ERROR 266
103 #define ZSIMPLE_READ_WITHOUT_AI 271
104 #define ZNO_AI_WITH_UPDATE 272
105 #define ZSEIZE_API_COPY_ERROR 275
106 #define ZSCANINPROGRESS 276
107 #define ZABORT_ERROR 277
108 #define ZCOMMIT_TYPE_ERROR 278
110 #define ZNO_FREE_TC_MARKER 279
111 #define ZNODE_SHUTDOWN_IN_PROGRESS 280
112 #define ZCLUSTER_SHUTDOWN_IN_PROGRESS 281
113 #define ZWRONG_STATE 282
114 #define ZCLUSTER_IN_SINGLEUSER_MODE 299
116 #define ZDROP_TABLE_IN_PROGRESS 283
117 #define ZNO_SUCH_TABLE 284
118 #define ZUNKNOWN_TABLE_ERROR 285
119 #define ZNODEFAIL_BEFORE_COMMIT 286
120 #define ZINDEX_CORRUPT_ERROR 287
121 #define ZSCAN_FRAGREC_ERROR 291
126 #define ZNO_FREE_API_CONNECTION 219
127 #define ZSYSTEM_NOT_STARTED_ERROR 203
132 #define ZINVALID_CONNECTION 229
135 #define ZNOT_FOUND 626
136 #define ZALREADYEXIST 630
137 #define ZNOTUNIQUE 893
139 #define ZINVALID_KEY 290
140 #define ZUNLOCKED_IVAL_TOO_HIGH 294
141 #define ZUNLOCKED_OP_HAS_BAD_STATE 295
142 #define ZBAD_DIST_KEY 298
143 #define ZTRANS_TOO_BIG 261
161 CS_START_PREPARING = 5,
162 CS_REC_PREPARING = 6,
166 CS_COMPLETE_SENT = 10,
167 CS_PREPARE_TO_COMMIT = 11,
169 CS_START_COMMITTING = 13,
171 CS_REC_COMMITTING = 15,
172 CS_WAIT_ABORT_CONF = 16,
173 CS_WAIT_COMPLETE_CONF = 17,
174 CS_WAIT_COMMIT_CONF = 18,
175 CS_FAIL_ABORTING = 19,
176 CS_FAIL_ABORTED = 20,
177 CS_FAIL_PREPARED = 21,
178 CS_FAIL_COMMITTING = 22,
179 CS_FAIL_COMMITTED = 23,
180 CS_FAIL_COMPLETED = 24,
194 enum OperationState {
207 OS_WAIT_KEYINFO = 13,
209 OS_WAIT_COMMIT_CONF = 15,
210 OS_WAIT_ABORT_CONF = 16,
211 OS_WAIT_COMPLETE_CONF = 17,
214 OS_FIRE_TRIG_REQ = 19,
238 enum SystemStartState {
243 enum TimeOutCheckState {
251 RS_TC_COMMITCONF = 3,
252 RS_TCROLLBACKCONF = 4,
256 enum IndexOperationState {
258 IOS_INDEX_ACCESS = 1,
259 IOS_INDEX_ACCESS_WAIT_FOR_TCKEYCONF = 2,
260 IOS_INDEX_ACCESS_WAIT_FOR_TRANSID_AI = 3
271 enum IndexTransIdAIState {
272 ITAS_WAIT_HEADER = 0,
273 ITAS_WAIT_FRAGID = 1,
275 ITAS_ALL_RECEIVED = 3,
276 ITAS_WAIT_KEY_FAIL = 4
371 Uint32 oldTriggerIds[2];
373 inline void print(NdbOut & s)
const {
374 s <<
"[DefinedTriggerData = " <<
triggerId <<
"]";
393 UintR c_transactionBufferSpace;
471 inline void print(NdbOut & s)
const {
472 s <<
"[FiredTriggerData = " <<
triggerId <<
"]";
475 inline Uint32 hashValue()
const {
479 inline bool equal(
const TcFiredTriggerData &
rec)
const {
492 Uint32 c_maxNumberOfDefinedTriggers;
493 Uint32 c_maxNumberOfFiredTriggers;
575 UintR c_maxNumberOfIndexes;
579 indexOpState(IOS_NOOP),
581 keyInfoSectionIVal(RNIL),
583 attrInfoSectionIVal(RNIL),
584 transIdAIState(ITAS_WAIT_HEADER),
586 transIdAISectionIVal(RNIL),
587 indexReadTcConnect(RNIL)
596 IndexOperationState indexOpState;
597 Uint32 pendingKeyInfo;
598 Uint32 keyInfoSectionIVal;
599 Uint32 pendingAttrInfo;
600 Uint32 attrInfoSectionIVal;
601 IndexTransIdAIState transIdAIState;
602 Uint32 pendingTransIdAI;
603 Uint32 transIdAISectionIVal;
607 UintR connectionIndex;
608 UintR indexReadTcConnect;
630 UintR c_maxNumberOfIndexOperations;
656 inline void setApiConTimer(Uint32 apiConPtrI, Uint32 value, Uint32 line){
657 c_apiConTimer[apiConPtrI] = value;
658 c_apiConTimer_line[apiConPtrI] = line;
661 inline Uint32 getApiConTimer(Uint32 apiConPtrI)
const {
662 return c_apiConTimer[apiConPtrI];
664 UintR* c_apiConTimer;
665 UintR* c_apiConTimer_line;
670 m_special_op_flags(0),
672 theSeizedIndexOperations(seizedIndexOpPool)
680 UintR firstTcConnect;
687 UintR currSavePointId;
695 UintR nextGcpConnect;
696 UintR prevGcpConnect;
704 UintR nextApiConnect;
705 BlockReference ndbapiBlockref;
707 Uint64 globalcheckpointid;
718 Int32 pendingTriggers;
722 UintR commitAckMarker;
725 Uint32 no_commit_ack_markers;
726 Uint32 m_write_count;
727 ReturnSignal returnsignal;
728 AbortState abortState;
730 enum TransactionFlags
732 TF_INDEX_OP_RETURN = 1,
733 TF_TRIGGER_PENDING = 2,
735 TF_COMMIT_ACK_MARKER_RECEIVED = 8,
736 TF_DEFERRED_CONSTRAINTS = 16,
737 TF_DEFERRED_TRIGGERS = 32,
742 Uint8 m_special_op_flags;
745 Uint8 currentReplicaNo;
751 Uint8 timeOutCounter;
752 Uint8 singleUserMode;
761 UintR currentTcConnect;
762 BlockReference tcBlockref;
778 UintR tcSendArray[6];
798 Uint32 immediateTriggerId;
800 UintR accumulatingIndexOp;
801 UintR executingIndexOp;
802 UintR tcIndxSendArray[6];
806 Uint32 continueBCount;
808 Uint8 m_pre_commit_pass;
810 bool isExecutingDeferredTriggers()
const {
842 UintR nextTcFailHash;
849 Uint16 lastLqhNodeId;
850 Uint16 m_execAbortOption;
851 UintR commitAckMarker;
856 OperationState tcConnectstate;
868 Uint8 m_special_op_flags;
869 enum SpecialOpFlags {
871 SOF_INDEX_TABLE_READ = 1,
872 SOF_INDEX_BASE_TABLE_ACCESS = 2,
873 SOF_REORG_TRIGGER_BASE = 4,
874 SOF_REORG_TRIGGER = 4 | 16,
875 SOF_REORG_MOVING = 8,
878 SOF_REORG_DELETE = 64,
879 SOF_DEFERRED_TRIGGER = 128
882 static inline bool isIndexOp(Uint8
flags) {
884 flags == SOF_INDEX_TABLE_READ ||
885 flags == SOF_INDEX_BASE_TABLE_ACCESS;
897 Uint16 tcNodedata[4];
899 Uint16 lqhInstanceKey;
902 UintR noFiredTriggers;
903 UintR noReceivedTriggers;
904 UintR triggerExecutionCount;
905 UintR savedState[LqhKeyConf::SignalLength];
907 UintR triggeringOperation;
911 UintR currentTriggerId;
928 Uint32 keyInfoSectionI;
929 Uint32 attrInfoSectionI;
939 Uint8 distributionKeyIndicator;
941 UintR distributionKey;
953 Uint8 m_special_hash;
955 Uint8 m_no_disk_flag;
957 Uint8 lenAiInTckeyreq;
959 Uint8 fragmentDistributionKey;
968 Uint8 isLongTcKeyReq;
969 Uint8 useLongLqhKeyReq;
974 Uint32 scanTakeOverInd;
990 HostState hostStatus;
991 LqhTransState lqhTransStatus;
993 UintR noOfPackedWordsLqh;
994 UintR packedWordsLqh[26];
995 UintR noOfWordsTCKEYCONF;
996 UintR packedWordsTCKEYCONF[30];
997 BlockReference hostLqhBlockRef;
1002 NF_CHECK_SCAN = 0x2,
1003 NF_CHECK_TRANSACTION = 0x4,
1004 NF_BLOCK_HANDLE = 0x8,
1005 NF_NODE_FAIL_BITS = 0xF
1021 Uint32 currentSchemaVersion;
1024 Uint8 singleUserMode;
1027 TR_ENABLED = 1 << 0,
1028 TR_DROPPING = 1 << 1,
1029 TR_STORED_TABLE = 1 << 2,
1030 TR_PREPARED = 1 << 3
1031 ,TR_USER_DEFINED_PARTITIONING = 1 << 4
1033 Uint8 get_enabled()
const {
return (m_flags & TR_ENABLED) != 0; }
1034 Uint8 get_dropping()
const {
return (m_flags & TR_DROPPING) != 0; }
1035 Uint8 get_storedTable()
const {
return (m_flags & TR_STORED_TABLE) != 0; }
1036 Uint8 get_prepared()
const {
return (m_flags & TR_PREPARED) != 0; }
1037 void set_enabled(Uint8 f) { f ? m_flags |= (Uint16)TR_ENABLED : m_flags &= ~(Uint16)TR_ENABLED; }
1038 void set_dropping(Uint8 f) { f ? m_flags |= (Uint16)TR_DROPPING : m_flags &= ~(Uint16)TR_DROPPING; }
1039 void set_storedTable(Uint8 f) { f ? m_flags |= (Uint16)TR_STORED_TABLE : m_flags &= ~(Uint16)TR_STORED_TABLE; }
1040 void set_prepared(Uint8 f) { f ? m_flags |= (Uint16)TR_PREPARED : m_flags &= ~(Uint16)TR_PREPARED; }
1042 Uint8 get_user_defined_partitioning()
const {
1043 return (m_flags & TR_USER_DEFINED_PARTITIONING) != 0;
1046 void set_user_defined_partitioning(Uint8 f) {
1048 m_flags |= (Uint16)TR_USER_DEFINED_PARTITIONING :
1049 m_flags &= ~(Uint16)TR_USER_DEFINED_PARTITIONING;
1054 Uint8 noOfDistrKeys;
1058 return !get_dropping() &&
1060 get_enabled() && table_version_major(schemaVersion) == table_version_major(currentSchemaVersion))
1066 get_prepared() && schemaVersion == currentSchemaVersion &&
1067 DictTabInfo::isUniqueIndex(tableType)));
1070 Uint32 getErrorCode(Uint32 schemaVersion)
const;
1084 scanFragState = IDLE;
1106 WAIT_GET_PRIMCONF = 1,
1109 QUEUED_FOR_DELIVERY = 6,
1113 Uint32 scanFragTimer;
1119 BlockReference lqhBlockref;
1123 Uint32 m_connectCount;
1132 Uint8 m_scan_frag_conf_status;
1134 inline void startFragTimer(Uint32 timeVal){
1135 scanFragTimer = timeVal;
1137 inline void stopFragTimer(
void){
1218 WAIT_SCAN_TAB_INFO = 1,
1220 WAIT_FRAGMENT_COUNT = 3,
1229 union { Uint32 m_queued_count; Uint32 scanReceivedOperations; };
1235 Uint32 scanNextFragId;
1244 union { Uint32 scanAiLength; Uint32 m_booked_fragments_count; };
1255 Uint32 scanParallel;
1258 Uint32 scanSchemaVersion;
1261 Uint32 scanStoredProcId;
1264 Uint32 scanTableref;
1265 Uint32 m_scan_cookie;
1271 Uint16 first_batch_size_rows;
1272 Uint16 batch_size_rows;
1274 Uint32 batch_byte_size;
1275 Uint32 m_scan_block_no;
1277 Uint32 scanRequestInfo;
1280 bool m_close_scan_req;
1284 bool m_pass_all_confs;
1304 Uint16 gcpNomoretransRec;
1305 UintR gcpUnused1[2];
1306 UintR firstApiConnect;
1307 UintR lastApiConnect;
1320 Uint16 queueList[MAX_NDB_NODES];
1321 Uint8 takeOverProcState[MAX_NDB_NODES];
1322 UintR completedTakeOver;
1323 UintR currentHashIndexTakeOver;
1324 FailState failStatus;
1326 Uint16 takeOverNode;
1336 BLOCK_DEFINES(
Dbtc);
1339 void execPACKED_SIGNAL(
Signal* signal);
1340 void execABORTED(
Signal* signal);
1341 void execATTRINFO(
Signal* signal);
1342 void execCONTINUEB(
Signal* signal);
1343 void execKEYINFO(
Signal* signal);
1344 void execSCAN_NEXTREQ(
Signal* signal);
1345 void execSCAN_PROCREQ(
Signal* signal);
1346 void execSCAN_PROCCONF(
Signal* signal);
1347 void execTAKE_OVERTCREQ(
Signal* signal);
1348 void execTAKE_OVERTCCONF(
Signal* signal);
1349 void execLQHKEYREF(
Signal* signal);
1350 void execTRANSID_AI_R(
Signal* signal);
1351 void execKEYINFO20_R(
Signal* signal);
1352 void execROUTE_ORD(
Signal* signal);
1354 void execDUMP_STATE_ORD(
Signal* signal);
1355 void execDBINFO_SCANREQ(
Signal* signal);
1356 void execSEND_PACKED(
Signal* signal);
1357 void execCOMPLETED(
Signal* signal);
1358 void execCOMMITTED(
Signal* signal);
1359 void execDIGETNODESREF(
Signal* signal);
1360 void execDIH_SCAN_GET_NODES_REF(
Signal* signal);
1361 void execDIH_SCAN_GET_NODES_CONF(
Signal* signal);
1362 void execDIVERIFYCONF(
Signal* signal);
1363 void execDIH_SCAN_TAB_REF(
Signal* signal);
1364 void execDIH_SCAN_TAB_CONF(
Signal* signal);
1365 void execGCP_NOMORETRANS(
Signal* signal);
1366 void execLQHKEYCONF(
Signal* signal);
1367 void execNDB_STTOR(
Signal* signal);
1368 void execREAD_NODESCONF(
Signal* signal);
1369 void execREAD_NODESREF(
Signal* signal);
1370 void execSTTOR(
Signal* signal);
1371 void execTC_COMMITREQ(
Signal* signal);
1372 void execTC_CLOPSIZEREQ(
Signal* signal);
1373 void execTCGETOPSIZEREQ(
Signal* signal);
1374 void execTCKEYREQ(
Signal* signal);
1375 void execTCRELEASEREQ(
Signal* signal);
1376 void execTCSEIZEREQ(
Signal* signal);
1377 void execTCROLLBACKREQ(
Signal* signal);
1378 void execTC_HBREP(
Signal* signal);
1379 void execTC_SCHVERREQ(
Signal* signal);
1380 void execTAB_COMMITREQ(
Signal* signal);
1381 void execSCAN_TABREQ(
Signal* signal);
1382 void execSCAN_TABINFO(
Signal* signal);
1383 void execSCAN_FRAGCONF(
Signal* signal);
1384 void execSCAN_FRAGREF(
Signal* signal);
1385 void execREAD_CONFIG_REQ(
Signal* signal);
1386 void execLQH_TRANSCONF(
Signal* signal);
1387 void execCOMPLETECONF(
Signal* signal);
1388 void execCOMMITCONF(
Signal* signal);
1389 void execABORTCONF(
Signal* signal);
1390 void execNODE_FAILREP(
Signal* signal);
1391 void execINCL_NODEREQ(
Signal* signal);
1392 void execTIME_SIGNAL(
Signal* signal);
1393 void execAPI_FAILREQ(
Signal* signal);
1394 void execSCAN_HBREP(
Signal* signal);
1396 void execABORT_ALL_REQ(
Signal* signal);
1398 void execCREATE_TRIG_IMPL_REQ(
Signal* signal);
1399 void execDROP_TRIG_IMPL_REQ(
Signal* signal);
1400 void execFIRE_TRIG_ORD(
Signal* signal);
1401 void execTRIG_ATTRINFO(
Signal* signal);
1402 void execCREATE_INDX_IMPL_REQ(
Signal* signal);
1403 void execDROP_INDX_IMPL_REQ(
Signal* signal);
1404 void execTCINDXREQ(
Signal* signal);
1405 void execINDXKEYINFO(
Signal* signal);
1406 void execINDXATTRINFO(
Signal* signal);
1407 void execALTER_INDX_IMPL_REQ(
Signal* signal);
1408 void execSIGNAL_DROPPED_REP(
Signal* signal);
1410 void execFIRE_TRIG_REF(
Signal*);
1411 void execFIRE_TRIG_CONF(
Signal*);
1414 void execTCKEYCONF(
Signal* signal);
1415 void execTCKEYREF(
Signal* signal);
1416 void execTRANSID_AI(
Signal* signal);
1417 void execTCROLLBACKREP(
Signal* signal);
1419 void execCREATE_TAB_REQ(
Signal* signal);
1420 void execPREP_DROP_TAB_REQ(
Signal* signal);
1421 void execDROP_TAB_REQ(
Signal* signal);
1422 void checkWaitDropTabFailedLqh(
Signal*, Uint32 nodeId, Uint32 tableId);
1423 void execALTER_TAB_REQ(
Signal* signal);
1424 void set_timeout_value(Uint32 timeOut);
1425 void set_appl_timeout_value(Uint32 timeOut);
1426 void set_no_parallel_takeover(Uint32);
1432 void clearTcNodeData(
Signal* signal,
1433 UintR TLastLqhIndicator,
1435 void errorReport(
Signal* signal,
int place);
1436 void warningReport(
Signal* signal,
int place);
1437 void printState(
Signal* signal,
int place);
1438 int seizeTcRecord(
Signal* signal);
1439 int seizeCacheRecord(
Signal* signal);
1440 void TCKEY_abort(
Signal* signal,
int place);
1441 void copyFromToLen(UintR* sourceBuffer, UintR* destBuffer, UintR copyLen);
1442 void reportNodeFailed(
Signal* signal, Uint32 nodeId);
1443 void sendPackedTCKEYCONF(
Signal* signal,
1447 Uint32 sendCommitLqh(
Signal* signal,
1449 Uint32 sendCompleteLqh(
Signal* signal,
1458 Uint32 gsn, Uint32 len);
1459 void execTCKEY_FAILREFCONF_R(
Signal* signal);
1460 void checkStartTimeout(
Signal* signal);
1461 void checkStartFragTimeout(
Signal* signal);
1462 void timeOutFoundFragLab(
Signal* signal, Uint32 TscanConPtr);
1463 void timeOutLoopStartFragLab(
Signal* signal, Uint32 TscanConPtr);
1464 int releaseAndAbort(
Signal* signal);
1465 void findApiConnectFail(
Signal* signal);
1466 void findTcConnectFail(
Signal* signal, Uint32 instanceKey);
1467 void initApiConnectFail(
Signal* signal);
1468 void initTcConnectFail(
Signal* signal, Uint32 instanceKey);
1469 void initTcFail(
Signal* signal);
1470 void releaseTakeOver(
Signal* signal);
1471 void setupFailData(
Signal* signal);
1472 void updateApiStateFail(
Signal* signal);
1473 void updateTcStateFail(
Signal* signal, Uint32 instanceKey);
1474 void handleApiFailState(
Signal* signal, UintR anApiConnectptr);
1475 void handleFailedApiNode(
Signal* signal,
1477 UintR anApiConnectPtr);
1478 void handleScanStop(
Signal* signal, UintR aFailedNode);
1479 void initScanTcrec(
Signal* signal);
1481 const UintR scanParallel,
1482 const UintR noOprecPerFrag,
1483 const Uint32 aiLength,
1484 const Uint32 keyLength);
1485 void initScanfragrec(
Signal* signal);
1493 void checkGcp(
Signal* signal);
1494 void commitGciHandling(
Signal* signal, Uint64 Tgci);
1496 void DIVER_node_fail_handling(
Signal* signal, Uint64 Tgci);
1497 void gcpTcfinished(
Signal* signal, Uint64 gci);
1499 void hash(
Signal* signal);
1500 bool handle_special_hash(Uint32 dstHash[4],
1501 const Uint32* src, Uint32 srcLen,
1502 Uint32 tabPtrI,
bool distr);
1504 void initApiConnect(
Signal* signal);
1505 void initApiConnectRec(
Signal* signal,
1507 bool releaseIndexOperations =
false);
1508 void initgcp(
Signal* signal);
1509 void inithost(
Signal* signal);
1510 void initialiseScanrec(
Signal* signal);
1511 void initialiseScanFragrec(
Signal* signal);
1512 void initialiseScanOprec(
Signal* signal);
1513 void initTable(
Signal* signal);
1514 void initialiseTcConnect(
Signal* signal);
1517 void linkTcInConnectionlist(
Signal* signal);
1518 void releaseAbortResources(
Signal* signal);
1519 void releaseApiCon(
Signal* signal, UintR aApiConnectPtr);
1520 void releaseApiConCopy(
Signal* signal);
1521 void releaseApiConnectFail(
Signal* signal);
1522 void releaseAttrinfo();
1525 void releaseDirtyWrite(
Signal* signal);
1526 void releaseTcCon();
1527 void releaseTcConnectFail(
Signal* signal);
1528 void releaseTransResources(
Signal* signal);
1529 void seizeApiConnect(
Signal* signal);
1530 void seizeApiConnectCopy(
Signal* signal);
1531 void seizeApiConnectFail(
Signal* signal);
1532 void crash_gcp(Uint32 line);
1534 void seizeTcConnect(
Signal* signal);
1535 void seizeTcConnectFail(
Signal* signal);
1537 bool sendAttrInfoTrain(
Signal* signal,
1541 Uint32 attrInfoIVal);
1542 void sendContinueTimeOutControl(
Signal* signal, Uint32 TapiConPtr);
1543 void sendlqhkeyreq(
Signal* signal,
1544 BlockReference TBRef);
1545 void sendSystemError(
Signal* signal,
int line);
1546 void sendtckeyconf(
Signal* signal, UintR TcommitFlag);
1549 void unlinkReadyTcCon(
Signal* signal);
1550 void handleFailedOperation(
Signal* signal,
1558 int saveINDXKEYINFO(
Signal* signal,
1563 int saveINDXATTRINFO(
Signal* signal,
1568 bool saveTRANSID_AI(
Signal* signal,
1573 void readIndexTable(
Signal* signal,
1576 void executeIndexOperation(
Signal* signal,
1587 void saveTriggeringOpState(
Signal* signal,
1589 void restoreTriggeringOpState(
Signal* signal,
1596 void executeTrigger(
Signal* signal,
1600 void executeIndexTrigger(
Signal* signal,
1605 bool appendAttrDataToSection(Uint32& sectionIVal,
1610 void insertIntoIndexTable(
Signal* signal,
1615 void deleteFromIndexTable(
Signal* signal,
1621 void executeReorgTrigger(
Signal* signal,
1631 void warningHandlerLab(
Signal* signal,
int line);
1632 void systemErrorLab(
Signal* signal,
int line);
1633 void sendSignalErrorRefuseLab(
Signal* signal);
1634 void scanTabRefLab(
Signal* signal, Uint32 errCode);
1636 void signalErrorRefuseLab(
Signal* signal);
1637 void abort080Lab(
Signal* signal);
1638 void sendKeyInfoTrain(
Signal* signal,
1639 BlockReference TBRef,
1642 Uint32 keyInfoIVal);
1644 bool not_started =
false);
1645 void sendAbortedAfterTimeout(
Signal* signal,
int Tcheck);
1646 void abort010Lab(
Signal* signal);
1647 void abort015Lab(
Signal* signal);
1648 void packLqhkeyreq(
Signal* signal,
1649 BlockReference TBRef);
1650 void packLqhkeyreq040Lab(
Signal* signal,
1651 BlockReference TBRef);
1652 void returnFromQueuedDeliveryLab(
Signal* signal);
1653 void startTakeOverLab(
Signal* signal);
1654 void toCompleteHandlingLab(
Signal* signal);
1655 void toCommitHandlingLab(
Signal* signal);
1656 void toAbortHandlingLab(
Signal* signal);
1657 void abortErrorLab(
Signal* signal);
1658 void nodeTakeOverCompletedLab(
Signal* signal);
1659 void ndbsttorry010Lab(
Signal* signal);
1660 void commit020Lab(
Signal* signal);
1661 void complete010Lab(
Signal* signal);
1662 void releaseAtErrorLab(
Signal* signal);
1663 void seizeDatabuferrorLab(
Signal* signal);
1664 void appendToSectionErrorLab(
Signal* signal);
1665 void scanKeyinfoLab(
Signal* signal);
1666 void scanAttrinfoLab(
Signal* signal, UintR Tlen);
1667 void attrinfoDihReceivedLab(
Signal* signal);
1668 void aiErrorLab(
Signal* signal);
1669 void scanReleaseResourcesLab(
Signal* signal);
1670 void scanCompletedLab(
Signal* signal);
1672 void diverify010Lab(
Signal* signal);
1673 void intstartphase3x010Lab(
Signal* signal);
1674 void sttorryLab(
Signal* signal);
1675 void abortBeginErrorLab(
Signal* signal);
1676 void tabStateErrorLab(
Signal* signal);
1677 void wrongSchemaVersionErrorLab(
Signal* signal);
1678 void noFreeConnectionErrorLab(
Signal* signal);
1679 void tckeyreq050Lab(
Signal* signal);
1680 void timeOutFoundLab(
Signal* signal, UintR anAdd, Uint32 errCode);
1681 void completeTransAtTakeOverLab(
Signal* signal, UintR TtakeOverInd);
1682 void completeTransAtTakeOverDoLast(
Signal* signal, UintR TtakeOverInd);
1683 void completeTransAtTakeOverDoOne(
Signal* signal, UintR TtakeOverInd);
1684 void timeOutLoopStartLab(
Signal* signal, Uint32 apiConnectPtr);
1685 void initialiseRecordsLab(
Signal* signal, UintR Tdata0, Uint32, Uint32);
1686 void tckeyreq020Lab(
Signal* signal);
1687 void intstartphase1x010Lab(
Signal* signal);
1688 void startphase1x010Lab(
Signal* signal);
1690 void lqhKeyConf_checkTransactionState(
Signal * signal,
1693 void checkDropTab(
Signal* signal);
1695 void checkScanActiveInFailedLqh(
Signal* signal,
1697 Uint32 failedNodeId);
1701 void nodeFailCheckTransactions(
Signal*,Uint32 transPtrI,Uint32 failedNodeId);
1702 void ndbdFailBlockCleanupCallback(
Signal* signal, Uint32 failedNodeId, Uint32 ignoredRc);
1703 void checkNodeFailComplete(
Signal* signal, Uint32 failedNodeId, Uint32 bit);
1705 void apiFailBlockCleanupCallback(
Signal* signal, Uint32 failedNodeId, Uint32 ignoredRc);
1706 bool isRefreshSupported()
const;
1713 virtual bool getParam(
const char*
name, Uint32* count);
1722 UintR capiConnectFilesize;
1726 UintR ctcConnectFilesize;
1730 UintR ccacheFilesize;
1734 UintR chostFilesize;
1737 Uint32 c_ongoing_take_over_cnt;
1742 UintR ctabrecFilesize;
1745 UintR tdistrHashValue;
1749 UintR coperationsize;
1751 UintR cDbHbInterval;
1756 struct MonotonicCounters {
1757 Uint64 cattrinfoCount;
1759 Uint64 ccommitCount;
1761 Uint64 csimpleReadCount;
1764 Uint64 c_scan_count;
1765 Uint64 c_range_scan_count;
1768 Uint32 cconcurrentOp;
1770 MonotonicCounters() :
1775 csimpleReadCount(0),
1779 c_range_scan_count(0),
1782 Uint32 build_event_rep(
Signal* signal)
1788 const Uint32 attrinfoCount = diff(signal, 1, cattrinfoCount);
1789 const Uint32 transCount = diff(signal, 3, ctransCount);
1790 const Uint32 commitCount = diff(signal, 5, ccommitCount);
1791 const Uint32 readCount = diff(signal, 7, creadCount);
1792 const Uint32 simpleReadCount = diff(signal, 9, csimpleReadCount);
1793 const Uint32 writeCount = diff(signal, 11, cwriteCount);
1794 const Uint32 abortCount = diff(signal, 13, cabortCount);
1795 const Uint32 scan_count = diff(signal, 15, c_scan_count);
1796 const Uint32 range_scan_count = diff(signal, 17, c_range_scan_count);
1799 signal->theData[1] = transCount;
1800 signal->theData[2] = commitCount;
1801 signal->theData[3] = readCount;
1802 signal->theData[4] = simpleReadCount;
1803 signal->theData[5] = writeCount;
1804 signal->theData[6] = attrinfoCount;
1805 signal->theData[7] = cconcurrentOp;
1806 signal->theData[8] = abortCount;
1807 signal->theData[9] = scan_count;
1808 signal->theData[10] = range_scan_count;
1812 Uint32 build_continueB(
Signal* signal)
const
1815 const Uint64* vars[] = {
1816 &cattrinfoCount, &ctransCount, &ccommitCount,
1817 &creadCount, &csimpleReadCount, &cwriteCount,
1818 &cabortCount, &c_scan_count, &c_range_scan_count };
1819 const size_t num =
sizeof(vars)/
sizeof(vars[0]);
1821 for (
size_t i = 0;
i < num;
i++)
1823 signal->theData[1+
i*2] = Uint32(*vars[
i] >> 32);
1824 signal->theData[1+
i*2+1] = Uint32(*vars[
i]);
1829 Uint32 diff(
Signal* signal,
size_t pos, Uint64 curr)
const
1832 (signal->theData[pos+1] | (Uint64(signal->theData[pos]) << 32));
1833 return (Uint32)(curr - old);
1840 UintR cfirstfreeTcConnect;
1841 UintR cfirstfreeApiConnectCopy;
1842 UintR cfirstfreeCacheRec;
1846 UintR cfirstfreeGcp;
1847 UintR cfirstfreeScanrec;
1849 TableRecordPtr tabptr;
1850 UintR cfirstfreeApiConnectFail;
1851 UintR cfirstfreeApiConnect;
1853 BlockReference cdihblockref;
1854 BlockReference cownref;
1856 ApiConnectRecordPtr timeOutptr;
1858 ScanRecord *scanRecord;
1859 UintR cscanrecFileSize;
1862 ScanFragRecPtr scanFragptr;
1864 UintR cscanFragrecFileSize;
1866 BlockReference cdictblockref;
1867 BlockReference cerrorBlockref;
1868 BlockReference clqhblockref;
1869 BlockReference cndbcntrblockref;
1872 Uint16 csystemnodes;
1874 NodeId cmasterNodeId;
1875 UintR cnoParallelTakeOver;
1876 TimeOutCheckState ctimeOutCheckFragActive;
1878 UintR ctimeOutCheckFragCounter;
1879 UintR ctimeOutCheckCounter;
1880 UintR ctimeOutValue;
1881 UintR ctimeOutCheckDelay;
1882 Uint32 ctimeOutCheckHeartbeat;
1883 Uint32 ctimeOutCheckLastHeartbeat;
1884 Uint32 ctimeOutMissedHeartbeats;
1885 Uint32 c_appl_timeout_value;
1887 SystemStartState csystemStart;
1888 TimeOutCheckState ctimeOutCheckActive;
1890 BlockReference capiFailRef;
1891 UintR cpackedListIndex;
1892 Uint16 cpackedList[MAX_NODES];
1893 UintR capiConnectClosing[MAX_NODES];
1894 UintR con_lineNodes;
1903 BlockReference tblockref;
1905 LqhTransConf::OperationStatus ttransStatus;
1907 NodeId tfailedNodeId;
1908 Uint8 tcurrentReplicaNo;
1920 BlockReference tusersblkref;
1928 UintR ctransidFailHash[512];
1929 UintR ctcConnectFailHash[1024];
1939 union { Uint32 nextPool; Uint32 nextHash; };
1941 Uint32 apiConnectPtr;
1946 return ((p.transid1 == transid1) && (p.transid2 == transid2));
1949 inline Uint32 hashValue()
const {
1961 void execTC_COMMIT_ACK(
Signal* signal);
1963 void sendRemoveMarker(
Signal* signal,
1967 void removeMarkerForFailedAPI(
Signal* signal, Uint32 nodeId, Uint32
bucket);
1969 bool getAllowStartTransaction(Uint32 nodeId, Uint32 table_single_user_mode)
const {
1972 if (
getNodeState().getSingleUserApi() == nodeId || table_single_user_mode)
1980 void checkAbortAllTimeout(
Signal* signal, Uint32 sleepTime);
1981 struct AbortAllRecord {
1982 AbortAllRecord(){ clientRef = 0; }
1984 BlockReference clientRef;
1986 Uint32 oldTimeOutValue;
1988 AbortAllRecord c_abortRec;
1990 bool validate_filter(
Signal*);
1991 bool match_and_print(
Signal*, ApiConnectRecordPtr);
1994 bool testFragmentDrop(
Signal* signal);
2030 UintR cfirstfreeTcConnectFail;
2086 TcFailRecord *tcFailRecord;
2087 TcFailRecordPtr tcNodeFailptr;
2104 Uint32 c_lastFailedApi;
2106 Uint32 m_deferred_enabled;
2107 Uint32 m_max_writes_per_trans;