@@ -72,25 +72,13 @@ check_timeout(Uint32 errCode)
72
72
/* *
73
73
*
74
74
*/
75
- Trix::Trix (Block_context& ctx) :
76
- SimulatedBlock(TRIX, ctx),
77
- c_theNodes(c_theNodeRecPool),
78
- c_masterNodeId(0 ),
79
- c_masterTrixRef(0 ),
80
- c_noNodesFailed(0 ),
81
- c_noActiveNodes(0 ),
82
- c_theSubscriptions(c_theSubscriptionRecPool)
83
- {
75
+ Trix::Trix (Block_context &ctx)
76
+ : SimulatedBlock(TRIX, ctx), c_theSubscriptions(c_theSubscriptionRecPool) {
84
77
BLOCK_CONSTRUCTOR (Trix);
85
78
86
79
// Add received signals
87
80
addRecSignal (GSN_READ_CONFIG_REQ, &Trix::execREAD_CONFIG_REQ);
88
81
addRecSignal (GSN_STTOR, &Trix::execSTTOR);
89
- addRecSignal (GSN_NDB_STTOR, &Trix::execNDB_STTOR); // Forwarded from DICT
90
- addRecSignal (GSN_READ_NODESCONF, &Trix::execREAD_NODESCONF);
91
- addRecSignal (GSN_READ_NODESREF, &Trix::execREAD_NODESREF);
92
- addRecSignal (GSN_NODE_FAILREP, &Trix::execNODE_FAILREP);
93
- addRecSignal (GSN_INCL_NODEREQ, &Trix::execINCL_NODEREQ);
94
82
addRecSignal (GSN_DUMP_STATE_ORD, &Trix::execDUMP_STATE_ORD);
95
83
addRecSignal (GSN_DBINFO_SCANREQ, &Trix::execDBINFO_SCANREQ);
96
84
144
132
Trix::execREAD_CONFIG_REQ (Signal* signal)
145
133
{
146
134
jamEntry ();
147
-
148
135
const ReadConfigReq * req = (ReadConfigReq*)signal->getDataPtr ();
149
136
150
137
Uint32 ref = req->senderRef ;
@@ -191,8 +178,6 @@ Trix::execREAD_CONFIG_REQ(Signal* signal)
191
178
void Trix::execSTTOR (Signal* signal)
192
179
{
193
180
jamEntry ();
194
-
195
- // const Uint32 startphase = signal->theData[1];
196
181
const Uint32 theSignalKey = signal->theData [6 ];
197
182
198
183
signal->theData [0 ] = theSignalKey;
@@ -202,143 +187,6 @@ void Trix::execSTTOR(Signal* signal)
202
187
return ;
203
188
}// Trix::execSTTOR()
204
189
205
- /* *
206
- *
207
- */
208
- void Trix::execNDB_STTOR (Signal* signal)
209
- {
210
- jamEntry ();
211
- BlockReference ndbcntrRef = signal->theData [0 ];
212
- Uint16 startphase = signal->theData [2 ]; /* RESTART PHASE */
213
- Uint16 mynode = signal->theData [1 ];
214
- // Uint16 restarttype = signal->theData[3];
215
- // UintR configInfo1 = signal->theData[6]; /* CONFIGRATION INFO PART 1 */
216
- // UintR configInfo2 = signal->theData[7]; /* CONFIGRATION INFO PART 2 */
217
- switch (startphase) {
218
- case 3 :
219
- jam ();
220
- /* SYMBOLIC START PHASE 4 */
221
- /* ABSOLUTE PHASE 5 */
222
- /* REQUEST NODE IDENTITIES FROM DBDIH */
223
- signal->theData [0 ] = calcTrixBlockRef (mynode);
224
- sendSignal (ndbcntrRef, GSN_READ_NODESREQ, signal, 1 , JBB);
225
- return ;
226
- break ;
227
- case 6 :
228
- break ;
229
- default :
230
- break ;
231
- }
232
- }
233
-
234
- /* *
235
- *
236
- */
237
- void Trix::execREAD_NODESCONF (Signal* signal)
238
- {
239
- jamEntry ();
240
-
241
- ReadNodesConf * const readNodes = (ReadNodesConf *)signal->getDataPtr ();
242
- // Uint32 noOfNodes = readNodes->noOfNodes;
243
- NodeRecPtr nodeRecPtr;
244
-
245
- c_masterNodeId = readNodes->masterNodeId ;
246
- c_masterTrixRef = RNIL;
247
- c_noNodesFailed = 0 ;
248
-
249
- for (unsigned i = 0 ; i < MAX_NDB_NODES; i++) {
250
- jam ();
251
- if (NdbNodeBitmask::get (readNodes->allNodes , i)) {
252
- // Node is defined
253
- jam ();
254
- ndbrequire (c_theNodes.getPool ().seizeId (nodeRecPtr, i));
255
- c_theNodes.addFirst (nodeRecPtr);
256
- nodeRecPtr.p ->trixRef = calcTrixBlockRef (i);
257
- if (i == c_masterNodeId) {
258
- c_masterTrixRef = nodeRecPtr.p ->trixRef ;
259
- }
260
- if (NdbNodeBitmask::get (readNodes->inactiveNodes , i)){
261
- // Node is not active
262
- jam ();
263
- /* *-----------------------------------------------------------------
264
- * THIS NODE IS DEFINED IN THE CLUSTER BUT IS NOT ALIVE CURRENTLY.
265
- * WE ADD THE NODE TO THE SET OF FAILED NODES AND ALSO SET THE
266
- * BLOCKSTATE TO BUSY TO AVOID ADDING TRIGGERS OR INDEXES WHILE
267
- * NOT ALL NODES ARE ALIVE.
268
- *------------------------------------------------------------------*/
269
- arrGuard (c_noNodesFailed, MAX_NDB_NODES);
270
- nodeRecPtr.p ->alive = false ;
271
- c_noNodesFailed++;
272
- c_blockState = Trix::NODE_FAILURE;
273
- }
274
- else {
275
- // Node is active
276
- jam ();
277
- c_noActiveNodes++;
278
- nodeRecPtr.p ->alive = true ;
279
- }
280
- }
281
- }
282
- if (c_noNodesFailed == 0 ) {
283
- c_blockState = Trix::STARTED;
284
- }
285
- }
286
-
287
- /* *
288
- *
289
- */
290
- void Trix::execREAD_NODESREF (Signal* signal)
291
- {
292
- // NYI
293
- }
294
-
295
- /* *
296
- *
297
- */
298
- void Trix::execNODE_FAILREP (Signal* signal)
299
- {
300
- jamEntry ();
301
- NodeFailRep * const nodeFail = (NodeFailRep *) signal->getDataPtr ();
302
-
303
- // Uint32 failureNr = nodeFail->failNo;
304
- // Uint32 numberNodes = nodeFail->noOfNodes;
305
- Uint32 masterNodeId = nodeFail->masterNodeId ;
306
-
307
- NodeRecPtr nodeRecPtr;
308
-
309
- for (c_theNodes.first (nodeRecPtr);
310
- nodeRecPtr.i != RNIL;
311
- c_theNodes.next (nodeRecPtr)) {
312
- if (NdbNodeBitmask::get (nodeFail->theNodes , nodeRecPtr.i )) {
313
- nodeRecPtr.p ->alive = false ;
314
- c_noNodesFailed++;
315
- c_noActiveNodes--;
316
- }
317
- }
318
- if (c_masterNodeId != masterNodeId) {
319
- c_masterNodeId = masterNodeId;
320
- NodeRecord* nodeRec = c_theNodes.getPtr (masterNodeId);
321
- c_masterTrixRef = nodeRec->trixRef ;
322
- }
323
- }
324
-
325
- /* *
326
- *
327
- */
328
- void Trix::execINCL_NODEREQ (Signal* signal)
329
- {
330
- jamEntry ();
331
- UintR node_id = signal->theData [1 ];
332
- NodeRecord* nodeRec = c_theNodes.getPtr (node_id);
333
- nodeRec->alive = true ;
334
- c_noNodesFailed--;
335
- c_noActiveNodes++;
336
- nodeRec->trixRef = calcTrixBlockRef (node_id);
337
- if (c_noNodesFailed == 0 ) {
338
- c_blockState = Trix::STARTED;
339
- }
340
- }
341
-
342
190
// Debugging
343
191
void
344
192
Trix::execDUMP_STATE_ORD (Signal* signal)
0 commit comments