void SafeCounterManager::execNODE_FAILREP(Signal* signal){ Uint32 * theData = signal->getDataPtrSend(); ActiveCounterPtr ptr; NodeBitmask nodes; nodes.assign(NodeBitmask::Size, ((const NodeFailRep*)signal->getDataPtr())->theNodes); for(m_activeCounters.first(ptr); !ptr.isNull(); m_activeCounters.next(ptr)){ if(nodes.overlaps(ptr.p->m_nodes)){ ActiveCounter::SignalDesc desc = ptr.p->m_signalDesc; theData[desc.m_senderDataOffset] = ptr.p->m_senderData; theData[desc.m_errorCodeOffset] = desc.m_nodeFailErrorCode; Uint32 len = MAX(MAX(desc.m_senderDataOffset, desc.m_errorCodeOffset), desc.m_senderRefOffset); NodeBitmask overlapping = ptr.p->m_nodes; overlapping.bitAND(nodes); Uint32 i = 0; while((i = overlapping.find(i)) != NodeBitmask::NotFound){ theData[desc.m_senderRefOffset] = numberToRef(desc.m_block, i); m_block.sendSignal(m_block.reference(), desc.m_gsn, signal, len+1,JBB); i++; } } } }
void DblqhProxy::sendEXEC_SR_2(Signal* signal, Uint32 ssId) { Ss_EXEC_SR_2& ss = ssFind<Ss_EXEC_SR_2>(ssId); if (!lastReply(ss)) { jam(); return; } NodeBitmask nodes; nodes.assign(NdbNodeBitmask::Size, ss.m_sig.sr_nodes); NodeReceiverGroup rg(DBLQH, nodes); signal->theData[0] = ss.m_sig.nodeId; sendSignal(rg, ss.m_gsn, signal, 1, JBB); ssRelease<Ss_EXEC_SR_2>(ssId); }
void ClusterMgr::execNODE_FAILREP(const NdbApiSignal* sig, const LinearSectionPtr ptr[]) { const NodeFailRep * rep = CAST_CONSTPTR(NodeFailRep, sig->getDataPtr()); NodeBitmask mask; if (sig->getLength() == NodeFailRep::SignalLengthLong) { mask.assign(NodeBitmask::Size, rep->theAllNodes); } else { mask.assign(NdbNodeBitmask::Size, rep->theNodes); } NdbApiSignal signal(sig->theSendersBlockRef); signal.theVerId_signalNumber = GSN_NODE_FAILREP; signal.theReceiversBlockNumber = API_CLUSTERMGR; signal.theTrace = 0; signal.theLength = NodeFailRep::SignalLengthLong; NodeFailRep * copy = CAST_PTR(NodeFailRep, signal.getDataPtrSend()); copy->failNo = 0; copy->masterNodeId = 0; copy->noOfNodes = 0; NodeBitmask::clear(copy->theAllNodes); for (Uint32 i = mask.find_first(); i != NodeBitmask::NotFound; i = mask.find_next(i + 1)) { Node & cm_node = theNodes[i]; trp_node & theNode = cm_node; bool node_failrep = theNode.m_node_fail_rep; bool connected = theNode.is_connected(); set_node_dead(theNode); if (node_failrep == false) { theNode.m_node_fail_rep = true; NodeBitmask::set(copy->theAllNodes, i); copy->noOfNodes++; } if (connected) { theFacade.doDisconnect(i); } } recalcMinDbVersion(); if (copy->noOfNodes) { theFacade.for_each(this, &signal, 0); // report GSN_NODE_FAILREP } if (noOfAliveNodes == 0) { NdbApiSignal signal(numberToRef(API_CLUSTERMGR, getOwnNodeId())); signal.theVerId_signalNumber = GSN_NF_COMPLETEREP; signal.theReceiversBlockNumber = 0; signal.theTrace = 0; signal.theLength = NFCompleteRep::SignalLength; NFCompleteRep * rep = CAST_PTR(NFCompleteRep, signal.getDataPtrSend()); rep->blockNo =0; rep->nodeId = getOwnNodeId(); rep->unused = 0; rep->from = __LINE__; for (Uint32 i = 1; i < MAX_NODES; i++) { trp_node& theNode = theNodes[i]; if (theNode.defined && theNode.nfCompleteRep == false) { rep->failedNodeId = i; execNF_COMPLETEREP(&signal, 0); } } } }