summaryrefslogtreecommitdiff
path: root/ndb/src/mgmapi/mgmapi.cpp
diff options
context:
space:
mode:
authorunknown <stewart@mysql.com>2005-02-11 15:43:43 +1100
committerunknown <stewart@mysql.com>2005-02-11 15:43:43 +1100
commit6bd9c85acd73aac75c37bdfa15980569ba9fde99 (patch)
treee74c9d7c460fb54214d5bd6857e1098ab87b8f19 /ndb/src/mgmapi/mgmapi.cpp
parent6eae64dd2c69aafe17ca0cefc8ff3e23d1f23c0e (diff)
downloadmariadb-git-6bd9c85acd73aac75c37bdfa15980569ba9fde99.tar.gz
WL2278 Dynamic ports - Impl 6, "deal with mgm server restart and multiple mgm servers"
- when connecting to a mgm server as a transporter, create a NdbMgmHandle - over this mgm handle, report the dynamic ports - then turn it into a transporter - this will re-report dynamic ports to mgmds when they restart (as we'll have to set up our transporter again). This will also report it to all mgmds (as we'll have transporters to all of them). ndb/include/mgmapi/mgmapi.h: Add ndb_mgm_convert_to_transporter - converts to a transporter connect - destroys the handle (without disconnecting) - returns socket ndb/include/transporter/TransporterRegistry.hpp: Add prototype for connect_ndb_mgmd ndb/include/util/SocketClient.hpp: Remove connect_without_auth Add get_port() and get_server_name() ndb/src/common/transporter/Transporter.cpp: use TransporterRegistry::connect_ndb_mgmd() to make the connection if isMgmConnection ndb/src/common/transporter/TransporterRegistry.cpp: Impliment TransporterRegistry::connect_ndb_mgmd - takes a SocketClient and constructs a connectstring. - uses this connect string to make a NdbMgmHandle - send dynamic ports to this mgm server - transform into a transporter connect - return socket ndb/src/common/util/SocketClient.cpp: Remove connect_without_auth ndb/src/kernel/main.cpp: Don't relay dynamic ports. We now do this on transporter connect ndb/src/mgmapi/mgmapi.cpp: Impliment ndb_mgm_convert_to_transporter - converts the mgm connection into a transporter connection - destroys the handle - returns the socket that should now be used as a transporter
Diffstat (limited to 'ndb/src/mgmapi/mgmapi.cpp')
-rw-r--r--ndb/src/mgmapi/mgmapi.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/ndb/src/mgmapi/mgmapi.cpp b/ndb/src/mgmapi/mgmapi.cpp
index 9974686cd4f..f6427204814 100644
--- a/ndb/src/mgmapi/mgmapi.cpp
+++ b/ndb/src/mgmapi/mgmapi.cpp
@@ -2148,4 +2148,25 @@ ndb_mgm_get_connection_int_parameter(NdbMgmHandle handle,
DBUG_RETURN(res);
}
+extern "C"
+NDB_SOCKET_TYPE
+ndb_mgm_convert_to_transporter(NdbMgmHandle handle)
+{
+ NDB_SOCKET_TYPE s;
+
+ CHECK_HANDLE(handle, -1);
+ CHECK_CONNECTED(handle, -2);
+
+ handle->connected= 0; // we pretend we're disconnected
+ s= handle->socket;
+
+ SocketOutputStream s_output(s);
+ s_output.println("transporter connect");
+ s_output.println("");
+
+ ndb_mgm_destroy_handle(&handle); // set connected=0, so won't disconnect
+
+ return s;
+}
+
template class Vector<const ParserRow<ParserDummy>*>;