Commit a09a8229 authored by stewart@mysql.com's avatar stewart@mysql.com

Further work on WL2278

Add calls to mgmd after setting up connections.
(not fully functional yet, checkin for pull)
parent 6e89558c
......@@ -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:
......
......@@ -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:
......
......@@ -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));
......
......@@ -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>;
......@@ -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();
......
......@@ -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:
......
......@@ -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);
......
......@@ -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)
......
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment