summaryrefslogtreecommitdiff
path: root/ndb/src/mgmapi/mgmapi.cpp
diff options
context:
space:
mode:
authorunknown <stewart@mysql.com>2005-01-12 18:13:54 +1100
committerunknown <stewart@mysql.com>2005-01-12 18:13:54 +1100
commit5615ff29bbffe2f0c080b6a3cd7f944d9c23df67 (patch)
treef8c7ce80eaf1b1fe5df35c7f8e37852ff50b6d58 /ndb/src/mgmapi/mgmapi.cpp
parentd2e6def187b1950b62685964f83e19214c5a7539 (diff)
downloadmariadb-git-5615ff29bbffe2f0c080b6a3cd7f944d9c23df67.tar.gz
Impl4 of WL2278 - Dynamic port allocation of cluster nodes
When a node restarts it starts over again with fetching the configuration - It is not sure that it can use the "old dynamically allocated port number" again. - It should however try to reuse the old one, if not possible it should allocate a new one. One has to be able to distinguish between portnumbers specified originally in the config, and ones that has been dynamically added (the latter may be changed if "busy", but the first cannot be changed). We use negative portnumbers for ports that are ok to change. ndb/include/mgmapi/mgmapi_debug.h: change prototype for: ndb_mgm_set_connection_int_parameter ndb_mgm_get_connection_int_parameter Accept/set an int instead of an unsigned ndb/include/transporter/TransporterRegistry.hpp: Use an int (signed) to represent a port number. Zero means dynamic (but unassigned) >0 means static (defined in configuration) <0 means dynamic (and should be converted to positive before use) ndb/src/common/mgmcommon/IPCConfig.cpp: Set up the Transporter with a port number of the correct sign. ndb/src/common/transporter/TransporterRegistry.cpp: start_clients_thread: - handle negative port numbers add_transporter_interface: - accept signed integer as port number start_service: - If port is dynamic (<0), try to bind to it. if that fails (e.g. some other process has taken that port), then get a new dynamic port number. ndb/src/mgmapi/mgmapi.cpp: Use a signed integer for value in: ndb_mgm_set_connection_int_parameter ndb_mgm_get_connection_int_parameter Cast to a Uint32 for storage/retrieval to/from Properties ndb/src/mgmsrv/MgmtSrvr.cpp: getConnectionDbParameter - return value as integer (signed) - cast as Uint32 for iter.get ndb/src/mgmsrv/MgmtSrvr.hpp: Update prototype of getConnectionDbParameter int value (not unsigned anymore) ndb/src/mgmsrv/Services.cpp: MgmApiSession::getConnectionParameter - value is now signed
Diffstat (limited to 'ndb/src/mgmapi/mgmapi.cpp')
-rw-r--r--ndb/src/mgmapi/mgmapi.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/ndb/src/mgmapi/mgmapi.cpp b/ndb/src/mgmapi/mgmapi.cpp
index 93ffeb8f2d3..0f03ed0a008 100644
--- a/ndb/src/mgmapi/mgmapi.cpp
+++ b/ndb/src/mgmapi/mgmapi.cpp
@@ -2050,7 +2050,7 @@ ndb_mgm_set_connection_int_parameter(NdbMgmHandle handle,
int node1,
int node2,
int param,
- unsigned value,
+ int value,
struct ndb_mgm_reply* mgmreply){
DBUG_ENTER("ndb_mgm_set_connection_int_parameter");
CHECK_HANDLE(handle, 0);
@@ -2060,7 +2060,7 @@ ndb_mgm_set_connection_int_parameter(NdbMgmHandle handle,
args.put("node1", node1);
args.put("node2", node2);
args.put("param", param);
- args.put("value", value);
+ args.put("value", (Uint32)value);
const ParserRow<ParserDummy> reply[]= {
MGM_CMD("set connection parameter reply", NULL, ""),
@@ -2093,7 +2093,7 @@ ndb_mgm_get_connection_int_parameter(NdbMgmHandle handle,
int node1,
int node2,
int param,
- Uint32 *value,
+ int *value,
struct ndb_mgm_reply* mgmreply){
DBUG_ENTER("ndb_mgm_get_connection_int_parameter");
CHECK_HANDLE(handle, -1);
@@ -2125,7 +2125,7 @@ ndb_mgm_get_connection_int_parameter(NdbMgmHandle handle,
res= 0;
} while(0);
- if(!prop->get("value",value)){
+ if(!prop->get("value",(Uint32*)value)){
ndbout_c("Unable to get value");
res = -4;
}