Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
2a153686
Commit
2a153686
authored
Jan 14, 2005
by
stewart@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Distinguish between "real" ports and those that can be negative (dynamic).
(Suggested by Tomas Ulin as part of review for WL2278)
parent
c71278bd
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
30 additions
and
20 deletions
+30
-20
ndb/include/transporter/TransporterRegistry.hpp
ndb/include/transporter/TransporterRegistry.hpp
+2
-2
ndb/src/common/mgmcommon/IPCConfig.cpp
ndb/src/common/mgmcommon/IPCConfig.cpp
+11
-1
ndb/src/common/transporter/TransporterRegistry.cpp
ndb/src/common/transporter/TransporterRegistry.cpp
+11
-11
ndb/src/kernel/main.cpp
ndb/src/kernel/main.cpp
+1
-1
ndb/src/mgmsrv/MgmtSrvr.cpp
ndb/src/mgmsrv/MgmtSrvr.cpp
+4
-4
ndb/src/ndbapi/ndb_cluster_connection.cpp
ndb/src/ndbapi/ndb_cluster_connection.cpp
+1
-1
No files found.
ndb/include/transporter/TransporterRegistry.hpp
View file @
2a153686
...
@@ -232,12 +232,12 @@ public:
...
@@ -232,12 +232,12 @@ public:
class
Transporter_interface
{
class
Transporter_interface
{
public:
public:
NodeId
m_remote_nodeId
;
NodeId
m_remote_nodeId
;
int
m_s
ervice_port
;
int
m_s
_service_port
;
// signed port number
const
char
*
m_interface
;
const
char
*
m_interface
;
};
};
Vector
<
Transporter_interface
>
m_transporter_interface
;
Vector
<
Transporter_interface
>
m_transporter_interface
;
void
add_transporter_interface
(
NodeId
remoteNodeId
,
const
char
*
interf
,
void
add_transporter_interface
(
NodeId
remoteNodeId
,
const
char
*
interf
,
int
port
);
int
s_port
);
// signed port. <0 is dynamic
Transporter
*
get_transporter
(
NodeId
nodeId
);
Transporter
*
get_transporter
(
NodeId
nodeId
);
NodeId
get_localNodeId
()
{
return
localNodeId
;
};
NodeId
get_localNodeId
()
{
return
localNodeId
;
};
...
...
ndb/src/common/mgmcommon/IPCConfig.cpp
View file @
2a153686
...
@@ -371,8 +371,18 @@ IPCConfig::configureTransporters(Uint32 nodeId,
...
@@ -371,8 +371,18 @@ IPCConfig::configureTransporters(Uint32 nodeId,
}
}
DBUG_PRINT
(
"info"
,
(
"Transporter between this node %d and node %d using port %d, signalId %d, checksum %d"
,
DBUG_PRINT
(
"info"
,
(
"Transporter between this node %d and node %d using port %d, signalId %d, checksum %d"
,
nodeId
,
remoteNodeId
,
server_port
,
sendSignalId
,
checksum
));
nodeId
,
remoteNodeId
,
server_port
,
sendSignalId
,
checksum
));
/*
This may be a dynamic port. It depends on when we're getting
our configuration. If we've been restarted, we'll be getting
a configuration with our old dynamic port in it, hence the number
here is negative (and we try the old port number first).
On a first-run, server_port will be zero (with dynamic ports)
If we're not using dynamic ports, we don't do anything.
*/
if
((
int
)
server_port
<
0
)
if
((
int
)
server_port
<
0
)
server_port
=
-
server_port
;
// A dynamic port
server_port
=
-
server_port
;
switch
(
type
){
switch
(
type
){
case
CONNECTION_TYPE_SHM
:{
case
CONNECTION_TYPE_SHM
:{
...
...
ndb/src/common/transporter/TransporterRegistry.cpp
View file @
2a153686
...
@@ -1267,17 +1267,17 @@ TransporterRegistry::stop_clients()
...
@@ -1267,17 +1267,17 @@ TransporterRegistry::stop_clients()
void
void
TransporterRegistry
::
add_transporter_interface
(
NodeId
remoteNodeId
,
TransporterRegistry
::
add_transporter_interface
(
NodeId
remoteNodeId
,
const
char
*
interf
,
const
char
*
interf
,
int
port
)
int
s_
port
)
{
{
DBUG_ENTER
(
"TransporterRegistry::add_transporter_interface"
);
DBUG_ENTER
(
"TransporterRegistry::add_transporter_interface"
);
DBUG_PRINT
(
"enter"
,(
"interface=%s,
port= %d"
,
interf
,
port
));
DBUG_PRINT
(
"enter"
,(
"interface=%s,
s_port= %d"
,
interf
,
s_
port
));
if
(
interf
&&
strlen
(
interf
)
==
0
)
if
(
interf
&&
strlen
(
interf
)
==
0
)
interf
=
0
;
interf
=
0
;
for
(
unsigned
i
=
0
;
i
<
m_transporter_interface
.
size
();
i
++
)
for
(
unsigned
i
=
0
;
i
<
m_transporter_interface
.
size
();
i
++
)
{
{
Transporter_interface
&
tmp
=
m_transporter_interface
[
i
];
Transporter_interface
&
tmp
=
m_transporter_interface
[
i
];
if
(
port
!=
tmp
.
m_service_port
||
tmp
.
m
_service_port
==
0
)
if
(
s_port
!=
tmp
.
m_s_service_port
||
tmp
.
m_s
_service_port
==
0
)
continue
;
continue
;
if
(
interf
!=
0
&&
tmp
.
m_interface
!=
0
&&
if
(
interf
!=
0
&&
tmp
.
m_interface
!=
0
&&
strcmp
(
interf
,
tmp
.
m_interface
)
==
0
)
strcmp
(
interf
,
tmp
.
m_interface
)
==
0
)
...
@@ -1291,7 +1291,7 @@ TransporterRegistry::add_transporter_interface(NodeId remoteNodeId,
...
@@ -1291,7 +1291,7 @@ TransporterRegistry::add_transporter_interface(NodeId remoteNodeId,
}
}
Transporter_interface
t
;
Transporter_interface
t
;
t
.
m_remote_nodeId
=
remoteNodeId
;
t
.
m_remote_nodeId
=
remoteNodeId
;
t
.
m_s
ervice_port
=
port
;
t
.
m_s
_service_port
=
s_
port
;
t
.
m_interface
=
interf
;
t
.
m_interface
=
interf
;
m_transporter_interface
.
push_back
(
t
);
m_transporter_interface
.
push_back
(
t
);
DBUG_PRINT
(
"exit"
,(
"interface and port added"
));
DBUG_PRINT
(
"exit"
,(
"interface and port added"
));
...
@@ -1311,9 +1311,9 @@ TransporterRegistry::start_service(SocketServer& socket_server)
...
@@ -1311,9 +1311,9 @@ TransporterRegistry::start_service(SocketServer& socket_server)
{
{
Transporter_interface
&
t
=
m_transporter_interface
[
i
];
Transporter_interface
&
t
=
m_transporter_interface
[
i
];
unsigned
short
port
=
t
.
m
_service_port
;
unsigned
short
port
=
(
unsigned
short
)
t
.
m_s
_service_port
;
if
(
t
.
m_service_port
<
0
)
if
(
t
.
m_s
_s
ervice_port
<
0
)
port
=
-
t
.
m_service_port
;
// is a dynamic port
port
=
-
t
.
m_s
_s
ervice_port
;
// is a dynamic port
TransporterService
*
transporter_service
=
TransporterService
*
transporter_service
=
new
TransporterService
(
new
SocketAuthSimple
(
"ndbd"
,
"ndbd passwd"
));
new
TransporterService
(
new
SocketAuthSimple
(
"ndbd"
,
"ndbd passwd"
));
if
(
!
socket_server
.
setup
(
transporter_service
,
if
(
!
socket_server
.
setup
(
transporter_service
,
...
@@ -1321,7 +1321,7 @@ TransporterRegistry::start_service(SocketServer& socket_server)
...
@@ -1321,7 +1321,7 @@ TransporterRegistry::start_service(SocketServer& socket_server)
{
{
DBUG_PRINT
(
"info"
,
(
"Trying new port"
));
DBUG_PRINT
(
"info"
,
(
"Trying new port"
));
port
=
0
;
port
=
0
;
if
(
t
.
m_service_port
>
0
if
(
t
.
m_s
_s
ervice_port
>
0
||
!
socket_server
.
setup
(
transporter_service
,
||
!
socket_server
.
setup
(
transporter_service
,
&
port
,
t
.
m_interface
))
&
port
,
t
.
m_interface
))
{
{
...
@@ -1332,13 +1332,13 @@ TransporterRegistry::start_service(SocketServer& socket_server)
...
@@ -1332,13 +1332,13 @@ TransporterRegistry::start_service(SocketServer& socket_server)
ndbout_c
(
"Unable to setup transporter service port: %s:%d!
\n
"
ndbout_c
(
"Unable to setup transporter service port: %s:%d!
\n
"
"Please check if the port is already used,
\n
"
"Please check if the port is already used,
\n
"
"(perhaps the node is already running)"
,
"(perhaps the node is already running)"
,
t
.
m_interface
?
t
.
m_interface
:
"*"
,
t
.
m_service_port
);
t
.
m_interface
?
t
.
m_interface
:
"*"
,
t
.
m_s
_s
ervice_port
);
delete
transporter_service
;
delete
transporter_service
;
return
false
;
return
false
;
}
}
}
}
t
.
m_s
ervice_port
=
(
t
.
m
_service_port
<=
0
)
?-
port
:
port
;
// -`ve if dynamic
t
.
m_s
_service_port
=
(
t
.
m_s
_service_port
<=
0
)
?-
port
:
port
;
// -`ve if dynamic
DBUG_PRINT
(
"info"
,
(
"t.m_s
ervice_port = %d"
,
t
.
m
_service_port
));
DBUG_PRINT
(
"info"
,
(
"t.m_s
_service_port = %d"
,
t
.
m_s
_service_port
));
transporter_service
->
setTransporterRegistry
(
this
);
transporter_service
->
setTransporterRegistry
(
this
);
}
}
return
true
;
return
true
;
...
...
ndb/src/kernel/main.cpp
View file @
2a153686
...
@@ -211,7 +211,7 @@ int main(int argc, char** argv)
...
@@ -211,7 +211,7 @@ int main(int argc, char** argv)
globalTransporterRegistry
.
get_localNodeId
(),
globalTransporterRegistry
.
get_localNodeId
(),
globalTransporterRegistry
.
m_transporter_interface
[
i
].
m_remote_nodeId
,
globalTransporterRegistry
.
m_transporter_interface
[
i
].
m_remote_nodeId
,
CFG_CONNECTION_SERVER_PORT
,
CFG_CONNECTION_SERVER_PORT
,
globalTransporterRegistry
.
m_transporter_interface
[
i
].
m_service_port
,
globalTransporterRegistry
.
m_transporter_interface
[
i
].
m_s
_s
ervice_port
,
&
mgm_reply
);
&
mgm_reply
);
...
...
ndb/src/mgmsrv/MgmtSrvr.cpp
View file @
2a153686
...
@@ -620,18 +620,18 @@ MgmtSrvr::start(BaseString &error_string)
...
@@ -620,18 +620,18 @@ MgmtSrvr::start(BaseString &error_string)
TransporterRegistry
*
reg
=
theFacade
->
get_registry
();
TransporterRegistry
*
reg
=
theFacade
->
get_registry
();
for
(
unsigned
int
i
=
0
;
i
<
reg
->
m_transporter_interface
.
size
();
i
++
)
{
for
(
unsigned
int
i
=
0
;
i
<
reg
->
m_transporter_interface
.
size
();
i
++
)
{
BaseString
msg
;
BaseString
msg
;
DBUG_PRINT
(
"info"
,(
"Setting dynamic port %d->%d : %
u
"
,
DBUG_PRINT
(
"info"
,(
"Setting dynamic port %d->%d : %
d
"
,
reg
->
get_localNodeId
(),
reg
->
get_localNodeId
(),
reg
->
m_transporter_interface
[
i
].
m_remote_nodeId
,
reg
->
m_transporter_interface
[
i
].
m_remote_nodeId
,
reg
->
m_transporter_interface
[
i
].
m_service_port
reg
->
m_transporter_interface
[
i
].
m_s
_s
ervice_port
)
)
);
);
int
res
=
setConnectionDbParameter
((
int
)
reg
->
get_localNodeId
(),
int
res
=
setConnectionDbParameter
((
int
)
reg
->
get_localNodeId
(),
(
int
)
reg
->
m_transporter_interface
[
i
]
(
int
)
reg
->
m_transporter_interface
[
i
]
.
m_remote_nodeId
,
.
m_remote_nodeId
,
(
int
)
CFG_CONNECTION_SERVER_PORT
,
(
int
)
CFG_CONNECTION_SERVER_PORT
,
(
int
)
reg
->
m_transporter_interface
[
i
]
reg
->
m_transporter_interface
[
i
]
.
m_service_port
,
.
m_s
_s
ervice_port
,
msg
);
msg
);
DBUG_PRINT
(
"info"
,(
"Set result: %d: %s"
,
res
,
msg
.
c_str
()));
DBUG_PRINT
(
"info"
,(
"Set result: %d: %s"
,
res
,
msg
.
c_str
()));
}
}
...
...
ndb/src/ndbapi/ndb_cluster_connection.cpp
View file @
2a153686
...
@@ -500,7 +500,7 @@ int Ndb_cluster_connection::connect(int no_retries, int retry_delay_in_seconds,
...
@@ -500,7 +500,7 @@ int Ndb_cluster_connection::connect(int no_retries, int retry_delay_in_seconds,
CFG_CONNECTION_SERVER_PORT
,
CFG_CONNECTION_SERVER_PORT
,
m_impl
.
m_transporter_facade
->
get_registry
()
m_impl
.
m_transporter_facade
->
get_registry
()
->
m_transporter_interface
[
i
]
->
m_transporter_interface
[
i
]
.
m_service_port
,
.
m_s
_s
ervice_port
,
&
mgm_reply
);
&
mgm_reply
);
ndb_mgm_destroy_configuration
(
props
);
ndb_mgm_destroy_configuration
(
props
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment