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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
9ca2c7c6
Commit
9ca2c7c6
authored
Feb 17, 2005
by
tomas@poseidon.ndb.mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changed ndb dynamic port fetch sligtly to handle "not connected" cases better
parent
3f023ee3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
22 deletions
+41
-22
ndb/src/common/transporter/TransporterRegistry.cpp
ndb/src/common/transporter/TransporterRegistry.cpp
+41
-22
No files found.
ndb/src/common/transporter/TransporterRegistry.cpp
View file @
9ca2c7c6
...
...
@@ -1246,13 +1246,13 @@ TransporterRegistry::start_clients_thread()
if
(
!
connected
&&
t
->
get_s_port
()
<=
0
)
{
// Port is dynamic
int
server_port
=
0
;
struct
ndb_mgm_reply
mgm_reply
;
int
res
=
-
1
;
if
(
!
ndb_mgm_is_connected
(
m_mgm_handle
))
if
(
ndb_mgm_connect
(
m_mgm_handle
,
0
,
0
,
0
)
<
0
)
ndbout_c
(
"Failed to reconnect to management server"
);
else
res
=
ndb_mgm_connect
(
m_mgm_handle
,
0
,
0
,
0
);
if
(
ndb_mgm_is_connected
(
m_mgm_handle
))
{
int
res
=
ndb_mgm_get_connection_int_parameter
(
m_mgm_handle
,
t
->
getRemoteNodeId
(),
t
->
getLocalNodeId
(),
...
...
@@ -1262,11 +1262,29 @@ TransporterRegistry::start_clients_thread()
DBUG_PRINT
(
"info"
,(
"Got dynamic port %d for %d -> %d (ret: %d)"
,
server_port
,
t
->
getRemoteNodeId
(),
t
->
getLocalNodeId
(),
res
));
if
(
res
>=
0
&&
server_port
)
if
(
res
>=
0
)
{
/**
* Server_port == 0 just means that that a mgmt server
* has not received a new port yet. Keep the old.
*/
if
(
server_port
)
t
->
set_s_port
(
server_port
);
}
else
{
ndbout_c
(
"Failed to get dynamic port to connect to: %d"
,
res
);
ndb_mgm_disconnect
(
m_mgm_handle
);
}
}
/** else
* We will not be able to get a new port unless
* the m_mgm_handle is connected. Note that not
* being connected is an ok state, just continue
* until it is able to connect. Continue using the
* old port until we can connect again and get a
* new port.
*/
}
}
break
;
...
...
@@ -1304,7 +1322,7 @@ TransporterRegistry::stop_clients()
if
(
m_start_clients_thread
)
{
m_run_start_clients_thread
=
false
;
void
*
status
;
int
r
=
NdbThread_WaitFor
(
m_start_clients_thread
,
&
status
);
NdbThread_WaitFor
(
m_start_clients_thread
,
&
status
);
NdbThread_Destroy
(
&
m_start_clients_thread
);
}
return
true
;
...
...
@@ -1347,10 +1365,11 @@ TransporterRegistry::add_transporter_interface(NodeId remoteNodeId,
bool
TransporterRegistry
::
start_service
(
SocketServer
&
socket_server
)
{
DBUG_ENTER
(
"TransporterRegistry::start_service"
);
if
(
m_transporter_interface
.
size
()
>
0
&&
!
nodeIdSpecified
)
{
ndbout_c
(
"TransporterRegistry::startReceiving: localNodeId not specified"
);
return
false
;
DBUG_RETURN
(
false
)
;
}
for
(
unsigned
i
=
0
;
i
<
m_transporter_interface
.
size
();
i
++
)
...
...
@@ -1380,14 +1399,14 @@ TransporterRegistry::start_service(SocketServer& socket_server)
"(perhaps the node is already running)"
,
t
.
m_interface
?
t
.
m_interface
:
"*"
,
t
.
m_s_service_port
);
delete
transporter_service
;
return
false
;
DBUG_RETURN
(
false
)
;
}
}
t
.
m_s_service_port
=
(
t
.
m_s_service_port
<=
0
)
?-
port
:
port
;
// -`ve if dynamic
DBUG_PRINT
(
"info"
,
(
"t.m_s_service_port = %d"
,
t
.
m_s_service_port
));
transporter_service
->
setTransporterRegistry
(
this
);
}
return
true
;
DBUG_RETURN
(
true
)
;
}
#ifdef NDB_SHM_TRANSPORTER
...
...
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