MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Stewart Smith Date:August 9 2006 7:04am
Subject:bk commit into 5.0 tree (stewart:1.2244) 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-08-09 15:03:55+08:00, stewart@willster.(none) +6 -0
  BUG#13985
  
  fixups after review by jonas

  ndb/src/mgmclient/CommandInterpreter.cpp@stripped, 2006-08-09 15:03:52+08:00, stewart@willster.(none) +1 -0
    Guard the print mutex when running SHOW

  ndb/src/mgmsrv/MgmtSrvr.cpp@stripped, 2006-08-09 15:03:52+08:00, stewart@willster.(none) +4 -24
    replace global_flag_send_heartbeat_now with forceHB()/updateStatus()
    
    don't use bitmask as parameter to forceHB to reflect reality of what the
    function does.
    
    remove get_connected_ndb_nodes() as it is no longer used

  ndb/src/mgmsrv/MgmtSrvr.hpp@stripped, 2006-08-09 15:03:52+08:00, stewart@willster.(none) +1 -2
    remove unused get_connected_ndb_nodes()
    
    update updateStatus prototype

  ndb/src/mgmsrv/Services.cpp@stripped, 2006-08-09 15:03:52+08:00, stewart@willster.(none) +1 -3
    use new prototype for updateStatus() - doesn't accept NodeBitmask

  ndb/src/ndbapi/ClusterMgr.cpp@stripped, 2006-08-09 15:03:52+08:00, stewart@willster.(none) +19 -10
    remove global_flag_send_heartbeat_now, replace with forceHB.
    
    compute bitmask of nodes to send HB to in forceHB

  ndb/src/ndbapi/ClusterMgr.hpp@stripped, 2006-08-09 15:03:52+08:00, stewart@willster.(none) +1 -1
    update prototype for forceHB, don't give the illusion that NodeBitmask means much.

# 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.62/ndb/src/mgmclient/CommandInterpreter.cpp	2006-08-09 15:04:00 +08:00
+++ 1.63/ndb/src/mgmclient/CommandInterpreter.cpp	2006-08-09 15:04:00 +08:00
@@ -705,6 +705,7 @@
     DBUG_RETURN(true);
 
   if (strcasecmp(firstToken, "SHOW") == 0) {
+    Guard g(m_print_mutex);
     executeShow(allAfterFirstToken);
     DBUG_RETURN(true);
   }

--- 1.103/ndb/src/mgmsrv/MgmtSrvr.cpp	2006-08-09 15:04:00 +08:00
+++ 1.104/ndb/src/mgmsrv/MgmtSrvr.cpp	2006-08-09 15:04:00 +08:00
@@ -77,7 +77,6 @@
     }\
   }
 
-extern int global_flag_send_heartbeat_now;
 extern int g_no_nodeid_checks;
 extern my_bool opt_core;
 
@@ -1456,9 +1455,9 @@
 #include <ClusterMgr.hpp>
 
 void
-MgmtSrvr::updateStatus(NodeBitmask nodes)
+MgmtSrvr::updateStatus()
 {
-  theFacade->theClusterMgr->forceHB(nodes);
+  theFacade->theClusterMgr->forceHB();
 }
 
 int 
@@ -1985,25 +1984,6 @@
   }
 }
 
-void
-MgmtSrvr::get_connected_ndb_nodes(NodeBitmask &connected_nodes) const
-{
-  NodeBitmask ndb_nodes;
-  if (theFacade && theFacade->theClusterMgr)
-  {
-    for(Uint32 i = 0; i < MAX_NODES; i++)
-    {
-      if (getNodeType(i) == NDB_MGM_NODE_TYPE_NDB)
-      {
-        ndb_nodes.set(i);
-	const ClusterMgr::Node &node= theFacade->theClusterMgr->getNodeInfo(i);
-	connected_nodes.bitOR(node.m_state.m_connected_nodes);
-      }
-    }
-  }
-  connected_nodes.bitAND(ndb_nodes);
-}
-
 bool
 MgmtSrvr::alloc_node_id(NodeId * nodeId, 
 			enum ndb_mgm_node_type type,
@@ -2178,7 +2158,7 @@
   if (found_matching_type && !found_free_node) {
     // we have a temporary error which might be due to that 
     // we have got the latest connect status from db-nodes.  Force update.
-    global_flag_send_heartbeat_now= 1;
+    updateStatus();
   }
 
   BaseString type_string, type_c_string;
@@ -2532,7 +2512,7 @@
   if (!m_reserved_nodes.isclear()) {
     m_mgmsrv.m_reserved_nodes.bitANDC(m_reserved_nodes); 
     // node has been reserved, force update signal to ndb nodes
-    global_flag_send_heartbeat_now= 1;
+    m_mgmsrv.updateStatus();
 
     char tmp_str[128];
     m_mgmsrv.m_reserved_nodes.getText(tmp_str);

--- 1.47/ndb/src/mgmsrv/MgmtSrvr.hpp	2006-08-09 15:04:00 +08:00
+++ 1.48/ndb/src/mgmsrv/MgmtSrvr.hpp	2006-08-09 15:04:00 +08:00
@@ -488,10 +488,9 @@
 
   const char *get_connect_address(Uint32 node_id);
   void get_connected_nodes(NodeBitmask &connected_nodes) const;
-  void get_connected_ndb_nodes(NodeBitmask &connected_nodes) const;
   SocketServer *get_socket_server() { return m_socket_server; }
 
-  void updateStatus(NodeBitmask nodes);
+  void updateStatus();
 
   //**************************************************************************
 private:

--- 1.67/ndb/src/mgmsrv/Services.cpp	2006-08-09 15:04:00 +08:00
+++ 1.68/ndb/src/mgmsrv/Services.cpp	2006-08-09 15:04:00 +08:00
@@ -982,9 +982,7 @@
 		MgmtSrvr &mgmsrv,
 		enum ndb_mgm_node_type type) {
   NodeId nodeId = 0;
-  NodeBitmask hbnodes;
-  mgmsrv.get_connected_ndb_nodes(hbnodes);
-  mgmsrv.updateStatus(hbnodes);
+  mgmsrv.updateStatus();
   while(mgmsrv.getNextNodeId(&nodeId, type)) {
     enum ndb_mgm_node_status status;
     Uint32 startPhase = 0, 

--- 1.26/ndb/src/ndbapi/ClusterMgr.cpp	2006-08-09 15:04:00 +08:00
+++ 1.27/ndb/src/ndbapi/ClusterMgr.cpp	2006-08-09 15:04:00 +08:00
@@ -37,8 +37,6 @@
 #include <mgmapi_configuration.hpp>
 #include <mgmapi_config_parameters.h>
 
-int global_flag_send_heartbeat_now= 0;
-
 //#define DEBUG_REG
 
 // Just a C wrapper for threadMain
@@ -169,7 +167,7 @@
 }
 
 void
-ClusterMgr::forceHB(NodeBitmask waitFor)
+ClusterMgr::forceHB()
 {
     theFacade.lock_mutex();
 
@@ -180,10 +178,25 @@
       return;
     }
 
-    global_flag_send_heartbeat_now= 1;
     waitingForHB= true;
 
-    waitForHBFromNodes= waitFor;
+    NodeBitmask ndb_nodes;
+    ndb_nodes.clear();
+    waitForHBFromNodes.clear();
+    for(Uint32 i = 0; i < MAX_NODES; i++)
+    {
+      if(!theNodes[i].defined)
+        continue;
+      if(theNodes[i].m_info.m_type == NodeInfo::DB)
+      {
+        ndb_nodes.set(i);
+        const ClusterMgr::Node &node= getNodeInfo(i);
+        waitForHBFromNodes.bitOR(node.m_state.m_connected_nodes);
+      }
+      ndbout << endl;
+    }
+    waitForHBFromNodes.bitAND(ndb_nodes);
+
 #ifdef DEBUG_REG
     char buf[128];
     ndbout << "Waiting for HB from " << waitForHBFromNodes.getText(buf) << endl;
@@ -239,9 +252,6 @@
     /**
      * Start of Secure area for use of Transporter
      */
-    int send_heartbeat_now= global_flag_send_heartbeat_now;
-    global_flag_send_heartbeat_now= 0;
-
     theFacade.lock_mutex();
     for (int i = 1; i < MAX_NODES; i++){
       /**
@@ -264,8 +274,7 @@
       }
       
       theNode.hbCounter += timeSlept;
-      if (theNode.hbCounter >= theNode.hbFrequency ||
-	  send_heartbeat_now) {
+      if (theNode.hbCounter >= theNode.hbFrequency) {
 	/**
 	 * It is now time to send a new Heartbeat
 	 */

--- 1.10/ndb/src/ndbapi/ClusterMgr.hpp	2006-08-09 15:04:00 +08:00
+++ 1.11/ndb/src/ndbapi/ClusterMgr.hpp	2006-08-09 15:04:00 +08:00
@@ -50,7 +50,7 @@
   void doStop();
   void startThread();
 
-  void forceHB(NodeBitmask waitFor);
+  void forceHB();
 
 private:
   void threadMain();
Thread
bk commit into 5.0 tree (stewart:1.2244) BUG#13985Stewart Smith9 Aug