List:Commits« Previous MessageNext Message »
From:Frazer Clement Date:November 29 2012 5:24pm
Subject:bzr push into mysql-5.1-telco-7.1 branch (frazer.clement:4681 to 4682)
View as plain text  
 4682 Frazer Clement	2012-11-29 [merge]
      Merge 7.0->7.1

    modified:
      mysql-test/suite/ndb/r/ndbinfo.result
      scripts/mysql_system_tables.sql
      storage/ndb/include/transporter/TransporterRegistry.hpp
      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/dblqh/Dblqh.hpp
      storage/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp
      storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
      storage/ndb/src/kernel/blocks/trpman.cpp
      storage/ndb/src/kernel/vm/Ndbinfo.hpp
      storage/ndb/src/kernel/vm/NdbinfoTables.cpp
      storage/ndb/tools/ndbinfo_sql.cpp
 4681 Frazer Clement	2012-11-28 [merge]
      Merge 7.0->7.1

    modified:
      storage/ndb/src/kernel/blocks/backup/BackupProxy.cpp
=== modified file 'mysql-test/suite/ndb/r/ndbinfo.result'
--- a/mysql-test/suite/ndb/r/ndbinfo.result	2012-11-02 20:49:23 +0000
+++ b/mysql-test/suite/ndb/r/ndbinfo.result	2012-11-29 16:55:30 +0000
@@ -491,6 +491,12 @@ LOCAL_READS
 LOCAL_READS_SENT
 LOCAL_TABLE_SCANS_SENT
 LOCAL_WRITES
+LQHKEY_OVERLOAD
+LQHKEY_OVERLOAD_NODE_PEER
+LQHKEY_OVERLOAD_READER
+LQHKEY_OVERLOAD_SUBSCRIBER
+LQHKEY_OVERLOAD_TC
+LQHSCAN_SLOWDOWNS
 OPERATIONS
 PRUNED_RANGE_SCANS_RECEIVED
 RANGE_SCANS

=== modified file 'scripts/mysql_system_tables.sql'
--- a/scripts/mysql_system_tables.sql	2012-11-02 17:37:09 +0000
+++ b/scripts/mysql_system_tables.sql	2012-11-29 16:55:30 +0000
@@ -100,6 +100,8 @@ CREATE TABLE IF NOT EXISTS event ( db ch
 
 CREATE TABLE IF NOT EXISTS ndb_binlog_index (Position BIGINT UNSIGNED NOT NULL, File VARCHAR(255) NOT NULL, epoch BIGINT UNSIGNED NOT NULL, inserts INT UNSIGNED NOT NULL, updates INT UNSIGNED NOT NULL, deletes INT UNSIGNED NOT NULL, schemaops INT UNSIGNED NOT NULL, orig_server_id INT UNSIGNED NOT NULL, orig_epoch BIGINT UNSIGNED NOT NULL, gci INT UNSIGNED NOT NULL, next_position BIGINT UNSIGNED NOT NULL, next_file VARCHAR(255) NOT NULL, PRIMARY KEY(epoch, orig_server_id, orig_epoch)) ENGINE=MYISAM;
 
+
+
 #
 # SQL commands for creating the tables in MySQL Server which
 # are used by the NDBINFO storage engine to access system
@@ -305,7 +307,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,`remote_address` VARCHAR(512),`bytes_sent` BIGINT UNSIGNED,`bytes_received` BIGINT UNSIGNED) COMMENT="transporter status" ENGINE=NDBINFO','SET @dummy = 0');
+SET @str=IF(@have_ndbinfo,'CREATE TABLE `ndbinfo`.`ndb$transporters` (`node_id` INT UNSIGNED COMMENT "Node id reporting",`remote_node_id` INT UNSIGNED COMMENT "Node id at other end of link",`connection_status` INT UNSIGNED COMMENT "State of inter-node link",`remote_address` VARCHAR(512) COMMENT "Address of remote node",`bytes_sent` BIGINT UNSIGNED COMMENT "Bytes sent to remote node",`bytes_received` BIGINT UNSIGNED COMMENT "Bytes received from remote node",`connect_count` INT UNSIGNED COMMENT "Number of times connected",`overloaded` INT UNSIGNED COMMENT "Is link reporting overload",`overload_count` INT UNSIGNED COMMENT "Number of overload onsets since connect",`slowdown` INT UNSIGNED COMMENT "Is link requesting slowdown",`slowdown_count` INT UNSIGNED COMMENT "Number of slowdown onsets since connect") COMMENT="transporter status" ENGINE=NDBINFO','SET @dummy = 0');
 PREPARE stmt FROM @str;
 EXECUTE stmt;
 DROP PREPARE stmt;
@@ -448,7 +450,7 @@ PREPARE stmt FROM @str;
 EXECUTE stmt;
 DROP PREPARE stmt;
 
-SET @str=IF(@have_ndbinfo,'INSERT INTO `ndbinfo`.`config_params` VALUES (179, "MaxNoOfSubscriptions"), (180, "MaxNoOfSubscribers"), (181, "MaxNoOfConcurrentSubOperations"), (5, "HostName"), (3, "NodeId"), (101, "NoOfReplicas"), (103, "MaxNoOfAttributes"), (102, "MaxNoOfTables"), (149, "MaxNoOfOrderedIndexes"), (150, "MaxNoOfUniqueHashIndexes"), (110, "MaxNoOfConcurrentIndexOperations"), (105, "MaxNoOfTriggers"), (109, "MaxNoOfFiredTriggers"), (100, "MaxNoOfSavedMessages"), (177, "LockExecuteThreadToCPU"), (178, "LockMaintThreadsToCPU"), (176, "RealtimeScheduler"), (114, "LockPagesInMainMemory"), (123, "TimeBetweenWatchDogCheck"), (174, "SchedulerExecutionTimer"), (175, "SchedulerSpinTimer"), (141, "TimeBetweenWatchDogCheckInitial"), (124, "StopOnError"), (107, "MaxNoOfConcurrentOperations"), (627, "MaxDMLOperationsPerTransaction"), (151, "MaxNoOfLocalOperations"), (152, "MaxNoOfLocalScans"), (153, "BatchSizePerLocalScan"), (106, "MaxNoOfConcurrentTransactions"), (108, "MaxN!
 oOfConcurrentScans"), (111, "TransactionBufferMemory"), (113, "IndexMemory"), (112, "DataMemory"), (154, "UndoIndexBuffer"), (155, "UndoDataBuffer"), (156, "RedoBuffer"), (157, "LongMessageBuffer"), (160, "DiskPageBufferMemory"), (198, "SharedGlobalMemory"), (115, "StartPartialTimeout"), (116, "StartPartitionedTimeout"), (117, "StartFailureTimeout"), (619, "StartNoNodegroupTimeout"), (118, "HeartbeatIntervalDbDb"), (618, "ConnectCheckIntervalDelay"), (119, "HeartbeatIntervalDbApi"), (120, "TimeBetweenLocalCheckpoints"), (121, "TimeBetweenGlobalCheckpoints"), (170, "TimeBetweenEpochs"), (171, "TimeBetweenEpochsTimeout"), (182, "MaxBufferedEpochs"), (126, "NoOfFragmentLogFiles"), (140, "FragmentLogFileSize"), (189, "InitFragmentLogFiles"), (190, "DiskIOThreadPool"), (159, "MaxNoOfOpenFiles"), (162, "InitialNoOfOpenFiles"), (129, "TimeBetweenInactiveTransactionAbortCheck"), (130, "TransactionInactiveTimeout"), (131, "TransactionDeadlockDetectionTimeout"), (148, "Diskless"), (1!
 22, "ArbitrationTimeout"), (142, "Arbitration"), (7, "DataDir"!
 ), (125,
 "FileSystemPath"), (250, "LogLevelStartup"), (251, "LogLevelShutdown"), (252, "LogLevelStatistic"), (253, "LogLevelCheckpoint"), (254, "LogLevelNodeRestart"), (255, "LogLevelConnection"), (259, "LogLevelCongestion"), (258, "LogLevelError"), (256, "LogLevelInfo"), (158, "BackupDataDir"), (163, "DiskSyncSize"), (164, "DiskCheckpointSpeed"), (165, "DiskCheckpointSpeedInRestart"), (133, "BackupMemory"), (134, "BackupDataBufferSize"), (135, "BackupLogBufferSize"), (136, "BackupWriteSize"), (139, "BackupMaxWriteSize"), (161, "StringMemory"), (169, "MaxAllocate"), (166, "MemReportFrequency"), (167, "BackupReportFrequency"), (184, "StartupStatusReportFrequency"), (168, "ODirect"), (172, "CompressedBackup"), (173, "CompressedLCP"), (9, "TotalSendBufferMemory"), (202, "ReservedSendBufferMemory"), (185, "Nodegroup"), (186, "MaxNoOfExecutionThreads"), (188, "__ndbmt_lqh_workers"), (187, "__ndbmt_lqh_threads"), (191, "__ndbmt_classic"), (628, "ThreadConfig"), (193, "FileSystemPathDD"), !
 (194, "FileSystemPathDataFiles"), (195, "FileSystemPathUndoFiles"), (196, "InitialLogfileGroup"), (197, "InitialTablespace"), (605, "MaxLCPStartDelay"), (606, "BuildIndexThreads"), (607, "HeartbeatOrder"), (608, "DictTrace"), (609, "MaxStartFailRetries"), (610, "StartFailRetryDelay"), (613, "EventLogBufferSize"), (614, "Numa"), (611, "RedoOverCommitLimit"), (612, "RedoOverCommitCounter"), (615, "LateAlloc"), (616, "TwoPassInitialNodeRestartCopy"), (617, "MaxParallelScansPerFragment"), (620, "IndexStatAutoCreate"), (621, "IndexStatAutoUpdate"), (622, "IndexStatSaveSize"), (623, "IndexStatSaveScale"), (624, "IndexStatTriggerPct"), (625, "IndexStatTriggerScale"), (626, "IndexStatUpdateDelay"), (629, "CrashOnCorruptedTuple"), (630, "MinFreePct")','SET @dummy = 0');
+SET @str=IF(@have_ndbinfo,'INSERT INTO `ndbinfo`.`config_params` VALUES (179, "MaxNoOfSubscriptions"), (180, "MaxNoOfSubscribers"), (181, "MaxNoOfConcurrentSubOperations"), (5, "HostName"), (3, "NodeId"), (101, "NoOfReplicas"), (103, "MaxNoOfAttributes"), (102, "MaxNoOfTables"), (149, "MaxNoOfOrderedIndexes"), (150, "MaxNoOfUniqueHashIndexes"), (110, "MaxNoOfConcurrentIndexOperations"), (105, "MaxNoOfTriggers"), (109, "MaxNoOfFiredTriggers"), (100, "MaxNoOfSavedMessages"), (177, "LockExecuteThreadToCPU"), (178, "LockMaintThreadsToCPU"), (176, "RealtimeScheduler"), (114, "LockPagesInMainMemory"), (123, "TimeBetweenWatchDogCheck"), (174, "SchedulerExecutionTimer"), (175, "SchedulerSpinTimer"), (141, "TimeBetweenWatchDogCheckInitial"), (124, "StopOnError"), (107, "MaxNoOfConcurrentOperations"), (627, "MaxDMLOperationsPerTransaction"), (151, "MaxNoOfLocalOperations"), (152, "MaxNoOfLocalScans"), (153, "BatchSizePerLocalScan"), (106, "MaxNoOfConcurrentTransactions"), (108, "MaxN!
 oOfConcurrentScans"), (111, "TransactionBufferMemory"), (113, "IndexMemory"), (112, "DataMemory"), (154, "UndoIndexBuffer"), (155, "UndoDataBuffer"), (156, "RedoBuffer"), (157, "LongMessageBuffer"), (160, "DiskPageBufferMemory"), (198, "SharedGlobalMemory"), (115, "StartPartialTimeout"), (116, "StartPartitionedTimeout"), (117, "StartFailureTimeout"), (619, "StartNoNodegroupTimeout"), (118, "HeartbeatIntervalDbDb"), (618, "ConnectCheckIntervalDelay"), (119, "HeartbeatIntervalDbApi"), (120, "TimeBetweenLocalCheckpoints"), (121, "TimeBetweenGlobalCheckpoints"), (170, "TimeBetweenEpochs"), (171, "TimeBetweenEpochsTimeout"), (182, "MaxBufferedEpochs"), (632, "NoOfFragmentLogParts"), (126, "NoOfFragmentLogFiles"), (140, "FragmentLogFileSize"), (189, "InitFragmentLogFiles"), (190, "DiskIOThreadPool"), (159, "MaxNoOfOpenFiles"), (162, "InitialNoOfOpenFiles"), (129, "TimeBetweenInactiveTransactionAbortCheck"), (130, "TransactionInactiveTimeout"), (131, "TransactionDeadlockDetectionT!
 imeout"), (148, "Diskless"), (122, "ArbitrationTimeout"), (142!
 , "Arbit
ration"), (7, "DataDir"), (125, "FileSystemPath"), (250, "LogLevelStartup"), (251, "LogLevelShutdown"), (252, "LogLevelStatistic"), (253, "LogLevelCheckpoint"), (254, "LogLevelNodeRestart"), (255, "LogLevelConnection"), (259, "LogLevelCongestion"), (258, "LogLevelError"), (256, "LogLevelInfo"), (158, "BackupDataDir"), (163, "DiskSyncSize"), (164, "DiskCheckpointSpeed"), (165, "DiskCheckpointSpeedInRestart"), (133, "BackupMemory"), (134, "BackupDataBufferSize"), (135, "BackupLogBufferSize"), (136, "BackupWriteSize"), (139, "BackupMaxWriteSize"), (161, "StringMemory"), (169, "MaxAllocate"), (166, "MemReportFrequency"), (167, "BackupReportFrequency"), (184, "StartupStatusReportFrequency"), (168, "ODirect"), (172, "CompressedBackup"), (173, "CompressedLCP"), (203, "ExtraSendBufferMemory"), (9, "TotalSendBufferMemory"), (185, "Nodegroup"), (186, "MaxNoOfExecutionThreads"), (188, "__ndbmt_lqh_workers"), (187, "__ndbmt_lqh_threads"), (191, "__ndbmt_classic"), (628, "ThreadConfig"),!
  (193, "FileSystemPathDD"), (194, "FileSystemPathDataFiles"), (195, "FileSystemPathUndoFiles"), (196, "InitialLogfileGroup"), (197, "InitialTablespace"), (605, "MaxLCPStartDelay"), (606, "BuildIndexThreads"), (607, "HeartbeatOrder"), (608, "DictTrace"), (609, "MaxStartFailRetries"), (610, "StartFailRetryDelay"), (613, "EventLogBufferSize"), (614, "Numa"), (611, "RedoOverCommitLimit"), (612, "RedoOverCommitCounter"), (615, "LateAlloc"), (616, "TwoPassInitialNodeRestartCopy"), (617, "MaxParallelScansPerFragment"), (620, "IndexStatAutoCreate"), (621, "IndexStatAutoUpdate"), (622, "IndexStatSaveSize"), (623, "IndexStatSaveScale"), (624, "IndexStatTriggerPct"), (625, "IndexStatTriggerScale"), (626, "IndexStatUpdateDelay"), (629, "CrashOnCorruptedTuple"), (630, "MinFreePct")','SET @dummy = 0');
 PREPARE stmt FROM @str;
 EXECUTE stmt;
 DROP PREPARE stmt;
@@ -476,7 +478,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,  remote_address, bytes_sent, bytes_received 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,  connect_count,  overloaded, overload_count, slowdown, slowdown_count FROM `ndbinfo`.`ndb$transporters`','SET @dummy = 0');
 PREPARE stmt FROM @str;
 EXECUTE stmt;
 DROP PREPARE stmt;
@@ -500,7 +502,7 @@ EXECUTE stmt;
 DROP PREPARE stmt;
 
 # ndbinfo.counters
-SET @str=IF(@have_ndbinfo,'CREATE OR REPLACE DEFINER=`root@localhost` SQL SECURITY INVOKER VIEW `ndbinfo`.`counters` AS SELECT node_id, b.block_name, block_instance, counter_id, CASE counter_id  WHEN 1 THEN "ATTRINFO"  WHEN 2 THEN "TRANSACTIONS"  WHEN 3 THEN "COMMITS"  WHEN 4 THEN "READS"  WHEN 5 THEN "SIMPLE_READS"  WHEN 6 THEN "WRITES"  WHEN 7 THEN "ABORTS"  WHEN 8 THEN "TABLE_SCANS"  WHEN 9 THEN "RANGE_SCANS"  WHEN 10 THEN "OPERATIONS"  WHEN 11 THEN "READS_RECEIVED"  WHEN 12 THEN "LOCAL_READS_SENT"  WHEN 13 THEN "REMOTE_READS_SENT"  WHEN 14 THEN "READS_NOT_FOUND"  WHEN 15 THEN "TABLE_SCANS_RECEIVED"  WHEN 16 THEN "LOCAL_TABLE_SCANS_SENT"  WHEN 17 THEN "RANGE_SCANS_RECEIVED"  WHEN 18 THEN "LOCAL_RANGE_SCANS_SENT"  WHEN 19 THEN "REMOTE_RANGE_SCANS_SENT"  WHEN 20 THEN "SCAN_BATCHES_RETURNED"  WHEN 21 THEN "SCAN_ROWS_RETURNED"  WHEN 22 THEN "PRUNED_RANGE_SCANS_RECEIVED"  WHEN 23 THEN "CONST_PRUNED_RANGE_SCANS_RECEIVED"  WHEN 24 THEN "LOCAL_READS"  WHEN 25 THEN "LOCAL_WRITES"!
   ELSE "<unknown>"  END AS counter_name, val FROM `ndbinfo`.`ndb$counters` c LEFT JOIN `ndbinfo`.blocks b ON c.block_number = b.block_number','SET @dummy = 0');
+SET @str=IF(@have_ndbinfo,'CREATE OR REPLACE DEFINER=`root@localhost` SQL SECURITY INVOKER VIEW `ndbinfo`.`counters` AS SELECT node_id, b.block_name, block_instance, counter_id, CASE counter_id  WHEN 1 THEN "ATTRINFO"  WHEN 2 THEN "TRANSACTIONS"  WHEN 3 THEN "COMMITS"  WHEN 4 THEN "READS"  WHEN 5 THEN "SIMPLE_READS"  WHEN 6 THEN "WRITES"  WHEN 7 THEN "ABORTS"  WHEN 8 THEN "TABLE_SCANS"  WHEN 9 THEN "RANGE_SCANS"  WHEN 10 THEN "OPERATIONS"  WHEN 11 THEN "READS_RECEIVED"  WHEN 12 THEN "LOCAL_READS_SENT"  WHEN 13 THEN "REMOTE_READS_SENT"  WHEN 14 THEN "READS_NOT_FOUND"  WHEN 15 THEN "TABLE_SCANS_RECEIVED"  WHEN 16 THEN "LOCAL_TABLE_SCANS_SENT"  WHEN 17 THEN "RANGE_SCANS_RECEIVED"  WHEN 18 THEN "LOCAL_RANGE_SCANS_SENT"  WHEN 19 THEN "REMOTE_RANGE_SCANS_SENT"  WHEN 20 THEN "SCAN_BATCHES_RETURNED"  WHEN 21 THEN "SCAN_ROWS_RETURNED"  WHEN 22 THEN "PRUNED_RANGE_SCANS_RECEIVED"  WHEN 23 THEN "CONST_PRUNED_RANGE_SCANS_RECEIVED"  WHEN 24 THEN "LOCAL_READS"  WHEN 25 THEN "LOCAL_WRITES"!
   WHEN 26 THEN "LQHKEY_OVERLOAD"  WHEN 27 THEN "LQHKEY_OVERLOAD_TC"  WHEN 28 THEN "LQHKEY_OVERLOAD_READER"  WHEN 29 THEN "LQHKEY_OVERLOAD_NODE_PEER"  WHEN 30 THEN "LQHKEY_OVERLOAD_SUBSCRIBER"  WHEN 31 THEN "LQHSCAN_SLOWDOWNS"  ELSE "<unknown>"  END AS counter_name, val FROM `ndbinfo`.`ndb$counters` c LEFT JOIN `ndbinfo`.blocks b ON c.block_number = b.block_number','SET @dummy = 0');
 PREPARE stmt FROM @str;
 EXECUTE stmt;
 DROP PREPARE stmt;
@@ -588,4 +590,3 @@ SET @str=IF(@have_ndbinfo,'SET @@global.
 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-28 23:36:17 +0000
+++ b/storage/ndb/include/transporter/TransporterRegistry.hpp	2012-11-29 16:35:49 +0000
@@ -294,6 +294,11 @@ public:
   bool get_using_default_send_buffer() const{ return m_use_default_send_buffer;}
 
   /**
+   * Get transporter's connect count
+   */
+  Uint32 get_connect_count(Uint32 nodeId);
+
+  /**
    * Set or clear overloaded bit.
    * Query if any overloaded bit is set.
    */
@@ -301,12 +306,22 @@ public:
   const NodeBitmask& get_status_overloaded() const;
   
   /**
+   * Get transporter's overload count since connect
+   */
+  Uint32 get_overload_count(Uint32 nodeId);
+
+  /**
    * Set or clear slowdown bit.
    * Query if any slowdown bit is set.
    */
   void set_status_slowdown(Uint32 nodeId, bool val);
   const NodeBitmask& get_status_slowdown() const;
  
+  /** 
+   * Get transporter's slowdown count since connect
+   */
+  Uint32 get_slowdown_count(Uint32 nodeId);
+
   /**
    * prepareSend
    *
@@ -517,6 +532,10 @@ private:
   virtual Uint32 updateWritePtr(NodeId node, Uint32 lenBytes, Uint32 prio);
   virtual bool forceSend(NodeId node);
 
+
+  /* Various internal */
+  void inc_overload_count(Uint32 nodeId);
+  void inc_slowdown_count(Uint32 nodeId);
 private:
   /* Send buffer pages. */
   struct SendBufferPage {
@@ -610,7 +629,11 @@ TransporterRegistry::set_status_overload
 {
   assert(nodeId < MAX_NODES);
   if (val != m_status_overloaded.get(nodeId))
+  {
     m_status_overloaded.set(nodeId, val);
+    if (val)
+      inc_overload_count(nodeId);
+  }
   if (val)
     set_status_slowdown(nodeId, val);
 }
@@ -626,7 +649,11 @@ TransporterRegistry::set_status_slowdown
 {
   assert(nodeId < MAX_NODES);
   if (val != m_status_slowdown.get(nodeId))
+  {
     m_status_slowdown.set(nodeId, val);
+    if (val)
+      inc_slowdown_count(nodeId);
+  }
 }
 
 inline const NodeBitmask&

=== modified file 'storage/ndb/src/common/transporter/Transporter.cpp'
--- a/storage/ndb/src/common/transporter/Transporter.cpp	2012-09-28 23:36:17 +0000
+++ b/storage/ndb/src/common/transporter/Transporter.cpp	2012-11-29 16:35:49 +0000
@@ -45,6 +45,8 @@ Transporter::Transporter(TransporterRegi
     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),
+    m_connect_count(0),
+    m_overload_count(0), m_slowdown_count(0),
     isMgmConnection(_isMgmConnection),
     m_connected(false),
     m_type(_type),
@@ -149,6 +151,9 @@ Transporter::connect_server(NDB_SOCKET_T
     DBUG_RETURN(false);
   }
 
+  m_connect_count++;
+  resetCounters();
+
   m_connected  = true;
 
   DBUG_RETURN(true);
@@ -275,6 +280,9 @@ Transporter::connect_client(NDB_SOCKET_T
   if (!connect_client_impl(sockfd))
     DBUG_RETURN(false);
 
+  m_connect_count++;
+  resetCounters();
+
   m_connected = true;
 
   DBUG_RETURN(true);
@@ -287,9 +295,15 @@ Transporter::doDisconnect() {
     return;
 
   m_connected = false;
-  m_bytes_sent = 0;
-  m_bytes_received = 0;
 
   disconnectImpl();
 }
 
+void
+Transporter::resetCounters()
+{
+  m_bytes_sent = 0;
+  m_bytes_received = 0;
+  m_overload_count = 0;
+  m_slowdown_count = 0;
+};

=== modified file 'storage/ndb/src/common/transporter/Transporter.hpp'
--- a/storage/ndb/src/common/transporter/Transporter.hpp	2012-09-28 23:36:17 +0000
+++ b/storage/ndb/src/common/transporter/Transporter.hpp	2012-11-29 16:35:49 +0000
@@ -104,6 +104,13 @@ public:
   /* Get the configured maximum send buffer usage. */
   Uint32 get_max_send_buffer() { return m_max_send_buffer; }
 
+  Uint32 get_connect_count() { return m_connect_count; }
+
+  void inc_overload_count() { m_overload_count++; }
+  Uint32 get_overload_count() { return m_overload_count; }
+  void inc_slowdown_count() { m_slowdown_count++; }
+  Uint32 get_slowdown_count() { return m_slowdown_count; }
+
 protected:
   Transporter(TransporterRegistry &,
 	      TransporterType,
@@ -158,8 +165,12 @@ protected:
   /* Overload limit, as configured with the OverloadLimit config parameter. */
   Uint32 m_overload_limit;
   Uint32 m_slowdown_limit;
+  void resetCounters();
   Uint64 m_bytes_sent;
   Uint64 m_bytes_received;
+  Uint32 m_connect_count;
+  Uint32 m_overload_count;
+  Uint32 m_slowdown_count;
 
 private:
 

=== modified file 'storage/ndb/src/common/transporter/TransporterRegistry.cpp'
--- a/storage/ndb/src/common/transporter/TransporterRegistry.cpp	2012-09-28 23:50:32 +0000
+++ b/storage/ndb/src/common/transporter/TransporterRegistry.cpp	2012-11-29 16:55:30 +0000
@@ -801,7 +801,8 @@ TransporterRegistry::prepareSend(Transpo
 	 */
 	for(int i = 0; i<50; i++){
 	  if((nSHMTransporters+nSCITransporters) == 0)
-	    NdbSleep_MilliSleep(sleepTime); 
+	    NdbSleep_MilliSleep(sleepTime);
+          /* FC : Consider counting sleeps here */
 	  insertPtr = getWritePtr(sendHandle, nodeId, lenBytes, prio);
 	  if(insertPtr != 0){
 	    t->m_packer.pack(insertPtr, prio, signalHeader, signalData, ptr);
@@ -2563,5 +2564,45 @@ TransporterRegistry::print_transporters(
   }
 }
 
+void 
+TransporterRegistry::inc_overload_count(Uint32 nodeId)
+{
+  assert(nodeId < MAX_NODES);
+  assert(theTransporters[nodeId] != NULL);
+  theTransporters[nodeId]->inc_overload_count();
+}
+
+void 
+TransporterRegistry::inc_slowdown_count(Uint32 nodeId)
+{
+  assert(nodeId < MAX_NODES);
+  assert(theTransporters[nodeId] != NULL);
+  theTransporters[nodeId]->inc_slowdown_count();
+}
+
+Uint32
+TransporterRegistry::get_overload_count(Uint32 nodeId)
+{
+  assert(nodeId < MAX_NODES);
+  assert(theTransporters[nodeId] != NULL);
+  return theTransporters[nodeId]->get_overload_count();
+}
+
+Uint32
+TransporterRegistry::get_slowdown_count(Uint32 nodeId)
+{
+  assert(nodeId < MAX_NODES);
+  assert(theTransporters[nodeId] != NULL);
+  return theTransporters[nodeId]->get_slowdown_count();
+}
+
+Uint32
+TransporterRegistry::get_connect_count(Uint32 nodeId)
+{
+  assert(nodeId < MAX_NODES);
+  assert(theTransporters[nodeId] != NULL);
+  return theTransporters[nodeId]->get_connect_count();
+}
+
 
 template class Vector<TransporterRegistry::Transporter_interface>;

=== modified file 'storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp'
--- a/storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp	2012-11-07 17:29:01 +0000
+++ b/storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp	2012-11-29 16:35:49 +0000
@@ -3337,6 +3337,18 @@ public:
   Uint64 cTotalLqhKeyReqCount;
   Uint32 c_max_parallel_scans_per_frag;
 
+  Uint64 c_keyOverloads;
+  
+  /* All that apply */
+  Uint64 c_keyOverloadsTcNode;
+  Uint64 c_keyOverloadsReaderApi;
+  Uint64 c_keyOverloadsPeerNode;
+  Uint64 c_keyOverloadsSubscriber;
+  
+  Uint64 c_scanSlowDowns; 
+    
+
+
   inline bool getAllowRead() const {
     return getNodeState().startLevel < NodeState::SL_STOPPING_3;
   }

=== modified file 'storage/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp'
--- a/storage/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp	2012-11-07 17:29:01 +0000
+++ b/storage/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp	2012-11-29 16:35:49 +0000
@@ -99,6 +99,14 @@ void Dblqh::initData()
   c_lcpFragWatchdog.block = this;
   c_lcpFragWatchdog.reset();
   c_lcpFragWatchdog.thread_active = false;
+
+  c_keyOverloads           = 0;
+  c_keyOverloadsTcNode     = 0;
+  c_keyOverloadsReaderApi  = 0;
+  c_keyOverloadsPeerNode   = 0;
+  c_keyOverloadsSubscriber = 0;
+  c_scanSlowDowns          = 0;
+
 }//Dblqh::initData()
 
 void Dblqh::initRecords() 

=== modified file 'storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp'
--- a/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp	2012-11-07 17:49:59 +0000
+++ b/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp	2012-11-29 16:55:30 +0000
@@ -4373,6 +4373,7 @@ Dblqh::checkTransporterOverloaded(Signal
                                   const NodeBitmask& all,
                                   const LqhKeyReq* req)
 {
+  /* FC : Quick exit if the mask is clear? */
   // nodes likely to be affected by this op
   NodeBitmask mask;
   // tc
@@ -4395,7 +4396,58 @@ Dblqh::checkTransporterOverloaded(Signal
     mask.bitOR(suma->getSubscriberNodes());
   }
   mask.bitAND(all);
-  return !mask.isclear();
+  if (likely(mask.isclear()))
+  {
+    return false;
+  }
+
+  jam();
+  /* Overloaded, do some accounting */
+  c_keyOverloads++;
+  
+  if (tc_node < MAX_NODES && all.get(tc_node))
+  {
+    jam();
+    c_keyOverloadsTcNode++;
+  }
+  
+  if (op == ZREAD || op == ZREAD_EX || op == ZUNLOCK) 
+  {
+    jam();
+    // the receiver
+    Uint32 api_node = refToNode(req->variableData[0]);
+    if ((api_node < MAX_NODES) && // not worth to crash here
+        (all.get(api_node)))
+    {
+      jam();
+      c_keyOverloadsReaderApi++;
+    }
+  } 
+  else 
+  {
+    jam();
+    // write    
+    // next replica
+    Uint32 replica_node = LqhKeyReq::getNextReplicaNodeId(req->fragmentData);
+    if ((replica_node < MAX_NODES) &&
+        (all.get(replica_node)))
+    {
+      jam();
+      c_keyOverloadsPeerNode++;
+    }
+    
+    // event subscribers
+    const Suma* suma = (Suma*)globalData.getBlock(SUMA);
+    NodeBitmask subscribers = suma->getSubscriberNodes();
+    subscribers.bitAND(all);
+    if (!subscribers.isclear())
+    {
+      jam();
+      c_keyOverloadsSubscriber++;
+    }
+  }
+  
+  return true;
 }
 
 void Dblqh::execSIGNAL_DROPPED_REP(Signal* signal)
@@ -4494,9 +4546,7 @@ void Dblqh::execLQHKEYREQ(Signal* signal
     {
       if (checkTransporterOverloaded(signal, all, lqhKeyReq))
       {
-        /**
-         * TODO: We should have counters for this...
-         */
+        /* Overloaded, reject new work */
         jam();
         releaseSections(handle);
         earlyKeyReqAbort(signal, lqhKeyReq, ZTRANSPORTER_OVERLOADED_ERROR);
@@ -11411,9 +11461,10 @@ void Dblqh::scanTupkeyConfLab(Signal* si
       /**
        * End scan batch if transporter-buffer are in slowdown state
        *
-       * TODO: We should have counters for this...
        */
       scanptr.p->m_stop_batch = 1;
+      
+      c_scanSlowDowns++;
     }
   }
 
@@ -23813,7 +23864,13 @@ void Dblqh::execDBINFO_SCANREQ(Signal *s
   case Ndbinfo::COUNTERS_TABLEID:
   {
     Ndbinfo::counter_entry counters[] = {
-      { Ndbinfo::OPERATIONS_COUNTER, c_Counters.operations }
+      { Ndbinfo::OPERATIONS_COUNTER,              c_Counters.operations },
+      { Ndbinfo::LQHKEY_OVERLOAD,                 c_keyOverloads },
+      { Ndbinfo::LQHKEY_OVERLOAD_TC,              c_keyOverloadsTcNode },
+      { Ndbinfo::LQHKEY_OVERLOAD_READER,          c_keyOverloadsReaderApi },
+      { Ndbinfo::LQHKEY_OVERLOAD_NODE_PEER,       c_keyOverloadsPeerNode },
+      { Ndbinfo::LQHKEY_OVERLOAD_SUBSCRIBER,      c_keyOverloadsSubscriber },
+      { Ndbinfo::LQHSCAN_SLOWDOWN,                c_scanSlowDowns }
     };
     const size_t num_counters = sizeof(counters) / sizeof(counters[0]);
 

=== modified file 'storage/ndb/src/kernel/blocks/trpman.cpp'
--- a/storage/ndb/src/kernel/blocks/trpman.cpp	2012-09-28 23:36:17 +0000
+++ b/storage/ndb/src/kernel/blocks/trpman.cpp	2012-11-29 16:35:49 +0000
@@ -404,27 +404,44 @@ Trpman::execDBINFO_SCANREQ(Signal *signa
         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)
         {
+          jam();
+          /* Connect address */
+          if (globalTransporterRegistry.get_connect_address(rnode).s_addr != 0)
+          {
+            jam();
+            row.write_string(inet_ntoa(globalTransporterRegistry.get_connect_address(rnode)));
+          }
+          else
+          {
+            jam();
+            row.write_string("-");
+          }
+          
+          /* Bytes sent/received */
           row.write_uint64(globalTransporterRegistry.get_bytes_sent(rnode));
           row.write_uint64(globalTransporterRegistry.get_bytes_received(rnode));
+          
+          /* Connect count, overload and Slowdown states */
+          row.write_uint32(globalTransporterRegistry.get_connect_count(rnode));
+          row.write_uint32(globalTransporterRegistry.get_status_overloaded().get(rnode));
+          row.write_uint32(globalTransporterRegistry.get_overload_count(rnode));
+          row.write_uint32(globalTransporterRegistry.get_status_slowdown().get(rnode));
+          row.write_uint32(globalTransporterRegistry.get_slowdown_count(rnode));
         }
         else
         {
-          row.write_uint64(0);
-          row.write_uint64(0);
+          /* Null transporter */
+          jam();
+          row.write_string("-");  /* Remote address */
+          row.write_uint64(0);    /* Bytes sent */
+          row.write_uint64(0);    /* Bytes received */
+          row.write_uint32(0);    /* Connect count */
+          row.write_uint32(0);    /* Overloaded */
+          row.write_uint32(0);    /* Overload_count */
+          row.write_uint32(0);    /* Slowdown */
+          row.write_uint32(0);    /* Slowdown_count */
         }
 
         ndbinfo_send_row(signal, req, row, rl);

=== modified file 'storage/ndb/src/kernel/vm/Ndbinfo.hpp'
--- a/storage/ndb/src/kernel/vm/Ndbinfo.hpp	2012-11-02 17:37:09 +0000
+++ b/storage/ndb/src/kernel/vm/Ndbinfo.hpp	2012-11-29 16:55:30 +0000
@@ -204,7 +204,13 @@ public:
     SPJ_PRUNED_RANGE_SCANS_RECEIVED_COUNTER = 22,
     SPJ_CONST_PRUNED_RANGE_SCANS_RECEIVED_COUNTER = 23,
     LOCAL_READ_COUNTER = 24,
-    LOCAL_WRITE_COUNTER = 25
+    LOCAL_WRITE_COUNTER = 25,
+    LQHKEY_OVERLOAD = 26,
+    LQHKEY_OVERLOAD_TC = 27,
+    LQHKEY_OVERLOAD_READER = 28,
+    LQHKEY_OVERLOAD_NODE_PEER = 29,
+    LQHKEY_OVERLOAD_SUBSCRIBER = 30,
+    LQHSCAN_SLOWDOWN = 31
   };
 
   struct counter_entry {

=== modified file 'storage/ndb/src/kernel/vm/NdbinfoTables.cpp'
--- a/storage/ndb/src/kernel/vm/NdbinfoTables.cpp	2012-11-02 17:37:09 +0000
+++ b/storage/ndb/src/kernel/vm/NdbinfoTables.cpp	2012-11-29 16:55:30 +0000
@@ -78,17 +78,25 @@ DECLARE_NDBINFO_TABLE(POOLS,12) =
   }
 };
 
-DECLARE_NDBINFO_TABLE(TRANSPORTERS, 6) =
-{ { "transporters", 6, 0, "transporter status" },
+DECLARE_NDBINFO_TABLE(TRANSPORTERS, 11) =
+{ { "transporters", 11, 0, "transporter status" },
   {
-    {"node_id",            Ndbinfo::Number, ""},
-    {"remote_node_id",     Ndbinfo::Number, ""},
+    {"node_id",              Ndbinfo::Number, "Node id reporting"},
+    {"remote_node_id",       Ndbinfo::Number, "Node id at other end of link"},
 
-    {"connection_status",  Ndbinfo::Number, ""},
+    {"connection_status",    Ndbinfo::Number, "State of inter-node link"},
     
-    {"remote_address",     Ndbinfo::String, ""},
-    {"bytes_sent",         Ndbinfo::Number64, ""},
-    {"bytes_received",     Ndbinfo::Number64, ""}
+    {"remote_address",       Ndbinfo::String, "Address of remote node"},
+    {"bytes_sent",           Ndbinfo::Number64, "Bytes sent to remote node"},
+    {"bytes_received",       Ndbinfo::Number64, "Bytes received from remote node"},
+
+    {"connect_count",        Ndbinfo::Number, "Number of times connected" },
+    
+    {"overloaded",           Ndbinfo::Number, "Is link reporting overload"},
+    {"overload_count",       Ndbinfo::Number, "Number of overload onsets since connect"},
+    
+    {"slowdown",             Ndbinfo::Number, "Is link requesting slowdown"},
+    {"slowdown_count",       Ndbinfo::Number, "Number of slowdown onsets since connect"}
   }
 };
 

=== modified file 'storage/ndb/tools/ndbinfo_sql.cpp'
--- a/storage/ndb/tools/ndbinfo_sql.cpp	2012-11-02 17:37:09 +0000
+++ b/storage/ndb/tools/ndbinfo_sql.cpp	2012-11-29 16:55:30 +0000
@@ -67,7 +67,9 @@ struct view {
     "  WHEN 3 THEN \"DISCONNECTING\""
     "  ELSE NULL "
     " END AS status, "
-    " remote_address, bytes_sent, bytes_received "
+    " remote_address, bytes_sent, bytes_received, "
+    " connect_count, "
+    " overloaded, overload_count, slowdown, slowdown_count "
     "FROM `<NDBINFO_DB>`.`<TABLE_PREFIX>transporters`"
   },
   { "logspaces",
@@ -137,6 +139,12 @@ struct view {
     "  WHEN 23 THEN \"CONST_PRUNED_RANGE_SCANS_RECEIVED\""
     "  WHEN 24 THEN \"LOCAL_READS\""
     "  WHEN 25 THEN \"LOCAL_WRITES\""
+    "  WHEN 26 THEN \"LQHKEY_OVERLOAD\""
+    "  WHEN 27 THEN \"LQHKEY_OVERLOAD_TC\""
+    "  WHEN 28 THEN \"LQHKEY_OVERLOAD_READER\""
+    "  WHEN 29 THEN \"LQHKEY_OVERLOAD_NODE_PEER\""
+    "  WHEN 30 THEN \"LQHKEY_OVERLOAD_SUBSCRIBER\""
+    "  WHEN 31 THEN \"LQHSCAN_SLOWDOWNS\""
     "  ELSE \"<unknown>\" "
     " END AS counter_name, "
     "val "

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.1-telco-7.1 branch (frazer.clement:4681 to 4682) Frazer Clement29 Nov