summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ndb/include/mgmcommon/ConfigRetriever.hpp1
-rw-r--r--ndb/include/transporter/TransporterRegistry.hpp7
-rw-r--r--ndb/src/common/mgmcommon/IPCConfig.cpp2
-rw-r--r--ndb/src/common/transporter/TransporterRegistry.cpp9
-rw-r--r--ndb/src/kernel/main.cpp14
-rw-r--r--ndb/src/kernel/vm/Configuration.hpp1
-rw-r--r--ndb/src/mgmapi/mgmapi.cpp1
-rw-r--r--ndb/src/ndbapi/TransporterFacade.hpp2
-rw-r--r--ndb/src/ndbapi/ndb_cluster_connection.cpp15
9 files changed, 49 insertions, 3 deletions
diff --git a/ndb/include/mgmcommon/ConfigRetriever.hpp b/ndb/include/mgmcommon/ConfigRetriever.hpp
index 8461658748e..6583c7999be 100644
--- a/ndb/include/mgmcommon/ConfigRetriever.hpp
+++ b/ndb/include/mgmcommon/ConfigRetriever.hpp
@@ -73,6 +73,7 @@ public:
Uint32 get_mgmd_port() const;
const char *get_mgmd_host() const;
const char *get_connectstring(char *buf, int buf_sz) const;
+ NdbMgmHandle get_mgmHandle() { return m_handle; };
Uint32 get_configuration_nodeid() const;
private:
diff --git a/ndb/include/transporter/TransporterRegistry.hpp b/ndb/include/transporter/TransporterRegistry.hpp
index ac6291f9e57..2e162ee52f5 100644
--- a/ndb/include/transporter/TransporterRegistry.hpp
+++ b/ndb/include/transporter/TransporterRegistry.hpp
@@ -220,11 +220,16 @@ public:
class Transporter_interface {
public:
+ NodeId m_remote_nodeId;
unsigned short m_service_port;
const char *m_interface;
};
Vector<Transporter_interface> m_transporter_interface;
- void add_transporter_interface(const char *interface, unsigned short port);
+ void add_transporter_interface(NodeId remoteNodeId,
+ const char *interface, unsigned short port);
+ Transporter* get_transporter(NodeId nodeId);
+ NodeId get_localNodeId() { return localNodeId; };
+
protected:
private:
diff --git a/ndb/src/common/mgmcommon/IPCConfig.cpp b/ndb/src/common/mgmcommon/IPCConfig.cpp
index 780504d2c62..c2f416668b4 100644
--- a/ndb/src/common/mgmcommon/IPCConfig.cpp
+++ b/ndb/src/common/mgmcommon/IPCConfig.cpp
@@ -367,7 +367,7 @@ IPCConfig::configureTransporters(Uint32 nodeId,
Uint32 server_port= 0;
if(iter.get(CFG_CONNECTION_SERVER_PORT, &server_port)) break;
if (nodeId <= nodeId1 && nodeId <= nodeId2) {
- tr.add_transporter_interface(localHostName, server_port);
+ tr.add_transporter_interface(nodeId2, localHostName, server_port);
}
DBUG_PRINT("info", ("Transporter between this node %d and node %d using port %d, signalId %d, checksum %d",
nodeId, remoteNodeId, server_port, sendSignalId, checksum));
diff --git a/ndb/src/common/transporter/TransporterRegistry.cpp b/ndb/src/common/transporter/TransporterRegistry.cpp
index 61924fe55b2..6dc7bab7ec9 100644
--- a/ndb/src/common/transporter/TransporterRegistry.cpp
+++ b/ndb/src/common/transporter/TransporterRegistry.cpp
@@ -1180,7 +1180,8 @@ TransporterRegistry::stop_clients()
}
void
-TransporterRegistry::add_transporter_interface(const char *interface,
+TransporterRegistry::add_transporter_interface(NodeId remoteNodeId,
+ const char *interface,
unsigned short port)
{
DBUG_ENTER("TransporterRegistry::add_transporter_interface");
@@ -1204,6 +1205,7 @@ TransporterRegistry::add_transporter_interface(const char *interface,
}
}
Transporter_interface t;
+ t.m_remote_nodeId= remoteNodeId;
t.m_service_port= port;
t.m_interface= interface;
m_transporter_interface.push_back(t);
@@ -1331,4 +1333,9 @@ NdbOut & operator <<(NdbOut & out, SignalHeader & sh){
return out;
}
+Transporter*
+TransporterRegistry::get_transporter(NodeId nodeId) {
+ return theTransporters[nodeId];
+};
+
template class Vector<TransporterRegistry::Transporter_interface>;
diff --git a/ndb/src/kernel/main.cpp b/ndb/src/kernel/main.cpp
index 12190bbc4a5..8220ea97b45 100644
--- a/ndb/src/kernel/main.cpp
+++ b/ndb/src/kernel/main.cpp
@@ -19,6 +19,7 @@
#include <ndb_version.h>
#include "Configuration.hpp"
+#include <ConfigRetriever.hpp>
#include <TransporterRegistry.hpp>
#include "vm/SimBlockList.hpp"
@@ -36,6 +37,8 @@
#include <NdbAutoPtr.hpp>
+#include <mgmapi_debug.h>
+
#if defined NDB_SOLARIS // ok
#include <sys/processor.h> // For system informatio
#endif
@@ -195,6 +198,17 @@ int main(int argc, char** argv)
socket_server.startServer();
+ struct ndb_mgm_reply mgm_reply;
+ for(unsigned int i=0;i<globalTransporterRegistry.m_transporter_interface.size();i++)
+ ndb_mgm_set_connection_int_parameter(theConfig->get_config_retriever()->get_mgmHandle(),
+ globalTransporterRegistry.get_localNodeId(),
+ globalTransporterRegistry.m_transporter_interface[i].m_remote_nodeId,
+ CFG_CONNECTION_SERVER_PORT,
+ globalTransporterRegistry.m_transporter_interface[i].m_service_port,
+ &mgm_reply);
+
+
+
// theConfig->closeConfiguration();
globalEmulatorData.theThreadConfig->ipControlLoop();
diff --git a/ndb/src/kernel/vm/Configuration.hpp b/ndb/src/kernel/vm/Configuration.hpp
index acf0e163a84..a257881e353 100644
--- a/ndb/src/kernel/vm/Configuration.hpp
+++ b/ndb/src/kernel/vm/Configuration.hpp
@@ -68,6 +68,7 @@ public:
Uint32 get_mgmd_port() const {return m_mgmd_port;};
const char *get_mgmd_host() const {return m_mgmd_host;};
+ ConfigRetriever* get_config_retriever() { return m_config_retriever; };
class LogLevel * m_logLevel;
private:
diff --git a/ndb/src/mgmapi/mgmapi.cpp b/ndb/src/mgmapi/mgmapi.cpp
index 0ba7b1c8b0f..be5e17e7429 100644
--- a/ndb/src/mgmapi/mgmapi.cpp
+++ b/ndb/src/mgmapi/mgmapi.cpp
@@ -1983,6 +1983,7 @@ ndb_mgm_set_connection_int_parameter(NdbMgmHandle handle,
int param,
unsigned value,
struct ndb_mgm_reply* mgmreply){
+ DBUG_ENTER("ndb_mgm_set_connection_int_parameter");
CHECK_HANDLE(handle, 0);
CHECK_CONNECTED(handle, 0);
diff --git a/ndb/src/ndbapi/TransporterFacade.hpp b/ndb/src/ndbapi/TransporterFacade.hpp
index dcdabee2fd4..5c1e1cb839c 100644
--- a/ndb/src/ndbapi/TransporterFacade.hpp
+++ b/ndb/src/ndbapi/TransporterFacade.hpp
@@ -111,6 +111,8 @@ public:
Uint32 get_batch_byte_size();
Uint32 get_batch_size();
+ TransporterRegistry* get_registry() { return theTransporterRegistry;};
+
private:
/**
* Send a signal unconditional of node status (used by ClusterMgr)
diff --git a/ndb/src/ndbapi/ndb_cluster_connection.cpp b/ndb/src/ndbapi/ndb_cluster_connection.cpp
index f436ee56ede..040243baebc 100644
--- a/ndb/src/ndbapi/ndb_cluster_connection.cpp
+++ b/ndb/src/ndbapi/ndb_cluster_connection.cpp
@@ -26,6 +26,7 @@
#include <ndb_limits.h>
#include <ConfigRetriever.hpp>
#include <ndb_version.h>
+#include <mgmapi_debug.h>
static int g_run_connect_thread= 0;
@@ -146,6 +147,8 @@ int Ndb_cluster_connection::start_connect_thread(int (*connect_callback)(void))
int Ndb_cluster_connection::connect(int no_retries, int retry_delay_in_seconds, int verbose)
{
+ struct ndb_mgm_reply mgm_reply;
+
DBUG_ENTER("Ndb_cluster_connection::connect");
const char* error = 0;
do {
@@ -160,7 +163,19 @@ int Ndb_cluster_connection::connect(int no_retries, int retry_delay_in_seconds,
ndb_mgm_configuration * props = m_config_retriever->getConfig();
if(props == 0)
break;
+ DBUG_PRINT("Before start_instance",("Before start_instance2"));
m_facade->start_instance(nodeId, props);
+ DBUG_PRINT("After start_instance",("before start_instance2"));
+ // report port here.
+ DBUG_PRINT("set_conn",("%d",m_facade->get_registry()->m_transporter_interface.size()));
+ for(int i=0;i<m_facade->get_registry()->m_transporter_interface.size();i++)
+ ndb_mgm_set_connection_int_parameter(m_config_retriever->get_mgmHandle(),
+ nodeId,
+ m_facade->get_registry()->m_transporter_interface[i].m_remote_nodeId,
+ CFG_CONNECTION_SERVER_PORT,
+ m_facade->get_registry()->m_transporter_interface[i].m_service_port,
+ &mgm_reply);
+
ndb_mgm_destroy_configuration(props);
m_facade->connected();
DBUG_RETURN(0);