MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Magnus Blåudd Date:December 21 2009 10:59am
Subject:bzr commit into mysql-5.1-telco-7.0 branch (magnus.blaudd:3298)
Bug#49807
View as plain text  
#At file:///home/msvensson/mysql/7.0/ based on revid:magnus.blaudd@strippeda2uksgmps7

 3298 Magnus Blåudd	2009-12-21
      Bug#49807 2nd management node refuses to start when 1st mgmd and data nodes are running
       - reset any dynamic ports in the config fetched from other mgmd before using it. 

    modified:
      storage/ndb/src/mgmsrv/ConfigManager.cpp
=== modified file 'storage/ndb/src/mgmsrv/ConfigManager.cpp'
--- a/storage/ndb/src/mgmsrv/ConfigManager.cpp	2009-12-08 14:02:50 +0000
+++ b/storage/ndb/src/mgmsrv/ConfigManager.cpp	2009-12-21 10:59:42 +0000
@@ -285,6 +285,26 @@ ConfigManager::init_nodeid(void)
 }
 
 
+static void
+reset_dynamic_ports_in_config(const Config* config)
+{
+  ConfigIter iter(config, CFG_SECTION_CONNECTION);
+
+  for(;iter.valid();iter.next()) {
+    Uint32 port;
+    require(iter.get(CFG_CONNECTION_SERVER_PORT, &port) == 0);
+    
+    if ((int)port < 0)
+    {
+      port = 0;
+      ConfigValues::Iterator i2(config->m_configValues->m_config,
+                                iter.m_config);
+      require(i2.set(CFG_CONNECTION_SERVER_PORT, port));
+    } 
+  }
+}
+ 
+
 bool
 ConfigManager::init(void)
 {
@@ -418,6 +438,13 @@ ConfigManager::init(void)
         DBUG_RETURN(false);
       }
 
+      /* 
+        The fetched config may contain dynamic ports for
+        ndbd(s) which have to be reset to 0 before using
+        the config
+      */
+      reset_dynamic_ports_in_config(conf);
+
       if (!config_ok(conf))
         DBUG_RETURN(false);
 

Attachment: [text/bzr-bundle] bzr/magnus.blaudd@sun.com-20091221105942-fhnndedpy3rw28j1.bundle
Thread
bzr commit into mysql-5.1-telco-7.0 branch (magnus.blaudd:3298)Bug#49807Magnus Blåudd21 Dec