List:Commits« Previous MessageNext Message »
From:Frazer Clement Date:September 29 2012 12:05am
Subject:bzr push into mysql-5.1-telco-7.0 branch (frazer.clement:4992 to 4993)
Bug#14685458
View as plain text  
 4993 Frazer Clement	2012-09-29
      Bug #14685458 NDB : REPORT BYTES SENT/RECEIVED ACROSS TRANSPORTERS
      
      This patch extends the ndbinfo.transporters table with a number of 
      new columns : 
        remote_address
        bytes_sent
        bytes_received
      
      For each transporter (point to point link between
      nodes), these columns indicate the address of the 'remote' 
      end of the link, the number of bytes sent to that node, and the
      number of bytes received from that node.
      
      The byte counts are reset on disconnect.

    modified:
      scripts/mysql_system_tables.sql
      storage/ndb/include/transporter/TransporterRegistry.hpp
      storage/ndb/src/common/transporter/TCP_Transporter.cpp
      storage/ndb/src/common/transporter/Transporter.cpp
      storage/ndb/src/common/transporter/Transporter.hpp
      storage/ndb/src/common/transporter/TransporterRegistry.cpp
      storage/ndb/src/kernel/blocks/trpman.cpp
      storage/ndb/src/kernel/vm/NdbinfoTables.cpp
      storage/ndb/tools/ndbinfo_sql.cpp
 4992 Mauritz Sundell	2012-09-28 [merge]
      ndb - removes the ~45Mrow limit per partition
      
      Bug #13844405 - FRAGMENTS ARE LIMITED TO ~45M ROWS. (GOT ERROR 633)
      Bug #14000373	SILENT DATA INCONSISTENCY WITH BIG FRAGMENTS (MORE THAN ~45MROWS)
      
      There have been a limit on the number of rows in a partition due to the
      limitations in the implementation of hash index used for primary key/unique key
      hash index, and the primary key hash index is mandatory for a table.

    added:
      mysql-test/suite/ndb_big/bug14000373.cnf
      mysql-test/suite/ndb_big/bug14000373.result
      mysql-test/suite/ndb_big/bug14000373.test
      storage/ndb/src/kernel/vm/LHLevel.cpp
      storage/ndb/src/kernel/vm/LHLevel.hpp
    modified:
      storage/ndb/src/kernel/blocks/dbacc/Dbacc.hpp
      storage/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp
      storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
      storage/ndb/src/kernel/vm/CMakeLists.txt
      storage/ndb/src/kernel/vm/Makefile.am
=== modified file 'scripts/mysql_system_tables.sql'
--- a/scripts/mysql_system_tables.sql	2012-03-28 15:17:32 +0000
+++ b/scripts/mysql_system_tables.sql	2012-09-28 23:36:17 +0000
@@ -237,7 +237,7 @@ PREPARE stmt FROM @str;
 EXECUTE stmt;
 DROP PREPARE stmt;
 
-SET @str=IF(@have_ndbinfo,'CREATE TABLE `ndbinfo`.`ndb$transporters` (`node_id` INT UNSIGNED,`remote_node_id` INT UNSIGNED,`connection_status` INT UNSIGNED) COMMENT="transporter status" ENGINE=NDBINFO','SET @dummy = 0');
+SET @str=IF(@have_ndbinfo,'CREATE TABLE `ndbinfo`.`ndb$transporters` (`node_id` INT UNSIGNED,`remote_node_id` INT UNSIGNED,`connection_status` INT UNSIGNED,`remote_address` VARCHAR(512),`bytes_sent` BIGINT UNSIGNED,`bytes_received` BIGINT UNSIGNED) COMMENT="transporter status" ENGINE=NDBINFO','SET @dummy = 0');
 PREPARE stmt FROM @str;
 EXECUTE stmt;
 DROP PREPARE stmt;
@@ -331,7 +331,7 @@ EXECUTE stmt;
 DROP PREPARE stmt;
 
 # ndbinfo.transporters
-SET @str=IF(@have_ndbinfo,'CREATE OR REPLACE DEFINER=`root@localhost` SQL SECURITY INVOKER VIEW `ndbinfo`.`transporters` AS SELECT node_id, remote_node_id,  CASE connection_status  WHEN 0 THEN "CONNECTED"  WHEN 1 THEN "CONNECTING"  WHEN 2 THEN "DISCONNECTED"  WHEN 3 THEN "DISCONNECTING"  ELSE NULL  END AS status FROM ndbinfo.ndb$transporters','SET @dummy = 0');
+SET @str=IF(@have_ndbinfo,'CREATE OR REPLACE DEFINER=`root@localhost` SQL SECURITY INVOKER VIEW `ndbinfo`.`transporters` AS SELECT node_id, remote_node_id,  CASE connection_status  WHEN 0 THEN "CONNECTED"  WHEN 1 THEN "CONNECTING"  WHEN 2 THEN "DISCONNECTED"  WHEN 3 THEN "DISCONNECTING"  ELSE NULL  END AS status,  remote_address, bytes_sent, bytes_received FROM `ndbinfo`.`ndb$transporters`','SET @dummy = 0');
 PREPARE stmt FROM @str;
 EXECUTE stmt;
 DROP PREPARE stmt;

=== modified file 'storage/ndb/include/transporter/TransporterRegistry.hpp'
--- a/storage/ndb/include/transporter/TransporterRegistry.hpp	2012-09-13 10:27:55 +0000
+++ b/storage/ndb/include/transporter/TransporterRegistry.hpp	2012-09-28 23:36:17 +0000
@@ -394,6 +394,9 @@ public:
 		  		 int s_port);	// signed port. <0 is dynamic
   Transporter* get_transporter(NodeId nodeId);
   struct in_addr get_connect_address(NodeId node_id) const;
+
+  Uint64 get_bytes_sent(NodeId nodeId) const;
+  Uint64 get_bytes_received(NodeId nodeId) const;
 protected:
   
 private:

=== modified file 'storage/ndb/src/common/transporter/TCP_Transporter.cpp'
--- a/storage/ndb/src/common/transporter/TCP_Transporter.cpp	2012-06-07 14:46:55 +0000
+++ b/storage/ndb/src/common/transporter/TCP_Transporter.cpp	2012-09-28 23:36:17 +0000
@@ -379,6 +379,7 @@ ok:
   iovec_data_sent(sum_sent);
   sendCount += send_cnt;
   sendSize  += sum_sent;
+  m_bytes_sent += sum_sent;
   if(sendCount >= reportFreq)
   {
     get_callback_obj()->reportSendLen(remoteNodeId, sendCount, sendSize);
@@ -420,6 +421,7 @@ TCP_Transporter::doReceive(TransporterRe
       
       receiveCount ++;
       receiveSize  += nBytesRead;
+      m_bytes_received += nBytesRead;
       
       if(receiveCount == reportFreq){
         recvdata.reportReceiveLen(remoteNodeId,

=== modified file 'storage/ndb/src/common/transporter/Transporter.cpp'
--- a/storage/ndb/src/common/transporter/Transporter.cpp	2012-06-07 14:46:55 +0000
+++ b/storage/ndb/src/common/transporter/Transporter.cpp	2012-09-28 23:36:17 +0000
@@ -44,6 +44,7 @@ Transporter::Transporter(TransporterRegi
     isServer(lNodeId==serverNodeId),
     m_packer(_signalId, _checksum), m_max_send_buffer(max_send_buffer),
     m_overload_limit(0xFFFFFFFF), m_slowdown_limit(0xFFFFFFFF),
+    m_bytes_sent(0), m_bytes_received(0),
     isMgmConnection(_isMgmConnection),
     m_connected(false),
     m_type(_type),
@@ -286,6 +287,8 @@ Transporter::doDisconnect() {
     return;
 
   m_connected = false;
+  m_bytes_sent = 0;
+  m_bytes_received = 0;
 
   disconnectImpl();
 }

=== modified file 'storage/ndb/src/common/transporter/Transporter.hpp'
--- a/storage/ndb/src/common/transporter/Transporter.hpp	2012-06-07 14:46:55 +0000
+++ b/storage/ndb/src/common/transporter/Transporter.hpp	2012-09-28 23:36:17 +0000
@@ -158,6 +158,8 @@ protected:
   /* Overload limit, as configured with the OverloadLimit config parameter. */
   Uint32 m_overload_limit;
   Uint32 m_slowdown_limit;
+  Uint64 m_bytes_sent;
+  Uint64 m_bytes_received;
 
 private:
 

=== modified file 'storage/ndb/src/common/transporter/TransporterRegistry.cpp'
--- a/storage/ndb/src/common/transporter/TransporterRegistry.cpp	2012-09-13 10:27:55 +0000
+++ b/storage/ndb/src/common/transporter/TransporterRegistry.cpp	2012-09-28 23:36:17 +0000
@@ -56,6 +56,18 @@ TransporterRegistry::get_connect_address
   return theTransporters[node_id]->m_connect_address;
 }
 
+Uint64
+TransporterRegistry::get_bytes_sent(NodeId node_id) const
+{
+  return theTransporters[node_id]->m_bytes_sent;
+}
+
+Uint64
+TransporterRegistry::get_bytes_received(NodeId node_id) const
+{
+  return theTransporters[node_id]->m_bytes_received;
+}
+
 SocketServer::Session * TransporterService::newSession(NDB_SOCKET_TYPE sockfd)
 {
   DBUG_ENTER("SocketServer::Session * TransporterService::newSession");

=== modified file 'storage/ndb/src/kernel/blocks/trpman.cpp'
--- a/storage/ndb/src/kernel/blocks/trpman.cpp	2012-01-23 20:23:08 +0000
+++ b/storage/ndb/src/kernel/blocks/trpman.cpp	2012-09-28 23:36:17 +0000
@@ -403,8 +403,32 @@ Trpman::execDBINFO_SCANREQ(Signal *signa
         row.write_uint32(getOwnNodeId()); // Node id
         row.write_uint32(rnode); // Remote node id
         row.write_uint32(globalTransporterRegistry.getPerformState(rnode)); // State
+
+        /* Connect address */
+        if (globalTransporterRegistry.get_transporter(rnode) != NULL &&
+            globalTransporterRegistry.get_connect_address(rnode).s_addr != 0)
+        {
+          row.write_string(inet_ntoa(globalTransporterRegistry.get_connect_address(rnode)));
+        }
+        else
+        {
+          row.write_string("-");
+        }
+
+        /* Bytes sent/received */
+        if (globalTransporterRegistry.get_transporter(rnode) != NULL)
+        {
+          row.write_uint64(globalTransporterRegistry.get_bytes_sent(rnode));
+          row.write_uint64(globalTransporterRegistry.get_bytes_received(rnode));
+        }
+        else
+        {
+          row.write_uint64(0);
+          row.write_uint64(0);
+        }
+
         ndbinfo_send_row(signal, req, row, rl);
-       break;
+        break;
       }
 
       case NodeInfo::INVALID:

=== modified file 'storage/ndb/src/kernel/vm/NdbinfoTables.cpp'
--- a/storage/ndb/src/kernel/vm/NdbinfoTables.cpp	2011-10-17 13:32:49 +0000
+++ b/storage/ndb/src/kernel/vm/NdbinfoTables.cpp	2012-09-28 23:36:17 +0000
@@ -78,13 +78,17 @@ DECLARE_NDBINFO_TABLE(POOLS,12) =
   }
 };
 
-DECLARE_NDBINFO_TABLE(TRANSPORTERS, 3) =
-{ { "transporters", 3, 0, "transporter status" },
+DECLARE_NDBINFO_TABLE(TRANSPORTERS, 6) =
+{ { "transporters", 6, 0, "transporter status" },
   {
     {"node_id",            Ndbinfo::Number, ""},
     {"remote_node_id",     Ndbinfo::Number, ""},
 
-    {"connection_status",  Ndbinfo::Number, ""}
+    {"connection_status",  Ndbinfo::Number, ""},
+    
+    {"remote_address",     Ndbinfo::String, ""},
+    {"bytes_sent",         Ndbinfo::Number64, ""},
+    {"bytes_received",     Ndbinfo::Number64, ""}
   }
 };
 

=== modified file 'storage/ndb/tools/ndbinfo_sql.cpp'
--- a/storage/ndb/tools/ndbinfo_sql.cpp	2011-12-13 12:53:03 +0000
+++ b/storage/ndb/tools/ndbinfo_sql.cpp	2012-09-28 23:36:17 +0000
@@ -66,7 +66,8 @@ struct view {
     "  WHEN 2 THEN \"DISCONNECTED\""
     "  WHEN 3 THEN \"DISCONNECTING\""
     "  ELSE NULL "
-    " END AS status "
+    " END AS status, "
+    " remote_address, bytes_sent, bytes_received "
     "FROM `<NDBINFO_DB>`.`<TABLE_PREFIX>transporters`"
   },
   { "logspaces",

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.1-telco-7.0 branch (frazer.clement:4992 to 4993)Bug#14685458Frazer Clement3 Oct