23 #include <SimulatedBlock.hpp>
24 #include <ndb_limits.h>
25 #include <signaldata/StopReq.hpp>
26 #include <signaldata/ResumeReq.hpp>
27 #include <signaldata/DictTabInfo.hpp>
28 #include <signaldata/CntrStart.hpp>
29 #include <signaldata/CheckNodeGroups.hpp>
31 #include <NodeState.hpp>
43 #define ZNO_NDB_BLOCKS 6
45 #define ZNOT_AVAILABLE 913
50 #define ZBLOCK_STTOR 3
52 #define ZSIZE_NDB_BLOCKS_REC 16
53 #define ZSIZE_SYSTAB 2048
54 #define ZSTART_PHASE_1 1
55 #define ZSTART_PHASE_2 2
56 #define ZSTART_PHASE_3 3
57 #define ZSTART_PHASE_4 4
58 #define ZSTART_PHASE_5 5
59 #define ZSTART_PHASE_6 6
60 #define ZSTART_PHASE_7 7
61 #define ZSTART_PHASE_8 8
62 #define ZSTART_PHASE_9 9
63 #define ZSTART_PHASE_END 255
87 Uint32 m_lastGciNodeId;
89 Uint64 m_startPartialTimeout;
90 Uint64 m_startPartitionedTimeout;
91 Uint64 m_startFailureTimeout;
95 } m_logNodes[MAX_NDB_NODES];
96 Uint32 m_logNodesCount;
98 Uint32 m_wait_sp[MAX_NDB_NODES];
102 BlockReference blockref;
115 DictTabInfo::ExtType type;
122 unsigned columnCount;
126 DictTabInfo::FragmentType fragmentType;
127 bool tableLoggedFlag;
129 mutable Uint32 tableId;
130 mutable Uint32 tableVersion;
136 Uint32 columnList[4];
139 DictTabInfo::FragmentType fragmentType;
140 bool indexLoggedFlag;
142 mutable Uint32 indexId;
144 static const SysTable* g_sysTableList[];
145 static const unsigned g_sysTableCount;
147 static const SysTable g_sysTable_SYSTAB_0;
148 static SysTable g_sysTable_NDBEVENTS_0;
150 Uint32 c_schemaTransId;
151 Uint32 c_schemaTransKey;
153 Uint32 c_hashMapVersion;
163 void execAPI_START_REP(
Signal*);
164 void execCONTINUEB(
Signal* signal);
165 void execREAD_NODESCONF(
Signal* signal);
166 void execREAD_NODESREF(
Signal* signal);
167 void execCM_ADD_REP(
Signal* signal);
168 void execCNTR_START_REQ(
Signal* signal);
169 void execCNTR_START_REF(
Signal* signal);
170 void execCNTR_START_CONF(
Signal* signal);
171 void execCNTR_START_REP(
Signal* signal);
172 void execCNTR_WAITREP(
Signal* signal);
173 void execNODE_FAILREP(
Signal* signal);
174 void execSYSTEM_ERROR(
Signal* signal);
176 void execSTART_PERMREP(
Signal*);
179 void execDUMP_STATE_ORD(
Signal* signal);
180 void execREAD_CONFIG_REQ(
Signal* signal);
181 void execSTTOR(
Signal* signal);
182 void execTCSEIZECONF(
Signal* signal);
183 void execTCSEIZEREF(
Signal* signal);
184 void execTCRELEASECONF(
Signal* signal);
185 void execTCRELEASEREF(
Signal* signal);
186 void execTCKEYCONF(
Signal* signal);
187 void execTCKEYREF(
Signal* signal);
188 void execTCROLLBACKREP(
Signal* signal);
189 void execGETGCICONF(
Signal* signal);
190 void execDIH_RESTARTCONF(
Signal* signal);
191 void execDIH_RESTARTREF(
Signal* signal);
192 void execSCHEMA_TRANS_BEGIN_CONF(
Signal* signal);
193 void execSCHEMA_TRANS_BEGIN_REF(
Signal* signal);
194 void execSCHEMA_TRANS_END_CONF(
Signal* signal);
195 void execSCHEMA_TRANS_END_REF(
Signal* signal);
196 void execCREATE_TABLE_REF(
Signal* signal);
197 void execCREATE_TABLE_CONF(
Signal* signal);
198 void execCREATE_HASH_MAP_REF(
Signal* signal);
199 void execCREATE_HASH_MAP_CONF(
Signal* signal);
200 void execCREATE_FILEGROUP_REF(
Signal* signal);
201 void execCREATE_FILEGROUP_CONF(
Signal* signal);
202 void execCREATE_FILE_REF(
Signal* signal);
203 void execCREATE_FILE_CONF(
Signal* signal);
204 void execNDB_STTORRY(
Signal* signal);
205 void execNDB_STARTCONF(
Signal* signal);
206 void execREAD_NODESREQ(
Signal* signal);
207 void execNDB_STARTREF(
Signal* signal);
209 void execSTOP_PERM_REF(
Signal* signal);
210 void execSTOP_PERM_CONF(
Signal* signal);
212 void execSTOP_ME_REF(
Signal* signal);
213 void execSTOP_ME_CONF(
Signal* signal);
215 void execWAIT_GCP_REF(
Signal* signal);
216 void execWAIT_GCP_CONF(
Signal* signal);
218 void execSTOP_REQ(
Signal* signal);
219 void execSTOP_CONF(
Signal* signal);
220 void execRESUME_REQ(
Signal* signal);
222 void execCHANGE_NODE_STATE_CONF(
Signal* signal);
224 void execABORT_ALL_REF(
Signal* signal);
225 void execABORT_ALL_CONF(
Signal* signal);
228 void beginSchemaTransLab(
Signal* signal);
229 void endSchemaTransLab(
Signal* signal);
230 void sendCreateTabReq(
Signal* signal,
const char* buffer, Uint32 bufLen);
231 void startInsertTransactions(
Signal* signal);
232 void initData(
Signal* signal);
233 void resetStartVariables(
Signal* signal);
234 void sendCntrStartReq(
Signal* signal);
235 void sendCntrStartRef(
Signal*, Uint32 nodeId, CntrStartRef::ErrorCode);
236 void sendNdbSttor(
Signal* signal);
237 void sendSttorry(
Signal* signal);
239 bool trySystemRestart(
Signal* signal);
240 void startWaitingNodes(
Signal* signal);
244 void systemErrorLab(
Signal* signal,
int line);
247 void createSystableLab(
Signal* signal,
unsigned index);
249 void crSystab7Lab(
Signal* signal);
250 void crSystab8Lab(
Signal* signal);
251 void crSystab9Lab(
Signal* signal);
253 void startPhase1Lab(
Signal* signal);
254 void startPhase2Lab(
Signal* signal);
255 void startPhase3Lab(
Signal* signal);
256 void startPhase4Lab(
Signal* signal);
257 void startPhase5Lab(
Signal* signal);
259 void startPhase8Lab(
Signal* signal);
260 void startPhase9Lab(
Signal* signal);
261 void ph2ALab(
Signal* signal);
262 void ph2CLab(
Signal* signal);
263 void ph2ELab(
Signal* signal);
264 void ph2FLab(
Signal* signal);
265 void ph2GLab(
Signal* signal);
266 void ph3ALab(
Signal* signal);
267 void ph4ALab(
Signal* signal);
268 void ph4BLab(
Signal* signal);
269 void ph4CLab(
Signal* signal);
270 void ph5ALab(
Signal* signal);
271 void ph6ALab(
Signal* signal);
272 void ph6BLab(
Signal* signal);
273 void ph7ALab(
Signal* signal);
274 void ph8ALab(
Signal* signal);
276 void waitpoint41Lab(
Signal* signal);
277 void waitpoint51Lab(
Signal* signal);
278 void waitpoint52Lab(
Signal* signal);
279 void waitpoint61Lab(
Signal* signal);
280 void waitpoint71Lab(
Signal* signal);
281 void waitpoint42To(
Signal* signal);
287 bool wait_sp(
Signal*, Uint32 sp);
288 void wait_sp_rep(
Signal*);
290 void execSTART_COPYREF(
Signal*);
291 void execSTART_COPYCONF(
Signal*);
293 void execCREATE_NODEGROUP_IMPL_REQ(
Signal*);
294 void execDROP_NODEGROUP_IMPL_REQ(
Signal*);
296 void updateNodeState(
Signal* signal,
const NodeState & newState)
const ;
297 void getNodeGroup(
Signal* signal);
326 UintR ctcConnectionP;
333 Uint16 cinternalStartphase;
335 bool m_cntr_start_conf;
336 Uint16 cmasterNodeId;
337 Uint16 cndbBlocksCount;
338 Uint16 cnoStartNodes;
340 NodeState::StartType ctypeOfStart;
341 NodeState::StartType cdihStartType;
342 Uint16 cdynamicNodeId;
344 Uint32 c_fsRemoveCount;
346 void clearFilesystem(
Signal* signal);
347 void execFSREMOVECONF(
Signal* signal);
357 stopReq.senderRef = 0;
362 NDB_TICKS stopInitiatedTime;
365 void checkTimeout(
Signal* signal);
366 void checkApiTimeout(
Signal* signal);
367 void checkTcTimeout(
Signal* signal);
368 void checkLqhTimeout_1(
Signal* signal);
369 void checkLqhTimeout_2(
Signal* signal);
371 BlockNumber number()
const {
return cntr.number(); }
373 void progError(
int line,
int cause,
const char *
extra) {
378 SR_BLOCK_GCP_START_GCP = 0,
379 SR_WAIT_COMPLETE_GCP = 1,
380 SR_UNBLOCK_GCP_START_GCP = 2,
381 SR_QMGR_STOP_REQ = 3,
382 SR_WAIT_NODE_FAILURES = 4,
383 SR_CLUSTER_SHUTDOWN = 12
392 Missra(
Ndbcntr & ref) : cntr(ref) { }
394 Uint32 currentBlockIndex;
395 Uint32 currentStartPhase;
396 Uint32 nextStartPhase[NO_OF_BLOCKS];
398 void execSTART_ORD(
Signal* signal);
399 void execSTTORRY(
Signal* signal);
400 void sendNextSTTOR(
Signal* signal);
401 void execREAD_CONFIG_CONF(
Signal* signal);
402 void sendNextREAD_CONFIG_REQ(
Signal* signal);
404 BlockNumber number()
const {
return cntr.number(); }
407 cntr.progError(line, cause, extra);
413 friend struct Missra;
415 void execSTTORRY(
Signal* signal);
416 void execSTART_ORD(
Signal* signal);
417 void execREAD_CONFIG_CONF(
Signal*);