21 Ndb::checkFailedNode()
23 DBUG_ENTER(
"Ndb::checkFailedNode");
24 Uint32 *the_release_ind= theImpl->the_release_ind;
25 if (the_release_ind[0] == 0)
29 Uint32 tNoOfDbNodes = theImpl->theNoOfDBnodes;
30 Uint8 *theDBnodes= theImpl->theDBnodes;
32 DBUG_PRINT(
"enter", (
"theNoOfDBnodes: %d", tNoOfDbNodes));
34 DBUG_ASSERT(tNoOfDbNodes < MAX_NDB_NODES);
35 for (Uint32
i = 0;
i < tNoOfDbNodes;
i++){
36 const NodeId node_id = theDBnodes[
i];
37 DBUG_PRINT(
"info", (
"i: %d, node_id: %d",
i, node_id));
39 DBUG_ASSERT(node_id < MAX_NDB_NODES);
40 if (the_release_ind[node_id] == 1){
46 theConnectionArray[node_id] = NULL;
47 while (tNdbCon != NULL) {
49 tNdbCon = tNdbCon->next();
50 releaseNdbCon(tempNdbCon);
52 the_release_ind[node_id] = 0;
68 Ndb::createConIdleList(
int aNrOfCon)
70 if (theImpl->theConIdleList.fill(
this, aNrOfCon))
87 Ndb::createOpIdleList(
int aNrOfOp)
89 if (theImpl->theOpIdleList.fill(
this, aNrOfOp))
106 return theImpl->theBranchList.seize(
this);
119 return theImpl->theCallList.seize(
this);
133 tNdbCon->theMagicNumber = 0x37412619;
147 return theImpl->theLabelList.seize(
this);
161 return theImpl->theScanList.seize(
this);
172 Ndb::getNdbSubroutine()
174 return theImpl->theSubroutineList.seize(
this);
187 return theImpl->theOpIdleList.seize(
this);
198 Ndb::getScanOperation()
200 return theImpl->theScanOpIdleList.seize(
this);
211 Ndb::getIndexOperation()
213 return theImpl->theIndexOpIdleList.seize(
this);
226 if (tRecAttr != NULL)
244 return theImpl->theSignalIdleList.seize(
this);
250 NdbBlob* tBlob = theImpl->theNdbBlobIdleList.seize(
this);
277 Ndb::releaseNdbBranch(
NdbBranch* aNdbBranch)
279 theImpl->theBranchList.release(aNdbBranch);
289 Ndb::releaseNdbCall(
NdbCall* aNdbCall)
291 theImpl->theCallList.release(aNdbCall);
303 aNdbCon->theMagicNumber = 0xFE11DD;
304 theImpl->theConIdleList.release(aNdbCon);
314 Ndb::releaseNdbLabel(
NdbLabel* aNdbLabel)
316 theImpl->theLabelList.release(aNdbLabel);
328 theImpl->theScanList.release(aNdbScanRec);
340 theImpl->theSubroutineList.release(aNdbSubroutine);
352 if(anOperation->m_tcReqGSN == GSN_TCKEYREQ){
353 anOperation->theNdbCon = NULL;
354 anOperation->theMagicNumber = 0xFE11D0;
355 theImpl->theOpIdleList.release(anOperation);
357 assert(anOperation->m_tcReqGSN == GSN_TCINDXREQ);
358 anOperation->theNdbCon = NULL;
359 anOperation->theMagicNumber = 0xFE11D1;
373 DBUG_ENTER(
"Ndb::releaseScanOperation");
374 DBUG_PRINT(
"enter", (
"op: 0x%lx", (
long) aScanOperation));
375 #ifdef ndb_release_check_dup
377 while (tOp != NULL) {
378 assert(tOp != aScanOperation);
383 aScanOperation->theNdbCon = NULL;
384 aScanOperation->theMagicNumber = 0xFE11D2;
385 theImpl->theScanOpIdleList.release(aScanOperation);
413 assert(aSignal != NULL);
418 assert(tmp != aSignal);
423 #ifdef POORMANSPURIFY
426 theImpl->theSignalIdleList.release(aSignal);
432 #ifdef POORMANSPURIFY
433 creleaseSignals += cnt;
435 theImpl->theSignalIdleList.release(cnt, head, tail);
441 while (*pList != NULL){
443 *pList = (*pList)->next();
449 Ndb::releaseNdbBlob(
NdbBlob* aBlob)
452 theImpl->theNdbBlobIdleList.release(aBlob);
459 theImpl->theLockHandleList.release(lh);
472 DBUG_ENTER(
"Ndb::releaseConnectToNdb");
483 Uint32 conn_seq = a_con->theNodeSequence;
484 tSignal.setSignal(GSN_TCRELEASEREQ, refToBlock(a_con->m_tcRef));
485 tSignal.setData((tConPtr = a_con->getTC_ConnectPtr()), 1);
486 tSignal.setData(theMyRef, 2);
487 tSignal.setData(a_con->ptr2int(), 3);
488 a_con->Status(NdbTransaction::DisConnecting);
489 a_con->theMagicNumber = 0x37412619;
490 int ret_code = sendRecSignal(node_id,
496 }
else if (ret_code == -1) {
497 TRACE_DEBUG(
"Time-out when TCRELEASE sent");
498 }
else if (ret_code == -2) {
499 TRACE_DEBUG(
"Node failed when TCRELEASE sent");
500 }
else if (ret_code == -3) {
501 TRACE_DEBUG(
"Send failed when TCRELEASE sent");
502 }
else if (ret_code == -4) {
503 TRACE_DEBUG(
"Send buffer full when TCRELEASE sent");
504 }
else if (ret_code == -5) {
505 TRACE_DEBUG(
"Node stopping when TCRELEASE sent");
507 ndbout <<
"Impossible return from sendRecSignal when TCRELEASE" << endl;
510 releaseNdbCon(a_con);
522 curr->m_created = list.m_alloc_cnt;
523 curr->m_free = list.m_free_cnt;
524 curr->m_sizeof =
sizeof(T);
536 if(curr->m_name == 0)
538 update(curr, theImpl->theConIdleList,
"NdbTransaction");
540 else if(!strcmp(curr->m_name,
"NdbTransaction"))
542 update(curr, theImpl->theOpIdleList,
"NdbOperation");
544 else if(!strcmp(curr->m_name,
"NdbOperation"))
546 update(curr, theImpl->theScanOpIdleList,
"NdbIndexScanOperation");
548 else if(!strcmp(curr->m_name,
"NdbIndexScanOperation"))
550 update(curr, theImpl->theIndexOpIdleList,
"NdbIndexOperation");
552 else if(!strcmp(curr->m_name,
"NdbIndexOperation"))
556 else if(!strcmp(curr->m_name,
"NdbRecAttr"))
558 update(curr, theImpl->theSignalIdleList,
"NdbApiSignal");
560 else if(!strcmp(curr->m_name,
"NdbApiSignal"))
562 update(curr, theImpl->theLabelList,
"NdbLabel");
564 else if(!strcmp(curr->m_name,
"NdbLabel"))
566 update(curr, theImpl->theBranchList,
"NdbBranch");
568 else if(!strcmp(curr->m_name,
"NdbBranch"))
570 update(curr, theImpl->theSubroutineList,
"NdbSubroutine");
572 else if(!strcmp(curr->m_name,
"NdbSubroutine"))
574 update(curr, theImpl->theCallList,
"NdbCall");
576 else if(!strcmp(curr->m_name,
"NdbCall"))
578 update(curr, theImpl->theNdbBlobIdleList,
"NdbBlob");
580 else if(!strcmp(curr->m_name,
"NdbBlob"))
582 update(curr, theImpl->theScanList,
"NdbReceiver");
584 else if(!strcmp(curr->m_name,
"NdbReceiver"))
586 update(curr, theImpl->theLockHandleList,
"NdbLockHandle");
588 else if(!strcmp(curr->m_name,
"NdbLockHandle"))
594 update(curr, theImpl->theConIdleList,
"NdbTransaction");
601 template Ndb::Free_list_usage* \
602 update(Ndb::Free_list_usage*, Ndb_free_list_t<T> &, const char * name);\
603 template struct Ndb_free_list_t<T>