List:Commits« Previous MessageNext Message »
From:Magnus Svensson Date:March 26 2009 9:13am
Subject:bzr commit into mysql-5.1-telco-7.0 branch (msvensson:2960)
View as plain text  
#At file:///home/msvensson/mysql/bug/43641/ based on revid:msvensson@stripped

 2960 Magnus Svensson	2009-03-26
      ndbd - print generation of the configuration that was fetched from ndb_mgmd
       - Remove the need to save port and hostname of the connected ndb_mgmd in
         yet another place.

    modified:
      storage/ndb/src/kernel/ndbd.cpp
      storage/ndb/src/kernel/vm/Configuration.cpp
      storage/ndb/src/kernel/vm/Configuration.hpp
=== modified file 'storage/ndb/src/kernel/ndbd.cpp'
--- a/storage/ndb/src/kernel/ndbd.cpp	2009-03-14 20:42:04 +0000
+++ b/storage/ndb/src/kernel/ndbd.cpp	2009-03-26 09:13:22 +0000
@@ -73,9 +73,6 @@ systemInfo(const Configuration & config,
   if(logLevel.getLogLevel(LogLevel::llStartUp) > 0){
     g_eventLogger->info("NDB Cluster -- DB node %d", globalData.ownId);
     g_eventLogger->info("%s --", NDB_VERSION_STRING);
-    if (config.get_mgmd_host())
-      g_eventLogger->info("Configuration fetched at %s port %d",
-                          config.get_mgmd_host(), config.get_mgmd_port());
 #ifdef NDB_SOLARIS
     g_eventLogger->info("NDB is running on a machine with %d processor(s) at %d MHz",
                         processor, speed);

=== modified file 'storage/ndb/src/kernel/vm/Configuration.cpp'
--- a/storage/ndb/src/kernel/vm/Configuration.cpp	2009-03-26 08:33:33 +0000
+++ b/storage/ndb/src/kernel/vm/Configuration.cpp	2009-03-26 09:13:22 +0000
@@ -121,7 +121,6 @@ Configuration::fetch_configuration(const
     delete m_config_retriever;
   }
 
-  m_mgmd_port= 0;
   m_config_retriever= new ConfigRetriever(_connect_string,
                                           NDB_VERSION,
                                           NDB_MGM_NODE_TYPE_NDB,
@@ -143,9 +142,6 @@ Configuration::fetch_configuration(const
     */
     ERROR_SET(fatal, NDBD_EXIT_INVALID_CONFIG, "Could not connect to ndb_mgmd", s);
   }
-  
-  m_mgmd_port= m_config_retriever->get_mgmd_port();
-  m_mgmd_host.assign(m_config_retriever->get_mgmd_host());
 
   ConfigRetriever &cr= *m_config_retriever;
   
@@ -181,7 +177,21 @@ Configuration::fetch_configuration(const
     free(m_clusterConfig);
   
   m_clusterConfig = p;
-  
+
+  {
+    Uint32 generation;
+    ndb_mgm_configuration_iterator sys_iter(*p, CFG_SECTION_SYSTEM);
+    if (sys_iter.get(CFG_SYS_CONFIG_GENERATION, &generation)) {
+      ERROR_SET(fatal, NDBD_EXIT_INVALID_CONFIG,
+                "Invalid configuration fetched", "generation missing");
+    }
+
+    g_eventLogger->info("Configuration fetched from '%s:%d', generation: %d",
+                        m_config_retriever->get_mgmd_host(),
+                        m_config_retriever->get_mgmd_port(),
+                        generation);
+  }
+
   ndb_mgm_configuration_iterator iter(* p, CFG_SECTION_NODE);
   if (iter.find(CFG_NODE_ID, globalData.ownId)){
     ERROR_SET(fatal, NDBD_EXIT_INVALID_CONFIG, "Invalid configuration fetched", "DB missing");

=== modified file 'storage/ndb/src/kernel/vm/Configuration.hpp'
--- a/storage/ndb/src/kernel/vm/Configuration.hpp	2009-03-04 10:40:00 +0000
+++ b/storage/ndb/src/kernel/vm/Configuration.hpp	2009-03-26 09:13:22 +0000
@@ -122,8 +122,6 @@ public:
 
   const ndb_mgm_configuration_iterator * getOwnConfigIterator() const;
 
-  Uint32 get_mgmd_port() const {return m_mgmd_port;};
-  const char *get_mgmd_host() const {return m_mgmd_host.c_str();};
   ConfigRetriever* get_config_retriever() { return m_config_retriever; };
 
   class LogLevel * m_logLevel;
@@ -167,8 +165,6 @@ private:
   char * _fsPath;
   char * _backupPath;
   bool _initialStart;
-  Uint32 m_mgmd_port;
-  BaseString m_mgmd_host;
   bool _daemonMode; // if not, angel in foreground
 
   void calcSizeAlt(class ConfigValues * );


Attachment: [text/bzr-bundle] bzr/msvensson@mysql.com-20090326091322-g48xfmmd4flr6lgg.bundle
Thread
bzr commit into mysql-5.1-telco-7.0 branch (msvensson:2960)Magnus Svensson26 Mar