MySQL Lists are EOL. Please join:

List:Internals« Previous MessageNext Message »
From:tomas Date:July 15 2005 8:45am
Subject:bk commit into 4.1 tree (tomas:1.2351) BUG#11596
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of tomas. When tomas 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
  1.2351 05/07/15 10:44:54 tomas@stripped +6 -0
   BUG#11596 (partial fix), IP addresses not shown in ndb_mgm SHOW command on second ndb_mgmd (or on ndb_mgmd restart)

  ndb/src/mgmsrv/MgmtSrvr.hpp
    1.26 05/07/15 10:44:48 tomas@stripped +1 -1
     BUG#11596 (partial fix), IP addresses not shown in ndb_mgm SHOW command on second ndb_mgmd (or on ndb_mgmd restart)

  ndb/src/mgmsrv/MgmtSrvr.cpp
    1.60 05/07/15 10:44:47 tomas@stripped +18 -0
     BUG#11596 (partial fix), IP addresses not shown in ndb_mgm SHOW command on second ndb_mgmd (or on ndb_mgmd restart)

  ndb/src/common/transporter/TransporterRegistry.cpp
    1.27 05/07/15 10:44:47 tomas@stripped +6 -0
     BUG#11596 (partial fix), IP addresses not shown in ndb_mgm SHOW command on second ndb_mgmd (or on ndb_mgmd restart)

  ndb/src/common/transporter/Transporter.hpp
    1.7 05/07/15 10:44:47 tomas@stripped +1 -0
     BUG#11596 (partial fix), IP addresses not shown in ndb_mgm SHOW command on second ndb_mgmd (or on ndb_mgmd restart)

  ndb/src/common/transporter/Transporter.cpp
    1.13 05/07/15 10:44:47 tomas@stripped +15 -0
     BUG#11596 (partial fix), IP addresses not shown in ndb_mgm SHOW command on second ndb_mgmd (or on ndb_mgmd restart)

  ndb/include/transporter/TransporterRegistry.hpp
    1.9 05/07/15 10:44:47 tomas@stripped +2 -0
     BUG#11596 (partial fix), IP addresses not shown in ndb_mgm SHOW command on second ndb_mgmd (or on ndb_mgmd restart)

# 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:	tomas
# Host:	poseidon.ndb.mysql.com
# Root:	/home/tomas/mysql-4.1-release

--- 1.8/ndb/include/transporter/TransporterRegistry.hpp	2005-05-25 16:19:14 +02:00
+++ 1.9/ndb/include/transporter/TransporterRegistry.hpp	2005-07-15 10:44:47 +02:00
@@ -238,6 +238,8 @@
   };
   Vector<Transporter_interface> m_transporter_interface;
   void add_transporter_interface(const char *interf, unsigned short port);
+
+  struct in_addr get_connect_address(NodeId node_id) const;
 protected:
   
 private:

--- 1.12/ndb/src/common/transporter/Transporter.cpp	2004-12-22 16:28:56 +01:00
+++ 1.13/ndb/src/common/transporter/Transporter.cpp	2005-07-15 10:44:47 +02:00
@@ -74,6 +74,7 @@
   m_connected     = false;
   m_timeOutMillis = 1000;
 
+  m_connect_address.s_addr= 0;
   if (isServer)
     m_socket_client= 0;
   else
@@ -98,6 +99,13 @@
     DBUG_RETURN(true); // TODO assert(0);
   }
   
+  {
+    struct sockaddr addr;
+    SOCKET_SIZE_TYPE addrlen= sizeof(addr);
+    int r= getpeername(sockfd, &addr, &addrlen);
+    m_connect_address= ((struct sockaddr_in *)&addr)->sin_addr;
+  }
+
   bool res = connect_server_impl(sockfd);
   if(res){
     m_connected  = true;
@@ -162,6 +170,13 @@
   else if (m_type == tt_SHM_TRANSPORTER)
   {
     g_eventLogger.warning("Unable to verify transporter compatability with node %d", nodeId);
+  }
+
+  {
+    struct sockaddr addr;
+    SOCKET_SIZE_TYPE addrlen= sizeof(addr);
+    int r= getpeername(sockfd, &addr, &addrlen);
+    m_connect_address= ((struct sockaddr_in *)&addr)->sin_addr;
   }
 
   bool res = connect_client_impl(sockfd);

--- 1.6/ndb/src/common/transporter/Transporter.hpp	2005-05-25 16:19:14 +02:00
+++ 1.7/ndb/src/common/transporter/Transporter.hpp	2005-07-15 10:44:47 +02:00
@@ -122,6 +122,7 @@
 private:
 
   SocketClient *m_socket_client;
+  struct in_addr m_connect_address;
 
 protected:
   Uint32 getErrorCount();

--- 1.26/ndb/src/common/transporter/TransporterRegistry.cpp	2005-05-25 16:19:14 +02:00
+++ 1.27/ndb/src/common/transporter/TransporterRegistry.cpp	2005-07-15 10:44:47 +02:00
@@ -51,6 +51,12 @@
 #include <EventLogger.hpp>
 extern EventLogger g_eventLogger;
 
+struct in_addr
+TransporterRegistry::get_connect_address(NodeId node_id) const
+{
+  return theTransporters[node_id]->m_connect_address;
+}
+
 SocketServer::Session * TransporterService::newSession(NDB_SOCKET_TYPE sockfd)
 {
   DBUG_ENTER("SocketServer::Session * TransporterService::newSession");

--- 1.59/ndb/src/mgmsrv/MgmtSrvr.cpp	2005-04-22 09:07:22 +02:00
+++ 1.60/ndb/src/mgmsrv/MgmtSrvr.cpp	2005-07-15 10:44:47 +02:00
@@ -2124,6 +2124,24 @@
   return nodeTypes[nodeId];
 }
 
+const char *MgmtSrvr::get_connect_address(Uint32 node_id)
+{
+  if (m_connect_address[node_id].s_addr == 0 &&
+      theFacade && theFacade->theTransporterRegistry &&
+      theFacade->theClusterMgr &&
+      getNodeType(node_id) == NDB_MGM_NODE_TYPE_NDB) 
+  {
+    const ClusterMgr::Node &node=
+      theFacade->theClusterMgr->getNodeInfo(node_id);
+    if (node.connected)
+    {
+      m_connect_address[node_id]=
+	theFacade->theTransporterRegistry->get_connect_address(node_id);
+    }
+  }
+  return inet_ntoa(m_connect_address[node_id]);  
+}
+
 void
 MgmtSrvr::get_connected_nodes(NodeBitmask &connected_nodes) const
 {

--- 1.25/ndb/src/mgmsrv/MgmtSrvr.hpp	2005-04-22 09:07:22 +02:00
+++ 1.26/ndb/src/mgmsrv/MgmtSrvr.hpp	2005-07-15 10:44:48 +02:00
@@ -508,7 +508,7 @@
 
   int setDbParameter(int node, int parameter, const char * value, BaseString&);
   
-  const char *get_connect_address(Uint32 node_id) { return inet_ntoa(m_connect_address[node_id]); }
+  const char *get_connect_address(Uint32 node_id);
   void get_connected_nodes(NodeBitmask &connected_nodes) const;
   SocketServer *get_socket_server() { return m_socket_server; }
 
Thread
bk commit into 4.1 tree (tomas:1.2351) BUG#11596tomas15 Jul