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
49bcc3ed
Commit
49bcc3ed
authored
Apr 07, 2006
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
multi node shutdown adabtions for restart of management servers
parent
5eb42010
Changes
2
Show 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 @
49bcc3ed
...
@@ -987,36 +987,38 @@ int MgmtSrvr::sendSTOP_REQ(const Vector<NodeId> &node_ids,
...
@@ -987,36 +987,38 @@ int MgmtSrvr::sendSTOP_REQ(const Vector<NodeId> &node_ids,
// send the signals
// send the signals
NodeBitmask
nodes
;
NodeBitmask
nodes
;
NodeId
nodeId
;
NodeId
nodeId
=
0
;
int
use_master_node
=
0
;
int
use_master_node
=
0
;
int
do_send
=
0
;
int
do_send
=
0
;
int
do_stop_self
=
0
;
NdbNodeBitmask
nodes_to_stop
;
NdbNodeBitmask
nodes_to_stop
;
{
{
for
(
unsigned
i
=
0
;
i
<
node_ids
.
size
();
i
++
)
for
(
unsigned
i
=
0
;
i
<
node_ids
.
size
();
i
++
)
nodes_to_stop
.
set
(
node_ids
[
i
]);
}
if
(
node_ids
.
size
())
{
{
do_send
=
1
;
nodeId
=
node_ids
[
i
];
if
(
node_ids
.
size
()
==
1
)
if
(
getNodeType
(
nodeId
)
!=
NDB_MGM_NODE_TYPE_MGM
)
{
nodes_to_stop
.
set
(
nodeId
);
nodeId
=
node_ids
[
0
];
else
if
(
nodeId
!=
getOwnNodeId
())
if
(
nodeId
==
getOwnNodeId
())
{
if
(
restart
)
g_RestartServer
=
true
;
g_StopServer
=
true
;
DBUG_RETURN
(
0
);
}
else
if
(
getNodeType
(
nodeId
)
==
NDB_MGM_NODE_TYPE_MGM
)
{
{
error
=
sendStopMgmd
(
nodeId
,
abort
,
stop
,
restart
,
error
=
sendStopMgmd
(
nodeId
,
abort
,
stop
,
restart
,
nostart
,
initialStart
);
nostart
,
initialStart
);
if
(
error
==
0
)
if
(
error
==
0
)
stoppedNodes
.
set
(
nodeId
);
stoppedNodes
.
set
(
nodeId
);
DBUG_RETURN
(
error
);
}
else
do_stop_self
=
1
;;
}
}
}
}
int
no_of_nodes_to_stop
=
nodes_to_stop
.
count
();
if
(
node_ids
.
size
())
{
if
(
no_of_nodes_to_stop
)
{
do_send
=
1
;
if
(
no_of_nodes_to_stop
==
1
)
{
nodeId
=
nodes_to_stop
.
find
(
0
);
}
else
// multi node stop, send to master
else
// multi node stop, send to master
{
{
use_master_node
=
1
;
use_master_node
=
1
;
...
@@ -1024,6 +1026,7 @@ int MgmtSrvr::sendSTOP_REQ(const Vector<NodeId> &node_ids,
...
@@ -1024,6 +1026,7 @@ int MgmtSrvr::sendSTOP_REQ(const Vector<NodeId> &node_ids,
StopReq
::
setStopNodes
(
stopReq
->
requestInfo
,
1
);
StopReq
::
setStopNodes
(
stopReq
->
requestInfo
,
1
);
}
}
}
}
}
else
else
{
{
nodeId
=
0
;
nodeId
=
0
;
...
@@ -1105,7 +1108,7 @@ int MgmtSrvr::sendSTOP_REQ(const Vector<NodeId> &node_ids,
...
@@ -1105,7 +1108,7 @@ int MgmtSrvr::sendSTOP_REQ(const Vector<NodeId> &node_ids,
}
}
else
else
{
{
assert
(
no
de_ids
.
size
()
>
1
);
assert
(
no
_of_nodes_to_stop
>
1
);
stoppedNodes
.
bitOR
(
nodes_to_stop
);
stoppedNodes
.
bitOR
(
nodes_to_stop
);
}
}
nodes
.
clear
(
nodeId
);
nodes
.
clear
(
nodeId
);
...
@@ -1150,6 +1153,12 @@ int MgmtSrvr::sendSTOP_REQ(const Vector<NodeId> &node_ids,
...
@@ -1150,6 +1153,12 @@ int MgmtSrvr::sendSTOP_REQ(const Vector<NodeId> &node_ids,
DBUG_RETURN
(
SEND_OR_RECEIVE_FAILED
);
DBUG_RETURN
(
SEND_OR_RECEIVE_FAILED
);
}
}
}
}
if
(
!
error
&&
do_stop_self
)
{
if
(
restart
)
g_RestartServer
=
true
;
g_StopServer
=
true
;
}
DBUG_RETURN
(
error
);
DBUG_RETURN
(
error
);
}
}
...
...
ndb/src/mgmsrv/Services.cpp
View file @
49bcc3ed
...
@@ -1010,22 +1010,6 @@ MgmApiSession::stop(Parser<MgmApiSession>::Context &,
...
@@ -1010,22 +1010,6 @@ MgmApiSession::stop(Parser<MgmApiSession>::Context &,
nodes
.
push_back
(
atoi
(
p
));
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
stopped
=
0
;
int
result
=
0
;
int
result
=
0
;
if
(
nodes
.
size
())
if
(
nodes
.
size
())
...
@@ -1035,16 +1019,9 @@ MgmApiSession::stop(Parser<MgmApiSession>::Context &,
...
@@ -1035,16 +1019,9 @@ MgmApiSession::stop(Parser<MgmApiSession>::Context &,
if
(
result
!=
0
)
if
(
result
!=
0
)
m_output
->
println
(
"result: %s"
,
get_error_text
(
result
));
m_output
->
println
(
"result: %s"
,
get_error_text
(
result
));
else
else
{
m_output
->
println
(
"result: Ok"
);
m_output
->
println
(
"result: Ok"
);
if
(
stop_self
)
stopped
++
;
}
m_output
->
println
(
"stopped: %d"
,
stopped
);
m_output
->
println
(
"stopped: %d"
,
stopped
);
m_output
->
println
(
""
);
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