21 #include <ndb_limits.h>
22 #include <SimulatedBlock.hpp>
24 #include <NodeBitmask.hpp>
28 #include <DLCFifoList.hpp>
29 #include <KeyTable.hpp>
30 #include <DataBuffer.hpp>
31 #include <SignalCounter.hpp>
32 #include <AttributeHeader.hpp>
33 #include <AttributeList.hpp>
35 #include <signaldata/UtilSequence.hpp>
36 #include <signaldata/SumaImpl.hpp>
37 #include <ndbapi/NdbDictionary.hpp>
55 void execSUB_ABORT_SYNC_REQ(
Signal* signal);
61 void execGET_TABINFO_CONF(
Signal* signal);
63 void execGET_TABLEID_CONF(
Signal* signal);
64 void execGET_TABLEID_REF(
Signal* signal);
68 void execCREATE_TAB_CONF(
Signal* signal);
70 void execDICT_LOCK_REF(
Signal*);
71 void execDICT_LOCK_CONF(
Signal*);
77 void execSCAN_FRAGREF(
Signal* signal);
78 void execSCAN_FRAGCONF(
Signal* signal);
79 void execTRANSID_AI(
Signal* signal);
80 void execKEYINFO20(
Signal* signal);
81 void execSUB_SYNC_CONTINUE_REF(
Signal* signal);
82 void execSUB_SYNC_CONTINUE_CONF(
Signal* signal);
96 void execDIH_SCAN_TAB_CONF(
Signal* signal);
97 void execDIH_SCAN_GET_NODES_REF(
Signal* signal);
99 void execCHECKNODEGROUPSCONF(
Signal *signal);
100 void execGCP_PREPARE(
Signal *signal);
115 void execCREATE_NODEGROUP_IMPL_REQ(
Signal*);
116 void execDROP_NODEGROUP_IMPL_REQ(
Signal*);
119 void suma_ndbrequire(
bool v);
125 Uint8 m_lqhInstanceKey;
148 union { Uint32 nextPool; Uint32 prevList; };
160 , cerrorInsert(s.cerrorInsert)
169 Uint32 m_subscriptionPtrI;
171 Uint32 m_requestInfo;
187 Uint32 m_currentNoOfAttributes;
194 void completeScan(
Signal*,
int error= 0);
200 BlockNumber number()
const {
return suma.number(); }
202 void progError(
int line,
int cause,
const char *
extra) {
206 Uint32 prevList; Uint32 ptrI;
207 union { Uint32 nextPool; Uint32 nextList; };
209 friend struct SyncRecord;
221 R_SUB_ABORT_START_REQ
228 Uint32 m_subscriberRef;
229 Uint32 m_subscriberData;
242 Uint32 m_subscriptionId;
243 Uint32 m_subscriptionKey;
244 Uint32 m_subscriptionType;
245 Uint32 m_schemaTransId;
250 REPORT_SUBSCRIBE = 0x2,
251 MARKED_DROPPED = 0x4,
270 TriggerState m_trigger_state;
279 Uint32 m_outstanding_trigger;
280 Uint32 m_triggers[3];
282 Uint32 nextList, prevList;
284 union { Uint32 prevHash; Uint32 nextPool; };
286 Uint32 hashValue()
const {
287 return m_subscriptionId + m_subscriptionKey;
292 m_subscriptionId == s.m_subscriptionId &&
293 m_subscriptionKey == s.m_subscriptionKey;
305 Table() { m_tableId = ~0; }
326 union { Uint32 m_tableId; Uint32 key; };
327 Uint32 m_schemaVersion;
331 Uint32 m_noOfAttributes;
337 union { Uint32 prevHash; Uint32 nextPool; };
338 Uint32 hashValue()
const {
341 bool equal(
const Table&
rec)
const {
342 return m_tableId == rec.m_tableId;
346 Uint32 m_schemaTransId;
369 Uint32 c_maxBufferedEpochs;
372 Uint32 c_failedApiNodesState[MAX_NODES];
379 void sendSubIdRef(
Signal* signal,Uint32 senderRef,Uint32 senderData,Uint32 errorCode);
381 void sendSubCreateRef(
Signal* signal, Uint32 ref, Uint32 data, Uint32 error);
382 void sendSubStartRef(
Signal* signal, Uint32 ref, Uint32 data, Uint32 error);
383 void sendSubStopRef(
Signal* signal, Uint32 ref, Uint32 data, Uint32 error);
384 void report_sub_stop_conf(
Signal* signal,
390 void sendSubSyncRef(
Signal* signal, Uint32 errorCode);
393 void sendSubStopReq(
Signal* signal,
bool unlock=
false);
397 void send_sub_start_stop_event(
Signal *signal,
399 NdbDictionary::Event::_TableEvent
event,
403 Uint32 getFirstGCI(
Signal* signal);
409 bool check_sub_start(Uint32 subscriberRef);
423 void execDROP_SUBSCRIPTION_REQ(
Signal* signal);
425 void execSTART_SUBSCRIPTION_REQ(
Signal* signal);
426 void execSTOP_SUBSCRIPTION_REQ(
Signal* signal);
428 void execSYNC_SUBSCRIPTION_REQ(
Signal* signal);
429 void execABORT_SYNC_REQ(
Signal* signal);
436 void execREAD_CONFIG_REQ(
Signal* signal);
439 void sendSTTORRY(
Signal*);
440 void execNDB_STTOR(
Signal* signal);
441 void execDUMP_STATE_ORD(
Signal* signal);
442 void execDBINFO_SCANREQ(
Signal* signal);
443 void execREAD_NODESCONF(
Signal* signal);
444 void execNODE_FAILREP(
Signal* signal);
446 void execSIGNAL_DROPPED_REP(
Signal* signal);
447 void execAPI_START_REP(
Signal* signal);
448 void execAPI_FAILREQ(
Signal* signal) ;
450 void api_fail_gci_list(
Signal*, Uint32 node);
453 void api_fail_block_cleanup(
Signal* signal, Uint32 failedNode);
454 void api_fail_block_cleanup_callback(
Signal* signal,
456 Uint32 elementsCleaned);
458 void execSUB_GCP_COMPLETE_ACK(
Signal* signal);
466 void execSUB_DROP_REF(
Signal* signal);
467 void execSUB_DROP_CONF(
Signal* signal);
469 void execSUB_START_REF(
Signal* signal);
470 void execSUB_START_CONF(
Signal* signal);
472 void execSUB_ABORT_SYNC_REF(
Signal* signal);
473 void execSUB_ABORT_SYNC_CONF(
Signal* signal);
476 void execSUMA_START_ME_REF(
Signal* signal);
477 void execSUMA_START_ME_CONF(
Signal* signal);
486 void execSUMA_HANDOVER_REQ(
Signal* signal);
487 void execSUMA_HANDOVER_REF(
Signal* signal);
488 void execSUMA_HANDOVER_CONF(
Signal* signal);
494 void createSequenceReply(
Signal* signal,
497 void execUTIL_SEQUENCE_CONF(
Signal* signal);
498 void execUTIL_SEQUENCE_REF(
Signal* signal);
499 void execCREATE_SUBID_REQ(
Signal* signal);
512 NodeId c_masterNodeId;
520 bool m_wait_handover;
521 Uint32 m_restart_server_node_id;
530 bool m_wait_handover;
538 Uint16 m_waiting_on_self;
546 Uint32 c_current_seq;
547 Uint32 c_outstanding_drop_trig_req;
556 Uint32 c_noNodesInGroup;
557 Uint32 c_nodesInGroup[MAX_REPLICAS];
560 void send_dict_lock_req(
Signal* signal, Uint32 state);
561 void send_dict_unlock_ord(
Signal* signal, Uint32 state);
562 void send_start_me_req(
Signal* signal);
563 void check_start_handover(
Signal* signal);
564 void send_handover_req(
Signal* signal, Uint32
type);
566 Uint32 get_responsible_node(Uint32 B)
const;
567 Uint32 get_responsible_node(Uint32 B,
const NdbNodeBitmask& mask)
const;
568 bool check_switchover(Uint32
bucket, Uint64 gci);
570 void fix_nodegroup();
585 BUCKET_STARTING = 0x1
586 ,BUCKET_HANDOVER = 0x2
587 ,BUCKET_TAKEOVER = 0x4
589 ,BUCKET_CREATED_SELF = 0x10
590 ,BUCKET_CREATED_OTHER = 0x20
591 ,BUCKET_CREATED_MASK = (BUCKET_CREATED_SELF | BUCKET_CREATED_OTHER)
592 ,BUCKET_DROPPED_SELF = 0x40
593 ,BUCKET_DROPPED_OTHER = 0x80
594 ,BUCKET_DROPPED_MASK = (BUCKET_DROPPED_SELF | BUCKET_DROPPED_OTHER)
595 ,BUCKET_SHUTDOWN = 0x100
596 ,BUCKET_SHUTDOWN_TO = 0x200
599 Uint16 m_switchover_node;
600 Uint16 m_nodes[MAX_REPLICAS];
601 Uint32 m_buffer_tail;
602 Uint64 m_switchover_gci;
603 Uint64 m_max_acked_gci;
604 Page_pos m_buffer_head;
609 STATIC_CONST( DATA_WORDS = 8192 - 10);
610 STATIC_CONST( GCI_SZ32 = 2 );
617 Uint32 m_page_chunk_ptr_i;
622 Uint32 m_data[DATA_WORDS];
625 STATIC_CONST( NO_OF_BUCKETS = 24 );
626 Uint32 c_no_of_buckets;
627 struct Bucket c_buckets[NO_OF_BUCKETS];
628 Uint32 c_subscriber_per_node[MAX_NODES];
630 STATIC_CONST( BUCKET_MASK_SIZE = (((NO_OF_BUCKETS+31)>> 5)) );
632 Bucket_mask m_active_buckets;
633 Bucket_mask m_switchover_buckets;
636 Uint32* get_buffer_ptr(
Signal*, Uint32 buck, Uint64 gci, Uint32 sz);
638 void free_page(Uint32 page_id, Buffer_page*
page);
639 void out_of_buffer(
Signal*);
640 void out_of_buffer_release(
Signal* signal, Uint32 buck);
644 Uint32 page_pos, Uint64 last_gci);
647 Uint64 get_current_gci(
Signal*);
649 void checkMaxBufferedEpochs(
Signal *signal);
651 Uint64 m_max_seen_gci;
652 Uint64 m_max_sent_gci;
653 Uint64 m_last_complete_gci;
654 Uint64 m_out_of_buffer_gci;
655 Uint32 m_gcp_complete_rep_count;
683 Uint32 m_first_free_page;
688 Uint64 m_gcp_monitor;
691 struct SubGcpCompleteCounter
697 Uint32 m_gcp_rep_cnt;
698 Uint32 m_min_gcp_rep_counter_index;
699 Uint32 m_max_gcp_rep_counter_index;
700 struct SubGcpCompleteCounter m_gcp_rep_counter[10];
703 Uint32 b_dti_buf[MAX_WORDS_META_FILE];
704 Uint64 m_current_gci;
707 Uint32 m_typeOfStart;