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
d202d89c
Commit
d202d89c
authored
Apr 07, 2006
by
tomas@poseidon.ndb.mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
multi node shutdown adabtions for restart of management servers
parent
7fd9d66c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
45 deletions
+31
-45
ndb/src/mgmsrv/MgmtSrvr.cpp
ndb/src/mgmsrv/MgmtSrvr.cpp
+31
-22
ndb/src/mgmsrv/Services.cpp
ndb/src/mgmsrv/Services.cpp
+0
-23
No files found.
ndb/src/mgmsrv/MgmtSrvr.cpp
View file @
d202d89c
...
...
@@ -987,41 +987,44 @@ int MgmtSrvr::sendSTOP_REQ(const Vector<NodeId> &node_ids,
// send the signals
NodeBitmask
nodes
;
NodeId
nodeId
;
NodeId
nodeId
=
0
;
int
use_master_node
=
0
;
int
do_send
=
0
;
int
do_stop_self
=
0
;
NdbNodeBitmask
nodes_to_stop
;
{
for
(
unsigned
i
=
0
;
i
<
node_ids
.
size
();
i
++
)
nodes_to_stop
.
set
(
node_ids
[
i
]);
}
if
(
node_ids
.
size
())
{
do_send
=
1
;
if
(
node_ids
.
size
()
==
1
)
{
nodeId
=
node_ids
[
0
];
if
(
nodeId
==
getOwnNodeId
())
{
if
(
restart
)
g_RestartServer
=
true
;
g_StopServer
=
true
;
DBUG_RETURN
(
0
);
}
else
if
(
getNodeType
(
nodeId
)
==
NDB_MGM_NODE_TYPE_MGM
)
nodeId
=
node_ids
[
i
];
if
(
getNodeType
(
nodeId
)
!=
NDB_MGM_NODE_TYPE_MGM
)
nodes_to_stop
.
set
(
nodeId
);
else
if
(
nodeId
!=
getOwnNodeId
())
{
error
=
sendStopMgmd
(
nodeId
,
abort
,
stop
,
restart
,
nostart
,
initialStart
);
if
(
error
==
0
)
stoppedNodes
.
set
(
nodeId
);
DBUG_RETURN
(
error
);
}
else
do_stop_self
=
1
;;
}
else
// multi node stop, send to master
}
int
no_of_nodes_to_stop
=
nodes_to_stop
.
count
();
if
(
node_ids
.
size
())
{
if
(
no_of_nodes_to_stop
)
{
use_master_node
=
1
;
nodes_to_stop
.
copyto
(
NdbNodeBitmask
::
Size
,
stopReq
->
nodes
);
StopReq
::
setStopNodes
(
stopReq
->
requestInfo
,
1
);
do_send
=
1
;
if
(
no_of_nodes_to_stop
==
1
)
{
nodeId
=
nodes_to_stop
.
find
(
0
);
}
else
// multi node stop, send to master
{
use_master_node
=
1
;
nodes_to_stop
.
copyto
(
NdbNodeBitmask
::
Size
,
stopReq
->
nodes
);
StopReq
::
setStopNodes
(
stopReq
->
requestInfo
,
1
);
}
}
}
else
...
...
@@ -1105,7 +1108,7 @@ int MgmtSrvr::sendSTOP_REQ(const Vector<NodeId> &node_ids,
}
else
{
assert
(
no
de_ids
.
size
()
>
1
);
assert
(
no
_of_nodes_to_stop
>
1
);
stoppedNodes
.
bitOR
(
nodes_to_stop
);
}
nodes
.
clear
(
nodeId
);
...
...
@@ -1150,6 +1153,12 @@ int MgmtSrvr::sendSTOP_REQ(const Vector<NodeId> &node_ids,
DBUG_RETURN
(
SEND_OR_RECEIVE_FAILED
);
}
}
if
(
!
error
&&
do_stop_self
)
{
if
(
restart
)
g_RestartServer
=
true
;
g_StopServer
=
true
;
}
DBUG_RETURN
(
error
);
}
...
...
ndb/src/mgmsrv/Services.cpp
View file @
d202d89c
...
...
@@ -1010,22 +1010,6 @@ MgmApiSession::stop(Parser<MgmApiSession>::Context &,
nodes
.
push_back
(
atoi
(
p
));
}
int
stop_self
=
0
;
size_t
i
;
for
(
i
=
0
;
i
<
nodes
.
size
();
i
++
)
{
if
(
nodes
[
i
]
==
m_mgmsrv
.
getOwnNodeId
())
{
stop_self
=
1
;
if
(
i
!=
nodes
.
size
()
-
1
)
{
m_output
->
println
(
"stop reply"
);
m_output
->
println
(
"result: server must be stopped last"
);
m_output
->
println
(
""
);
return
;
}
nodes
.
erase
(
i
);
break
;
}
}
int
stopped
=
0
;
int
result
=
0
;
if
(
nodes
.
size
())
...
...
@@ -1035,16 +1019,9 @@ MgmApiSession::stop(Parser<MgmApiSession>::Context &,
if
(
result
!=
0
)
m_output
->
println
(
"result: %s"
,
get_error_text
(
result
));
else
{
m_output
->
println
(
"result: Ok"
);
if
(
stop_self
)
stopped
++
;
}
m_output
->
println
(
"stopped: %d"
,
stopped
);
m_output
->
println
(
""
);
if
(
stop_self
)
g_StopServer
=
true
;
}
...
...
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