Commit bd015e57 authored by unknown's avatar unknown
Browse files

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
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -172,6 +172,7 @@ ClusterMgr::doStop( ){
void
ClusterMgr::forceHB(NodeBitmask waitFor)
{
    NdbMutex_Lock(waitForHBMutex);
    theFacade.lock_mutex();
    global_flag_send_heartbeat_now= 1;

@@ -204,7 +205,6 @@ ClusterMgr::forceHB(NodeBitmask waitFor)

    theFacade.unlock_mutex();

    NdbMutex_Lock(waitForHBMutex);
    NdbCondition_WaitTimeout(waitForHBCond, waitForHBMutex, 1000);
    NdbMutex_Unlock(waitForHBMutex);
#ifdef DEBUG_REG
@@ -400,14 +400,15 @@ ClusterMgr::execAPI_REGCONF(const Uint32 * theData){
  if (node.m_info.m_type != NodeInfo::REP) {
    node.hbFrequency = (apiRegConf->apiHeartbeatFrequency * 10) - 50;
  }

  NdbMutex_Lock(waitForHBMutex);
  waitForHBFromNodes.clear(nodeId);

  if(waitForHBFromNodes.isclear())
  {
    NdbMutex_Lock(waitForHBMutex);
    NdbCondition_Signal(waitForHBCond);

  NdbMutex_Unlock(waitForHBMutex);
}
}

void
ClusterMgr::execAPI_REGREF(const Uint32 * theData){