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
b7ca7909
Commit
b7ca7909
authored
Jun 07, 2006
by
stewart@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BUG#18966 CHange in stop/shutdown behaviour
Fixes based on review by Tomas
parent
f474e69d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
34 deletions
+36
-34
ndb/src/mgmapi/mgmapi.cpp
ndb/src/mgmapi/mgmapi.cpp
+21
-9
ndb/src/mgmsrv/Services.cpp
ndb/src/mgmsrv/Services.cpp
+14
-22
ndb/src/mgmsrv/Services.hpp
ndb/src/mgmsrv/Services.hpp
+1
-3
No files found.
ndb/src/mgmapi/mgmapi.cpp
View file @
b7ca7909
...
...
@@ -870,18 +870,24 @@ ndb_mgm_stop3(NdbMgmHandle handle, int no_of_nodes, const int * node_list,
if
(
handle
->
mgmd_version_build
==-
1
)
{
char
verstr
[
50
];
ndb_mgm_get_version
(
handle
,
if
(
!
ndb_mgm_get_version
(
handle
,
&
(
handle
->
mgmd_version_major
),
&
(
handle
->
mgmd_version_minor
),
&
(
handle
->
mgmd_version_build
),
sizeof
(
verstr
),
verstr
);
verstr
))
{
return
-
1
;
}
}
int
use_v2
=
(
handle
->
mgmd_version_major
==
5
)
int
use_v2
=
(
(
handle
->
mgmd_version_major
==
5
)
&&
(
(
handle
->
mgmd_version_minor
==
0
&&
handle
->
mgmd_version_build
>=
21
)
||
(
handle
->
mgmd_version_minor
==
1
&&
handle
->
mgmd_version_build
>=
12
)
);
||
(
handle
->
mgmd_version_minor
>
1
)
)
)
||
(
handle
->
mgmd_version_major
>
5
);
if
(
no_of_nodes
<
-
1
){
SET_ERROR
(
handle
,
NDB_MGM_ILLEGAL_NUMBER_OF_NODES
,
...
...
@@ -900,7 +906,7 @@ ndb_mgm_stop3(NdbMgmHandle handle, int no_of_nodes, const int * node_list,
args
.
put
(
"stop"
,
(
no_of_nodes
==-
1
)
?
"mgm,db"
:
"db"
);
const
Properties
*
reply
;
if
(
use_v2
)
reply
=
ndb_mgm_call
(
handle
,
stop_reply_v2
,
"stop all
v2
"
,
&
args
);
reply
=
ndb_mgm_call
(
handle
,
stop_reply_v2
,
"stop all"
,
&
args
);
else
reply
=
ndb_mgm_call
(
handle
,
stop_reply_v1
,
"stop all"
,
&
args
);
CHECK_REPLY
(
reply
,
-
1
);
...
...
@@ -1013,18 +1019,24 @@ ndb_mgm_restart3(NdbMgmHandle handle, int no_of_nodes, const int * node_list,
if
(
handle
->
mgmd_version_build
==-
1
)
{
char
verstr
[
50
];
ndb_mgm_get_version
(
handle
,
if
(
!
ndb_mgm_get_version
(
handle
,
&
(
handle
->
mgmd_version_major
),
&
(
handle
->
mgmd_version_minor
),
&
(
handle
->
mgmd_version_build
),
sizeof
(
verstr
),
verstr
);
verstr
))
{
return
-
1
;
}
}
int
use_v2
=
(
handle
->
mgmd_version_major
==
5
)
int
use_v2
=
(
(
handle
->
mgmd_version_major
==
5
)
&&
(
(
handle
->
mgmd_version_minor
==
0
&&
handle
->
mgmd_version_build
>=
21
)
||
(
handle
->
mgmd_version_minor
==
1
&&
handle
->
mgmd_version_build
>=
12
)
);
||
(
handle
->
mgmd_version_minor
>
1
)
)
)
||
(
handle
->
mgmd_version_major
>
5
);
if
(
no_of_nodes
<
0
){
SET_ERROR
(
handle
,
NDB_MGM_RESTART_FAILED
,
...
...
ndb/src/mgmsrv/Services.cpp
View file @
b7ca7909
...
...
@@ -200,12 +200,9 @@ ParserRow<MgmApiSession> commands[] = {
MGM_ARG
(
"node"
,
String
,
Mandatory
,
"Node"
),
MGM_ARG
(
"abort"
,
Int
,
Mandatory
,
"Node"
),
MGM_CMD
(
"stop all"
,
&
MgmApiSession
::
stopAll
_v1
,
""
),
MGM_CMD
(
"stop all"
,
&
MgmApiSession
::
stopAll
,
""
),
MGM_ARG
(
"abort"
,
Int
,
Mandatory
,
"Node"
),
MGM_CMD
(
"stop all v2"
,
&
MgmApiSession
::
stopAll_v2
,
""
),
MGM_ARG
(
"abort"
,
Int
,
Mandatory
,
"Node"
),
MGM_ARG
(
"stop"
,
String
,
Mandatory
,
"MGM/DB or both"
),
MGM_ARG
(
"stop"
,
String
,
Optional
,
"MGM/DB or both"
),
MGM_CMD
(
"enter single user"
,
&
MgmApiSession
::
enterSingleUser
,
""
),
MGM_ARG
(
"nodeId"
,
Int
,
Mandatory
,
"Node"
),
...
...
@@ -1071,31 +1068,26 @@ MgmApiSession::stop(Properties const &args, int version) {
m_output
->
println
(
""
);
}
void
MgmApiSession
::
stopAll_v1
(
Parser
<
MgmApiSession
>::
Context
&
,
Properties
const
&
args
)
{
stopAll
(
args
,
"db"
,
1
);
}
void
MgmApiSession
::
stopAll_v2
(
Parser
<
MgmApiSession
>::
Context
&
,
Properties
const
&
args
)
{
BaseString
tostop
;
args
.
get
(
"stop"
,
tostop
);
stopAll
(
args
,
tostop
.
c_str
(),
2
);
}
void
MgmApiSession
::
stopAll
(
Properties
const
&
args
,
const
char
*
tostop
,
int
ver
)
{
MgmApiSession
::
stopAll
(
Parser
<
MgmApiSession
>::
Context
&
,
Properties
const
&
args
)
{
int
stopped
[
2
]
=
{
0
,
0
};
Uint32
abort
;
args
.
get
(
"abort"
,
&
abort
);
BaseString
stop
;
const
char
*
tostop
=
"db"
;
int
ver
=
1
;
if
(
args
.
get
(
"stop"
,
stop
))
{
tostop
=
stop
.
c_str
();
ver
=
2
;
}
int
result
=
0
;
if
(
strstr
(
tostop
,
"db"
))
result
=
m_mgmsrv
.
shutdownDB
(
&
stopped
[
0
],
abort
!=
0
);
if
(
strstr
(
tostop
,
"mgm"
))
if
(
!
result
&&
strstr
(
tostop
,
"mgm"
))
result
=
m_mgmsrv
.
shutdownMGM
(
&
stopped
[
1
],
abort
!=
0
,
&
m_stopSelf
);
m_output
->
println
(
"stop reply"
);
...
...
ndb/src/mgmsrv/Services.hpp
View file @
b7ca7909
...
...
@@ -80,9 +80,7 @@ public:
void
stop_v1
(
Parser_t
::
Context
&
ctx
,
const
class
Properties
&
args
);
void
stop_v2
(
Parser_t
::
Context
&
ctx
,
const
class
Properties
&
args
);
void
stop
(
const
class
Properties
&
args
,
int
version
);
void
stopAll_v1
(
Parser_t
::
Context
&
ctx
,
const
class
Properties
&
args
);
void
stopAll_v2
(
Parser_t
::
Context
&
ctx
,
const
class
Properties
&
args
);
void
stopAll
(
Properties
const
&
args
,
const
char
*
tostop
,
int
ver
);
void
stopAll
(
Parser_t
::
Context
&
ctx
,
const
class
Properties
&
args
);
void
start
(
Parser_t
::
Context
&
ctx
,
const
class
Properties
&
args
);
void
startAll
(
Parser_t
::
Context
&
ctx
,
const
class
Properties
&
args
);
void
bye
(
Parser_t
::
Context
&
ctx
,
const
class
Properties
&
args
);
...
...
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