mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 20:42:30 +01:00
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
This commit is contained in:
parent
3cea3705fe
commit
bd015e57db
1 changed files with 6 additions and 5 deletions
|
@ -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,13 +400,14 @@ 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);
|
||||
}
|
||||
|
||||
NdbMutex_Unlock(waitForHBMutex);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Reference in a new issue