bug#28445 - Heartbeat does not start until first API_REGREQ is recevied

- move api failure handling into own method
- add START_ORD so that hb checking can start really early
parent 5258da2a
...@@ -421,9 +421,10 @@ void Cmvmi::execCLOSE_COMREQ(Signal* signal) ...@@ -421,9 +421,10 @@ void Cmvmi::execCLOSE_COMREQ(Signal* signal)
// Uint32 noOfNodes = closeCom->noOfNodes; // Uint32 noOfNodes = closeCom->noOfNodes;
jamEntry(); jamEntry();
for (unsigned i = 0; i < MAX_NODES; i++){ for (unsigned i = 0; i < MAX_NODES; i++)
if(NodeBitmask::get(closeCom->theNodes, i)){ {
if(NodeBitmask::get(closeCom->theNodes, i))
{
jam(); jam();
//----------------------------------------------------- //-----------------------------------------------------
...@@ -437,7 +438,9 @@ void Cmvmi::execCLOSE_COMREQ(Signal* signal) ...@@ -437,7 +438,9 @@ void Cmvmi::execCLOSE_COMREQ(Signal* signal)
globalTransporterRegistry.do_disconnect(i); globalTransporterRegistry.do_disconnect(i);
} }
} }
if (failNo != 0) {
if (failNo != 0)
{
jam(); jam();
signal->theData[0] = userRef; signal->theData[0] = userRef;
signal->theData[1] = failNo; signal->theData[1] = failNo;
...@@ -456,13 +459,21 @@ void Cmvmi::execOPEN_COMREQ(Signal* signal) ...@@ -456,13 +459,21 @@ void Cmvmi::execOPEN_COMREQ(Signal* signal)
jamEntry(); jamEntry();
const Uint32 len = signal->getLength(); const Uint32 len = signal->getLength();
if(len == 2){ if(len == 2)
{
#ifdef ERROR_INSERT #ifdef ERROR_INSERT
if (! ((ERROR_INSERTED(9000) || ERROR_INSERTED(9002)) if (! ((ERROR_INSERTED(9000) || ERROR_INSERTED(9002))
&& c_error_9000_nodes_mask.get(tStartingNode))) && c_error_9000_nodes_mask.get(tStartingNode)))
#endif #endif
{ {
if (globalData.theStartLevel != NodeState::SL_STARTED &&
(getNodeInfo(tStartingNode).m_type != NodeInfo::DB &&
getNodeInfo(tStartingNode).m_type != NodeInfo::MGM))
{
jam();
goto done;
}
globalTransporterRegistry.do_connect(tStartingNode); globalTransporterRegistry.do_connect(tStartingNode);
globalTransporterRegistry.setIOState(tStartingNode, HaltIO); globalTransporterRegistry.setIOState(tStartingNode, HaltIO);
...@@ -475,9 +486,11 @@ void Cmvmi::execOPEN_COMREQ(Signal* signal) ...@@ -475,9 +486,11 @@ void Cmvmi::execOPEN_COMREQ(Signal* signal)
//----------------------------------------------------- //-----------------------------------------------------
} }
} else { } else {
for(unsigned int i = 1; i < MAX_NODES; i++ ) { for(unsigned int i = 1; i < MAX_NODES; i++ )
{
jam(); jam();
if (i != getOwnNodeId() && getNodeInfo(i).m_type == tData2){ if (i != getOwnNodeId() && getNodeInfo(i).m_type == tData2)
{
jam(); jam();
#ifdef ERROR_INSERT #ifdef ERROR_INSERT
...@@ -496,6 +509,7 @@ void Cmvmi::execOPEN_COMREQ(Signal* signal) ...@@ -496,6 +509,7 @@ void Cmvmi::execOPEN_COMREQ(Signal* signal)
} }
} }
done:
if (userRef != 0) { if (userRef != 0) {
jam(); jam();
signal->theData[0] = tStartingNode; signal->theData[0] = tStartingNode;
...@@ -536,24 +550,10 @@ void Cmvmi::execDISCONNECT_REP(Signal *signal) ...@@ -536,24 +550,10 @@ void Cmvmi::execDISCONNECT_REP(Signal *signal)
setNodeInfo(hostId).m_connectCount++; setNodeInfo(hostId).m_connectCount++;
const NodeInfo::NodeType type = getNodeInfo(hostId).getType(); const NodeInfo::NodeType type = getNodeInfo(hostId).getType();
ndbrequire(type != NodeInfo::INVALID); ndbrequire(type != NodeInfo::INVALID);
if(type == NodeInfo::DB || globalData.theStartLevel == NodeState::SL_STARTED){
jam();
DisconnectRep * const rep = (DisconnectRep *)&signal->theData[0];
rep->nodeId = hostId;
rep->err = errNo;
sendSignal(QMGR_REF, GSN_DISCONNECT_REP, signal,
DisconnectRep::SignalLength, JBA);
} else if((globalData.theStartLevel == NodeState::SL_CMVMI ||
globalData.theStartLevel == NodeState::SL_STARTING)
&& type == NodeInfo::MGM) {
/**
* Someone disconnected during cmvmi period
*/
jam();
globalTransporterRegistry.do_connect(hostId);
}
sendSignal(QMGR_REF, GSN_DISCONNECT_REP, signal,
DisconnectRep::SignalLength, JBA);
cancelSubscription(hostId); cancelSubscription(hostId);
signal->theData[0] = NDB_LE_Disconnected; signal->theData[0] = NDB_LE_Disconnected;
...@@ -587,6 +587,8 @@ void Cmvmi::execCONNECT_REP(Signal *signal){ ...@@ -587,6 +587,8 @@ void Cmvmi::execCONNECT_REP(Signal *signal){
*/ */
if(type == NodeInfo::MGM){ if(type == NodeInfo::MGM){
jam(); jam();
signal->theData[0] = hostId;
sendSignal(QMGR_REF, GSN_CONNECT_REP, signal, 1, JBA);
} else { } else {
/** /**
* Dont allow api nodes to connect * Dont allow api nodes to connect
...@@ -802,6 +804,8 @@ Cmvmi::execSTART_ORD(Signal* signal) { ...@@ -802,6 +804,8 @@ Cmvmi::execSTART_ORD(Signal* signal) {
} }
} }
} }
EXECUTE_DIRECT(QMGR, GSN_START_ORD, signal, 1);
return ; return ;
} }
...@@ -829,9 +833,6 @@ Cmvmi::execSTART_ORD(Signal* signal) { ...@@ -829,9 +833,6 @@ Cmvmi::execSTART_ORD(Signal* signal) {
* *
* Do Restart * Do Restart
*/ */
globalScheduler.clear();
globalTimeQueue.clear();
// Disconnect all nodes as part of the system restart. // Disconnect all nodes as part of the system restart.
// We need to ensure that we are starting up // We need to ensure that we are starting up
......
...@@ -265,6 +265,8 @@ private: ...@@ -265,6 +265,8 @@ private:
void execALLOC_NODEID_CONF(Signal *); void execALLOC_NODEID_CONF(Signal *);
void execALLOC_NODEID_REF(Signal *); void execALLOC_NODEID_REF(Signal *);
void completeAllocNodeIdReq(Signal *); void completeAllocNodeIdReq(Signal *);
void execSTART_ORD(Signal*);
// Arbitration signals // Arbitration signals
void execARBIT_CFG(Signal* signal); void execARBIT_CFG(Signal* signal);
...@@ -281,6 +283,7 @@ private: ...@@ -281,6 +283,7 @@ private:
void check_readnodes_reply(Signal* signal, Uint32 nodeId, Uint32 gsn); void check_readnodes_reply(Signal* signal, Uint32 nodeId, Uint32 gsn);
Uint32 check_startup(Signal* signal); Uint32 check_startup(Signal* signal);
void api_failed(Signal* signal, Uint32 aFailedNode);
void node_failed(Signal* signal, Uint16 aFailedNode); void node_failed(Signal* signal, Uint16 aFailedNode);
void checkStartInterface(Signal* signal); void checkStartInterface(Signal* signal);
void failReport(Signal* signal, void failReport(Signal* signal,
......
...@@ -31,10 +31,6 @@ void Qmgr::initData() ...@@ -31,10 +31,6 @@ void Qmgr::initData()
cnoCommitFailedNodes = 0; cnoCommitFailedNodes = 0;
c_maxDynamicId = 0; c_maxDynamicId = 0;
c_clusterNodes.clear(); c_clusterNodes.clear();
Uint32 hbDBAPI = 500;
setHbApiDelay(hbDBAPI);
c_connectedNodes.set(getOwnNodeId());
c_stopReq.senderRef = 0; c_stopReq.senderRef = 0;
/** /**
...@@ -43,6 +39,27 @@ void Qmgr::initData() ...@@ -43,6 +39,27 @@ void Qmgr::initData()
ndbrequire((Uint32)NodeInfo::DB == 0); ndbrequire((Uint32)NodeInfo::DB == 0);
ndbrequire((Uint32)NodeInfo::API == 1); ndbrequire((Uint32)NodeInfo::API == 1);
ndbrequire((Uint32)NodeInfo::MGM == 2); ndbrequire((Uint32)NodeInfo::MGM == 2);
NodeRecPtr nodePtr;
nodePtr.i = getOwnNodeId();
ptrAss(nodePtr, nodeRec);
nodePtr.p->blockRef = reference();
c_connectedNodes.set(getOwnNodeId());
setNodeInfo(getOwnNodeId()).m_version = NDB_VERSION;
/**
* Timeouts
*/
const ndb_mgm_configuration_iterator * p =
m_ctx.m_config.getOwnConfigIterator();
ndbrequire(p != 0);
Uint32 hbDBAPI = 1500;
ndb_mgm_get_int_parameter(p, CFG_DB_API_HEARTBEAT_INTERVAL, &hbDBAPI);
setHbApiDelay(hbDBAPI);
}//Qmgr::initData() }//Qmgr::initData()
void Qmgr::initRecords() void Qmgr::initRecords()
...@@ -113,6 +130,7 @@ Qmgr::Qmgr(Block_context& ctx) ...@@ -113,6 +130,7 @@ Qmgr::Qmgr(Block_context& ctx)
addRecSignal(GSN_DIH_RESTARTREF, &Qmgr::execDIH_RESTARTREF); addRecSignal(GSN_DIH_RESTARTREF, &Qmgr::execDIH_RESTARTREF);
addRecSignal(GSN_DIH_RESTARTCONF, &Qmgr::execDIH_RESTARTCONF); addRecSignal(GSN_DIH_RESTARTCONF, &Qmgr::execDIH_RESTARTCONF);
addRecSignal(GSN_NODE_VERSION_REP, &Qmgr::execNODE_VERSION_REP); addRecSignal(GSN_NODE_VERSION_REP, &Qmgr::execNODE_VERSION_REP);
addRecSignal(GSN_START_ORD, &Qmgr::execSTART_ORD);
initData(); initData();
}//Qmgr::Qmgr() }//Qmgr::Qmgr()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment