Bug #48405 | Allow explicit node id for mysqld with connection pooling | ||
---|---|---|---|
Submitted: | 29 Oct 2009 12:01 | Modified: | 9 Dec 2009 20:05 |
Reporter: | Sivert Sørumgård | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Cluster: Cluster (NDB) storage engine | Severity: | S3 (Non-critical) |
Version: | mysql-5.1-telco-6.3 | OS: | Any |
Assigned to: | Magnus Blåudd | CPU Architecture: | Any |
Tags: | 6.3, 7.0 |
[29 Oct 2009 12:01]
Sivert Sørumgård
[30 Oct 2009 10:49]
Hartmut Holzgraefe
Shouldn't it be possible to specify an id range for a pooling mysqld, too, to be able to avoid id overlap alltogether?
[16 Nov 2009 21:55]
Magnus Blåudd
In the constructor of Ndb_cluster_connection in the case when it has been created _with_ a main_connection, set the nodeid to 0 for ConfigRetriever after its been created(who then parses the connectstring and extracts whjich nodeid to use, should any be set). Also change the constructor not to destroy ConfigRetriver if it fails to parse the connect string, that task is performed by destructor. msvensson@pilot:~/mysql/7.0-bug48405$ quilt diffIndex: 7.0-bug48405/storage/ndb/src/ndbapi/ndb_cluster_connection.cpp =================================================================== --- 7.0-bug48405.orig/storage/ndb/src/ndbapi/ndb_cluster_connection.cpp 2009-11-16 22:42:19.000000000 +0100 +++ 7.0-bug48405/storage/ndb/src/ndbapi/ndb_cluster_connection.cpp 2009-11-16 22:54:09.000000000 +0100 @@ -334,8 +334,6 @@ Ndb_cluster_connection_impl(const char * ("Could not initialize handle to management server: %s", m_config_retriever->getErrorString()); printf("%s\n", get_latest_error_msg()); - delete m_config_retriever; - m_config_retriever= 0; } if (!m_main_connection) { @@ -348,6 +346,11 @@ Ndb_cluster_connection_impl(const char * m_globalDictCache = 0; m_transporter_facade= new TransporterFacade(m_main_connection->m_impl.m_globalDictCache); + + // The secondary connection can't use same nodeid, clear the nodeid + // in ConfigRetriver to avoid asking for the same nodeid again + m_config_retriever->setNodeId(0); + }
[16 Nov 2009 21:57]
Magnus Blåudd
With this patch it's also easy to extend it to allow one specific node id to be passed as third arg to constructor. The specific nodeid could come from a list of nodeids passed to mysqld(for example).
[17 Nov 2009 16:26]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/90705
[17 Nov 2009 17:34]
Bugs System
Pushed into 5.1.39-ndb-7.0.10 (revid:magnus.blaudd@sun.com-20091117172724-7hyrcstjwf71v3v6) (version source revid:magnus.blaudd@sun.com-20091117172724-7hyrcstjwf71v3v6) (merge vers: 5.1.39-ndb-7.0.10) (pib:13)
[17 Nov 2009 17:34]
Bugs System
Pushed into 5.1.39-ndb-7.1.0 (revid:magnus.blaudd@sun.com-20091117172958-eyzf3t03srth5fgf) (version source revid:magnus.blaudd@sun.com-20091117172958-eyzf3t03srth5fgf) (merge vers: 5.1.39-ndb-7.1.0) (pib:13)
[17 Nov 2009 17:45]
Magnus Blåudd
Pushed to 7.0 and 7.1
[9 Dec 2009 20:05]
Jon Stephens
Documented bugfix in the NDB-7.0.10 changelog as follows: Starting a mysqld process with --ndb-nodeid (either as a command-line option or by assigning it a value in my.cnf) caused the mysqld to get only the corresponding connection from the [mysqld] section in the config.ini having the matching ID, even when connection pooling was enabled used (that is, when the mysqld process was started with --ndb-cluster-connection-pool greater than 1). Closed.