Commit bd015e57 authored by unknown's avatar unknown

BUG#13985 ndb_mgm "status" command can return incorrect data node status

better support parallel show commands, hold mutex when touching waitForHBFromNodes


ndb/src/ndbapi/ClusterMgr.cpp:
  correctly serialize ::forceHB calls and hold mutex for whole time updating
  waitForHBFromNodes
parent 3cea3705
...@@ -172,6 +172,7 @@ ClusterMgr::doStop( ){ ...@@ -172,6 +172,7 @@ ClusterMgr::doStop( ){
void void
ClusterMgr::forceHB(NodeBitmask waitFor) ClusterMgr::forceHB(NodeBitmask waitFor)
{ {
NdbMutex_Lock(waitForHBMutex);
theFacade.lock_mutex(); theFacade.lock_mutex();
global_flag_send_heartbeat_now= 1; global_flag_send_heartbeat_now= 1;
...@@ -204,7 +205,6 @@ ClusterMgr::forceHB(NodeBitmask waitFor) ...@@ -204,7 +205,6 @@ ClusterMgr::forceHB(NodeBitmask waitFor)
theFacade.unlock_mutex(); theFacade.unlock_mutex();
NdbMutex_Lock(waitForHBMutex);
NdbCondition_WaitTimeout(waitForHBCond, waitForHBMutex, 1000); NdbCondition_WaitTimeout(waitForHBCond, waitForHBMutex, 1000);
NdbMutex_Unlock(waitForHBMutex); NdbMutex_Unlock(waitForHBMutex);
#ifdef DEBUG_REG #ifdef DEBUG_REG
...@@ -400,13 +400,14 @@ ClusterMgr::execAPI_REGCONF(const Uint32 * theData){ ...@@ -400,13 +400,14 @@ ClusterMgr::execAPI_REGCONF(const Uint32 * theData){
if (node.m_info.m_type != NodeInfo::REP) { if (node.m_info.m_type != NodeInfo::REP) {
node.hbFrequency = (apiRegConf->apiHeartbeatFrequency * 10) - 50; node.hbFrequency = (apiRegConf->apiHeartbeatFrequency * 10) - 50;
} }
NdbMutex_Lock(waitForHBMutex);
waitForHBFromNodes.clear(nodeId); waitForHBFromNodes.clear(nodeId);
if(waitForHBFromNodes.isclear()) if(waitForHBFromNodes.isclear())
{
NdbMutex_Lock(waitForHBMutex);
NdbCondition_Signal(waitForHBCond); NdbCondition_Signal(waitForHBCond);
NdbMutex_Unlock(waitForHBMutex); NdbMutex_Unlock(waitForHBMutex);
}
} }
void void
......
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