List:Commits« Previous MessageNext Message »
From:Stewart Smith Date:August 8 2006 3:59am
Subject:bk commit into 5.0 tree (stewart:1.2213)
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-08 11:59:21+08:00, stewart@willster.(none) +4 -0
  Merge willster.(none):/home/stewart/Documents/MySQL/5.0/main
  into  willster.(none):/home/stewart/Documents/MySQL/5.0/bug13985
  MERGE: 1.2133.7.5

  ndb/src/mgmclient/CommandInterpreter.cpp@stripped, 2006-08-08 11:59:19+08:00, stewart@willster.(none) +4 -5
    manually merge parameter to pass print mutex to event thread
    MERGE: 1.57.1.2

  ndb/src/mgmsrv/MgmtSrvr.cpp@stripped, 2006-08-08 11:42:14+08:00, stewart@willster.(none) +0 -0
    Auto merged
    MERGE: 1.96.3.2

  ndb/src/mgmsrv/MgmtSrvr.hpp@stripped, 2006-08-08 11:42:14+08:00, stewart@willster.(none) +0 -0
    Auto merged
    MERGE: 1.41.2.2

  ndb/src/mgmsrv/Services.cpp@stripped, 2006-08-08 11:42:14+08:00, stewart@willster.(none) +0 -0
    Auto merged
    MERGE: 1.61.4.2

# 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/RESYNC

--- 1.61/ndb/src/mgmclient/CommandInterpreter.cpp	2006-08-08 11:59:25 +08:00
+++ 1.62/ndb/src/mgmclient/CommandInterpreter.cpp	2006-08-08 11:59:25 +08:00
@@ -173,8 +173,15 @@
   bool rep_connected;
 #endif
   struct NdbThread* m_event_thread;
+  NdbMutex *m_print_mutex;
 };
 
+struct event_thread_param {
+  NdbMgmHandle *m;
+  NdbMutex **p;
+};
+
+NdbMutex* print_mutex;
 
 /*
  * Facade object for CommandInterpreter
@@ -395,6 +402,7 @@
   m_connected= false;
   m_event_thread= 0;
   try_reconnect = 0;
+  m_print_mutex= NdbMutex_Create();
 #ifdef HAVE_GLOBAL_REPLICATION
   rep_host = NULL;
   m_repserver = NULL;
@@ -408,6 +416,7 @@
 CommandInterpreter::~CommandInterpreter() 
 {
   disconnect();
+  NdbMutex_Destroy(m_print_mutex);
 }
 
 static bool 
@@ -444,11 +453,13 @@
 
 static int do_event_thread;
 static void*
-event_thread_run(void* m)
+event_thread_run(void* p)
 {
   DBUG_ENTER("event_thread_run");
 
-  NdbMgmHandle handle= *(NdbMgmHandle*)m;
+  struct event_thread_param param= *(struct event_thread_param*)p;
+  NdbMgmHandle handle= *(param.m);
+  NdbMutex* printmutex= *(param.p);
 
   int filter[] = { 15, NDB_MGM_EVENT_CATEGORY_BACKUP,
 		   1, NDB_MGM_EVENT_CATEGORY_STARTUP,
@@ -466,7 +477,11 @@
       {
 	const char ping_token[]= "<PING>";
 	if (memcmp(ping_token,tmp,sizeof(ping_token)-1))
-	  ndbout << tmp;
+	  if(tmp && strlen(tmp))
+          {
+            Guard g(printmutex);
+            ndbout << tmp;
+          }
       }
     } while(do_event_thread);
     NDB_CLOSE_SOCKET(fd);
@@ -519,8 +534,11 @@
     assert(m_event_thread == 0);
     assert(do_event_thread == 0);
     do_event_thread= 0;
+    struct event_thread_param p;
+    p.m= &m_mgmsrv2;
+    p.p= &m_print_mutex;
     m_event_thread = NdbThread_Create(event_thread_run,
-                                      (void**)&m_mgmsrv2,
+                                      (void**)&p,
                                       32768,
                                       "CommandInterpreted_event_thread",
                                       NDB_THREAD_PRIO_LOW);
@@ -607,6 +625,7 @@
   int result= execute_impl(_line);
   if (error)
     *error= m_error;
+
   return result;
 }
 
@@ -920,6 +939,7 @@
     ndbout_c("Trying to start all nodes of system.");
     ndbout_c("Use ALL STATUS to see the system start-up phases.");
   } else {
+    Guard g(m_print_mutex);
     struct ndb_mgm_cluster_state *cl= ndb_mgm_get_status(m_mgmsrv);
     if(cl == 0){
       ndbout_c("Unable get status from management server");

--- 1.102/ndb/src/mgmsrv/MgmtSrvr.cpp	2006-08-08 11:59:25 +08:00
+++ 1.103/ndb/src/mgmsrv/MgmtSrvr.cpp	2006-08-08 11:59:25 +08:00
@@ -1455,6 +1455,12 @@
 
 #include <ClusterMgr.hpp>
 
+void
+MgmtSrvr::updateStatus(NodeBitmask nodes)
+{
+  theFacade->theClusterMgr->forceHB(nodes);
+}
+
 int 
 MgmtSrvr::status(int nodeId, 
                  ndb_mgm_node_status * _status, 
@@ -1977,6 +1983,25 @@
       }
     }
   }
+}
+
+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

--- 1.46/ndb/src/mgmsrv/MgmtSrvr.hpp	2006-08-08 11:59:25 +08:00
+++ 1.47/ndb/src/mgmsrv/MgmtSrvr.hpp	2006-08-08 11:59:25 +08:00
@@ -488,7 +488,10 @@
 
   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);
 
   //**************************************************************************
 private:

--- 1.66/ndb/src/mgmsrv/Services.cpp	2006-08-08 11:59:25 +08:00
+++ 1.67/ndb/src/mgmsrv/Services.cpp	2006-08-08 11:59:25 +08:00
@@ -982,6 +982,9 @@
 		MgmtSrvr &mgmsrv,
 		enum ndb_mgm_node_type type) {
   NodeId nodeId = 0;
+  NodeBitmask hbnodes;
+  mgmsrv.get_connected_ndb_nodes(hbnodes);
+  mgmsrv.updateStatus(hbnodes);
   while(mgmsrv.getNextNodeId(&nodeId, type)) {
     enum ndb_mgm_node_status status;
     Uint32 startPhase = 0, 
Thread
bk commit into 5.0 tree (stewart:1.2213)Stewart Smith8 Aug