List:Commits« Previous MessageNext Message »
From:Maitrayi Sabaratnam Date:April 12 2011 3:04pm
Subject:bzr push into mysql-5.1-telco-7.1 branch (maitrayi.sabaratnam:4162 to 4164)
View as plain text  
 4164 Maitrayi Sabaratnam	2011-04-12
      Bug 12330248: Change mysql_system_tables.sql to handle generation

    modified:
      scripts/mysql_system_tables.sql
 4163 Maitrayi Sabaratnam	2011-04-12 [merge]
      Merge from 7.0

    modified:
      storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp
      storage/ndb/src/kernel/vm/Configuration.cpp
      storage/ndb/src/kernel/vm/Configuration.hpp
      storage/ndb/src/kernel/vm/NdbinfoTables.cpp
      storage/ndb/tools/ndbinfo_sql.cpp
 4162 jonas oreland	2011-04-11 [merge]
      ndb - merge 70 to 71

    modified:
      mysql-test/suite/ndb/r/ndb_alter_table_online.result
      mysql-test/suite/ndb/r/ndb_basic.result
      mysql-test/suite/ndb/r/ndb_create_table.result
      mysql-test/suite/ndb/r/ndb_restore_misc.result
      mysql-test/suite/ndb/t/ndb_alter_table_online.test
      mysql-test/suite/ndb/t/ndb_basic.test
      mysql-test/suite/ndb/t/ndb_create_table.test
      mysql-test/suite/ndb/t/ndb_restore_misc.test
      mysql-test/suite/rpl_ndb/r/rpl_ndb_basic.result
      mysql-test/suite/rpl_ndb/r/rpl_ndb_check_for_mixed.result
      mysql-test/suite/rpl_ndb/t/rpl_ndb_basic.test
      mysql-test/suite/rpl_ndb/t/rpl_ndb_check_for_mixed.test
      sql/ha_ndbcluster.cc
      storage/ndb/include/kernel/ndb_limits.h
      storage/ndb/include/ndbapi/ndbapi_limits.h
      storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp
=== modified file 'scripts/mysql_system_tables.sql'
--- a/scripts/mysql_system_tables.sql	2011-04-08 13:07:58 +0000
+++ b/scripts/mysql_system_tables.sql	2011-04-12 15:01:48 +0000
@@ -292,7 +292,7 @@ PREPARE stmt FROM @str;
 EXECUTE stmt;
 DROP PREPARE stmt;
 
-SET @str=IF(@have_ndbinfo,'CREATE TABLE `ndbinfo`.`ndb$nodes` (`node_id` INT UNSIGNED,`uptime` BIGINT UNSIGNED COMMENT "time in seconds that node has been running",`status` INT UNSIGNED COMMENT "starting/started/stopped etc.",`start_phase` INT UNSIGNED COMMENT "start phase if node is starting") COMMENT="node status" ENGINE=NDBINFO','SET @dummy = 0');
+SET @str=IF(@have_ndbinfo,'CREATE TABLE `ndbinfo`.`ndb$nodes` (`node_id` INT UNSIGNED,`uptime` BIGINT UNSIGNED COMMENT "time in seconds that node has been running",`status` INT UNSIGNED COMMENT "starting/started/stopped etc.",`start_phase` INT UNSIGNED COMMENT "start phase if node is starting",`config_generation` INT UNSIGNED COMMENT "configuration generation number") COMMENT="node status" ENGINE=NDBINFO','SET @dummy = 0');
 PREPARE stmt FROM @str;
 EXECUTE stmt;
 DROP PREPARE stmt;
@@ -361,7 +361,7 @@ EXECUTE stmt;
 DROP PREPARE stmt;
 
 # ndbinfo.nodes
-SET @str=IF(@have_ndbinfo,'CREATE OR REPLACE DEFINER=`root@localhost` SQL SECURITY INVOKER VIEW `ndbinfo`.`nodes` AS SELECT node_id, uptime, CASE status  WHEN 0 THEN "NOTHING"  WHEN 1 THEN "CMVMI"  WHEN 2 THEN "STARTING"  WHEN 3 THEN "STARTED"  WHEN 4 THEN "SINGLEUSER"  WHEN 5 THEN "STOPPING_1"  WHEN 6 THEN "STOPPING_2"  WHEN 7 THEN "STOPPING_3"  WHEN 8 THEN "STOPPING_4"  ELSE "<unknown>"  END AS status, start_phase FROM ndbinfo.ndb$nodes','SET @dummy = 0');
+SET @str=IF(@have_ndbinfo,'CREATE OR REPLACE DEFINER=`root@localhost` SQL SECURITY INVOKER VIEW `ndbinfo`.`nodes` AS SELECT node_id, uptime, CASE status  WHEN 0 THEN "NOTHING"  WHEN 1 THEN "CMVMI"  WHEN 2 THEN "STARTING"  WHEN 3 THEN "STARTED"  WHEN 4 THEN "SINGLEUSER"  WHEN 5 THEN "STOPPING_1"  WHEN 6 THEN "STOPPING_2"  WHEN 7 THEN "STOPPING_3"  WHEN 8 THEN "STOPPING_4"  ELSE "<unknown>"  END AS status, start_phase, config_generation FROM ndbinfo.ndb$nodes','SET @dummy = 0');
 PREPARE stmt FROM @str;
 EXECUTE stmt;
 DROP PREPARE stmt;

=== modified file 'storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp'
--- a/storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp	2011-04-09 15:48:21 +0000
+++ b/storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp	2011-04-12 11:59:36 +0000
@@ -2108,7 +2108,8 @@ void Cmvmi::execDBINFO_SCANREQ(Signal *s
     const NodeState& nodeState = getNodeState();
     const Uint32 start_level = nodeState.startLevel;
     const NDB_TICKS uptime = (NdbTick_CurrentMillisecond()/1000) - m_start_time;
-
+    Uint32 generation = m_ctx.m_config.get_config_generation(); 
+ 
     Ndbinfo::Row row(signal, req);
     row.write_uint32(getOwnNodeId()); // Node id
 
@@ -2116,6 +2117,7 @@ void Cmvmi::execDBINFO_SCANREQ(Signal *s
     row.write_uint32(start_level);
     row.write_uint32(start_level == NodeState::SL_STARTING ?
                      nodeState.starting.startPhase : 0);
+    row.write_uint32(generation);
     ndbinfo_send_row(signal, req, row, rl);
     break;
   }

=== modified file 'storage/ndb/src/kernel/vm/Configuration.cpp'
--- a/storage/ndb/src/kernel/vm/Configuration.cpp	2011-03-29 12:32:02 +0000
+++ b/storage/ndb/src/kernel/vm/Configuration.cpp	2011-04-12 11:59:36 +0000
@@ -545,6 +545,16 @@ Configuration::getClusterConfigIterator(
   return m_clusterConfigIter;
 }
 
+Uint32 
+Configuration::get_config_generation() const {
+  Uint32 generation = ~0;
+  ndb_mgm_configuration_iterator sys_iter(*m_clusterConfig,
+                                          CFG_SECTION_SYSTEM);
+  sys_iter.get(CFG_SYS_CONFIG_GENERATION, &generation);
+  return generation;
+}
+ 
+
 void
 Configuration::calcSizeAlt(ConfigValues * ownConfig){
   const char * msg = "Invalid configuration fetched";

=== modified file 'storage/ndb/src/kernel/vm/Configuration.hpp'
--- a/storage/ndb/src/kernel/vm/Configuration.hpp	2011-02-01 23:27:25 +0000
+++ b/storage/ndb/src/kernel/vm/Configuration.hpp	2011-04-12 11:59:36 +0000
@@ -124,6 +124,7 @@ public:
   ndb_mgm_configuration_iterator * getClusterConfigIterator() const;
 
   ndb_mgm_configuration* getClusterConfig() const { return m_clusterConfig; }
+  Uint32 get_config_generation() const; 
 
 private:
   friend class Cmvmi;

=== modified file 'storage/ndb/src/kernel/vm/NdbinfoTables.cpp'
--- a/storage/ndb/src/kernel/vm/NdbinfoTables.cpp	2011-02-02 09:20:32 +0000
+++ b/storage/ndb/src/kernel/vm/NdbinfoTables.cpp	2011-04-12 13:59:32 +0000
@@ -141,14 +141,15 @@ DECLARE_NDBINFO_TABLE(COUNTERS,5) =
   }
 };
 
-DECLARE_NDBINFO_TABLE(NODES,4) =
-{ { "nodes", 4, 0, "node status" },
+DECLARE_NDBINFO_TABLE(NODES,5) =
+{ { "nodes", 5, 0, "node status" },
   {
     {"node_id",            Ndbinfo::Number, ""},
 
     {"uptime",             Ndbinfo::Number64, "time in seconds that node has been running"},
     {"status",             Ndbinfo::Number, "starting/started/stopped etc."},
-    {"start_phase",        Ndbinfo::Number, "start phase if node is starting"}
+    {"start_phase",        Ndbinfo::Number, "start phase if node is starting"},
+    {"config_generation",  Ndbinfo::Number, "configuration generation number"}
   }
 };
 

=== modified file 'storage/ndb/tools/ndbinfo_sql.cpp'
--- a/storage/ndb/tools/ndbinfo_sql.cpp	2011-04-06 15:21:58 +0000
+++ b/storage/ndb/tools/ndbinfo_sql.cpp	2011-04-12 13:59:32 +0000
@@ -153,7 +153,8 @@ struct view {
     "  WHEN 8 THEN \"STOPPING_4\""
     "  ELSE \"<unknown>\" "
     " END AS status, "
-    "start_phase "
+    "start_phase, "
+    "config_generation "
     "FROM <NDBINFO_DB>.<TABLE_PREFIX>nodes"
    },
   { "memoryusage",

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.1-telco-7.1 branch (maitrayi.sabaratnam:4162 to 4164) Maitrayi Sabaratnam12 Apr