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
91f10a99
Commit
91f10a99
authored
Aug 23, 2004
by
tomas@poseidon.(none)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added support for stopping ndb_mgmd from client
parent
e437d7f3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
3 deletions
+26
-3
ndb/src/mgmsrv/Services.cpp
ndb/src/mgmsrv/Services.cpp
+24
-2
ndb/src/mgmsrv/main.cpp
ndb/src/mgmsrv/main.cpp
+2
-1
No files found.
ndb/src/mgmsrv/Services.cpp
View file @
91f10a99
...
...
@@ -31,6 +31,8 @@
#include "Services.hpp"
extern
bool
g_StopServer
;
static
const
unsigned
int
MAX_READ_TIMEOUT
=
1000
;
static
const
unsigned
int
MAX_WRITE_TIMEOUT
=
100
;
...
...
@@ -1012,12 +1014,29 @@ MgmApiSession::stop(Parser<MgmApiSession>::Context &,
nodes
.
push_back
(
atoi
(
p
));
}
int
stop_self
=
0
;
for
(
size_t
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
;
}
}
}
int
stopped
=
0
,
result
=
0
;
for
(
size_t
i
=
0
;
i
<
nodes
.
size
();
i
++
)
if
((
result
=
m_mgmsrv
.
stopNode
(
nodes
[
i
],
abort
!=
0
))
==
0
)
if
(
nodes
[
i
]
!=
m_mgmsrv
.
getOwnNodeId
())
{
if
((
result
=
m_mgmsrv
.
stopNode
(
nodes
[
i
],
abort
!=
0
))
==
0
)
stopped
++
;
}
else
stopped
++
;
m_output
->
println
(
"stop reply"
);
if
(
result
!=
0
)
m_output
->
println
(
"result: %s"
,
m_mgmsrv
.
getErrorText
(
result
));
...
...
@@ -1025,6 +1044,9 @@ MgmApiSession::stop(Parser<MgmApiSession>::Context &,
m_output
->
println
(
"result: Ok"
);
m_output
->
println
(
"stopped: %d"
,
stopped
);
m_output
->
println
(
""
);
if
(
stop_self
)
g_StopServer
=
true
;
}
...
...
ndb/src/mgmsrv/main.cpp
View file @
91f10a99
...
...
@@ -265,9 +265,10 @@ NDB_MAIN(mgmsrv){
NdbSleep_MilliSleep
(
500
);
}
g_EventLogger
.
info
(
"Shutting down server..."
);
glob
.
socketServer
->
stopServer
();
glob
.
socketServer
->
stopSessions
();
g_EventLogger
.
info
(
"Shutdown complete"
);
return
0
;
error_end:
return
1
;
...
...
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