get connected nodes correct earlier for correct node id allocation

parent 358ba900
...@@ -55,6 +55,7 @@ ...@@ -55,6 +55,7 @@
#include <mgmapi_configuration.hpp> #include <mgmapi_configuration.hpp>
#include <mgmapi_config_parameters.h> #include <mgmapi_config_parameters.h>
#include <m_string.h> #include <m_string.h>
#include <Transporter.hpp>
//#define MGM_SRV_DEBUG //#define MGM_SRV_DEBUG
#ifdef MGM_SRV_DEBUG #ifdef MGM_SRV_DEBUG
...@@ -2138,9 +2139,10 @@ MgmtSrvr::get_connected_nodes(NodeBitmask &connected_nodes) const ...@@ -2138,9 +2139,10 @@ MgmtSrvr::get_connected_nodes(NodeBitmask &connected_nodes) const
if (getNodeType(i) == NDB_MGM_NODE_TYPE_NDB) if (getNodeType(i) == NDB_MGM_NODE_TYPE_NDB)
{ {
const ClusterMgr::Node &node= theFacade->theClusterMgr->getNodeInfo(i); const ClusterMgr::Node &node= theFacade->theClusterMgr->getNodeInfo(i);
if (node.connected) if (theFacade->get_registry()->get_transporter(i)->isConnected())
{ {
connected_nodes.bitOR(node.m_state.m_connected_nodes); connected_nodes.bitOR(node.m_state.m_connected_nodes);
connected_nodes.set(i);
} }
} }
} }
......
...@@ -260,6 +260,7 @@ ClusterMgr::Node::Node() ...@@ -260,6 +260,7 @@ ClusterMgr::Node::Node()
: m_state(NodeState::SL_NOTHING) { : m_state(NodeState::SL_NOTHING) {
compatible = nfCompleteRep = true; compatible = nfCompleteRep = true;
connected = defined = m_alive = false; connected = defined = m_alive = false;
m_state.m_connected_nodes.clear();
} }
/****************************************************************************** /******************************************************************************
...@@ -434,6 +435,9 @@ ClusterMgr::reportDisconnected(NodeId nodeId){ ...@@ -434,6 +435,9 @@ ClusterMgr::reportDisconnected(NodeId nodeId){
noOfConnectedNodes--; noOfConnectedNodes--;
theNodes[nodeId].connected = false; theNodes[nodeId].connected = false;
theNodes[nodeId].m_state.m_connected_nodes.clear();
reportNodeFailed(nodeId); reportNodeFailed(nodeId);
} }
......
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