MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Stewart Smith Date:July 7 2006 8:39am
Subject:bk commit into 5.0 tree (stewart:1.2140) BUG#13985
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of stewart. When stewart does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2006-07-07 18:39:38+10:00, stewart@willster.(none) +2 -0
  BUG#13985 Cluster: ndb_mgm "status" command can return incorrect data node status
  
  use existing transporter mutex

  ndb/src/ndbapi/ClusterMgr.cpp@stripped, 2006-07-07 18:39:36+10:00, stewart@willster.(none) +11 -14
    just use the transporter facade mutex.
    
    parallel 'show' will get woken up at the same time

  ndb/src/ndbapi/ClusterMgr.hpp@stripped, 2006-07-07 18:39:36+10:00, stewart@willster.(none) +0 -1
    remove wait for heartbeat mutex

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	stewart
# Host:	willster.(none)
# Root:	/home/stewart/Documents/MySQL/5.0/bug13985

--- 1.24/ndb/src/ndbapi/ClusterMgr.cpp	2006-07-07 18:39:43 +10:00
+++ 1.25/ndb/src/ndbapi/ClusterMgr.cpp	2006-07-07 18:39:43 +10:00
@@ -69,7 +69,6 @@
   DBUG_ENTER("ClusterMgr::ClusterMgr");
   ndbSetOwnVersion();
   clusterMgrThreadMutex = NdbMutex_Create();
-  waitForHBMutex= NdbMutex_Create();
   waitForHBCond= NdbCondition_Create();
   noOfAliveNodes= 0;
   noOfConnectedNodes= 0;
@@ -83,7 +82,6 @@
   DBUG_ENTER("ClusterMgr::~ClusterMgr");
   doStop();
   NdbCondition_Destroy(waitForHBCond);
-  NdbMutex_Destroy(waitForHBMutex);
   NdbMutex_Destroy(clusterMgrThreadMutex);
   DBUG_VOID_RETURN;
 }
@@ -172,8 +170,15 @@
 void
 ClusterMgr::forceHB(NodeBitmask waitFor)
 {
-    NdbMutex_Lock(waitForHBMutex);
     theFacade.lock_mutex();
+
+    if(!waitForHBFromNodes.isclear())
+    {
+      NdbCondition_WaitTimeout(waitForHBCond, theFacade.theMutexPtr, 1000);
+      theFacade.unlock_mutex();
+      return;
+    }
+
     global_flag_send_heartbeat_now= 1;
 
     waitForHBFromNodes= waitFor;
@@ -203,10 +208,8 @@
       theFacade.sendSignalUnCond(&signal, nodeId);
     }
 
+    NdbCondition_WaitTimeout(waitForHBCond, theFacade.theMutexPtr, 1000);
     theFacade.unlock_mutex();
-
-    NdbCondition_WaitTimeout(waitForHBCond, waitForHBMutex, 1000);
-    NdbMutex_Unlock(waitForHBMutex);
 #ifdef DEBUG_REG
     ndbout << "Still waiting for HB from " << waitForHBFromNodes.getText(buf) << endl;
 #endif
@@ -401,13 +404,10 @@
     node.hbFrequency = (apiRegConf->apiHeartbeatFrequency * 10) - 50;
   }
 
-  NdbMutex_Lock(waitForHBMutex);
   waitForHBFromNodes.clear(nodeId);
 
   if(waitForHBFromNodes.isclear())
-    NdbCondition_Signal(waitForHBCond);
-
-  NdbMutex_Unlock(waitForHBMutex);
+    NdbCondition_Broadcast(waitForHBCond);
 }
 
 void
@@ -436,13 +436,10 @@
   default:
     break;
   }
+
   waitForHBFromNodes.clear(nodeId);
   if(waitForHBFromNodes.isclear())
-  {
-    NdbMutex_Lock(waitForHBMutex);
     NdbCondition_Signal(waitForHBCond);
-    NdbMutex_Unlock(waitForHBMutex);
-  }
 }
 
 void

--- 1.8/ndb/src/ndbapi/ClusterMgr.hpp	2006-07-07 18:39:43 +10:00
+++ 1.9/ndb/src/ndbapi/ClusterMgr.hpp	2006-07-07 18:39:43 +10:00
@@ -89,7 +89,6 @@
   NdbThread*    theClusterMgrThread;
 
   NodeBitmask   waitForHBFromNodes; // used in forcing HBs
-  NdbMutex*     waitForHBMutex;
   NdbCondition* waitForHBCond;
 
   /**
Thread
bk commit into 5.0 tree (stewart:1.2140) BUG#13985Stewart Smith7 Jul