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
cc75d9ea
Commit
cc75d9ea
authored
Jun 14, 2007
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge mskold@bk-internal.mysql.com:/home/bk/mysql-5.1-ndb
into mysql.com:/windows/Linux_space/MySQL/mysql-5.1-new-ndb
parents
d442b5a5
ec885d9c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
65 additions
and
45 deletions
+65
-45
extra/perror.c
extra/perror.c
+1
-1
mysql-test/r/ndb_backup_print.result
mysql-test/r/ndb_backup_print.result
+4
-4
mysql-test/t/ndb_backup_print.test
mysql-test/t/ndb_backup_print.test
+2
-2
storage/ndb/src/mgmclient/CommandInterpreter.cpp
storage/ndb/src/mgmclient/CommandInterpreter.cpp
+58
-38
No files found.
extra/perror.c
View file @
cc75d9ea
...
@@ -38,7 +38,7 @@ int mgmapi_error_string(int err_no, char *str, int size)
...
@@ -38,7 +38,7 @@ int mgmapi_error_string(int err_no, char *str, int size)
int
i
;
int
i
;
for
(
i
=
0
;
i
<
ndb_mgm_noOfErrorMsgs
;
i
++
)
for
(
i
=
0
;
i
<
ndb_mgm_noOfErrorMsgs
;
i
++
)
{
{
if
(
ndb_mgm_error_msgs
[
i
].
code
==
err_no
)
if
(
(
int
)
ndb_mgm_error_msgs
[
i
].
code
==
err_no
)
{
{
my_snprintf
(
str
,
size
-
1
,
"%s"
,
ndb_mgm_error_msgs
[
i
].
msg
);
my_snprintf
(
str
,
size
-
1
,
"%s"
,
ndb_mgm_error_msgs
[
i
].
msg
);
str
[
size
-
1
]
=
'\0'
;
str
[
size
-
1
]
=
'\0'
;
...
...
mysql-test/r/ndb_backup_print.result
View file @
cc75d9ea
...
@@ -2,8 +2,8 @@ use test;
...
@@ -2,8 +2,8 @@ use test;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
Connected to Management Server at: :
Connected to Management Server at: :
Waiting for completed, this may take several minutes
Waiting for completed, this may take several minutes
Backup started from node
Node :
Backup started from node
Backup started from node completed
Node :
Backup started from node completed
StartGCP: StopGCP:
StartGCP: StopGCP:
#Records: #LogRecords:
#Records: #LogRecords:
Data: bytes Log: bytes
Data: bytes Log: bytes
...
@@ -57,8 +57,8 @@ insert into t1 values
...
@@ -57,8 +57,8 @@ insert into t1 values
);
);
Connected to Management Server at: :
Connected to Management Server at: :
Waiting for completed, this may take several minutes
Waiting for completed, this may take several minutes
Backup started from node
Node :
Backup started from node
Backup started from node completed
Node :
Backup started from node completed
StartGCP: StopGCP:
StartGCP: StopGCP:
#Records: #LogRecords:
#Records: #LogRecords:
Data: bytes Log: bytes
Data: bytes Log: bytes
mysql-test/t/ndb_backup_print.test
View file @
cc75d9ea
...
@@ -8,7 +8,7 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
...
@@ -8,7 +8,7 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
--
enable_warnings
--
enable_warnings
#NO.1 test output of backup
#NO.1 test output of backup
--
exec
$NDB_
TOOLS_DIR
/../
src
/
mgmclient
/
ndb_mgm
-
e
"start backup"
|
sed
-
e
's/[0-9]//g'
|
sed
-
e
's/localhost//g'
|
sed
-
e
's/\.\.\.*//g'
--
exec
$NDB_
MGM
--
no
-
defaults
-
e
"start backup"
|
sed
-
e
's/[0-9]//g'
|
sed
-
e
's/localhost//g'
|
sed
-
e
's/\.\.\.*//g'
create
table
t1
create
table
t1
(
pk
int
key
(
pk
int
key
...
@@ -63,4 +63,4 @@ insert into t1 values
...
@@ -63,4 +63,4 @@ insert into t1 values
);
);
#NO.2 test output of backup after some simple SQL operations
#NO.2 test output of backup after some simple SQL operations
--
exec
$NDB_
TOOLS_DIR
/../
src
/
mgmclient
/
ndb_mgm
-
e
"start backup"
|
sed
-
e
's/[0-9]//g'
|
sed
-
e
's/localhost//g'
|
sed
-
e
's/\.\.\.*//g'
--
exec
$NDB_
MGM
--
no
-
defaults
-
e
"start backup"
|
sed
-
e
's/[0-9]//g'
|
sed
-
e
's/localhost//g'
|
sed
-
e
's/\.\.\.*//g'
storage/ndb/src/mgmclient/CommandInterpreter.cpp
View file @
cc75d9ea
...
@@ -708,6 +708,12 @@ CommandInterpreter::printError()
...
@@ -708,6 +708,12 @@ CommandInterpreter::printError()
/*
/*
* print log event from mgmsrv to console screen
* print log event from mgmsrv to console screen
*/
*/
#define make_uint64(a,b) (((Uint64)(a)) + (((Uint64)(b)) << 32))
#define Q64(a) make_uint64(event->EVENT.a ## _lo, event->EVENT.a ## _hi)
#define R event->source_nodeid
#define Q(a) event->EVENT.a
#define QVERSION getMajor(Q(version)), getMinor(Q(version)), getBuild(Q(version))
#define NDB_LE_(a) NDB_LE_ ## a
static
void
static
void
printLogEvent
(
struct
ndb_logevent
*
event
)
printLogEvent
(
struct
ndb_logevent
*
event
)
{
{
...
@@ -715,71 +721,83 @@ printLogEvent(struct ndb_logevent* event)
...
@@ -715,71 +721,83 @@ printLogEvent(struct ndb_logevent* event)
/**
/**
* NDB_MGM_EVENT_CATEGORY_BACKUP
* NDB_MGM_EVENT_CATEGORY_BACKUP
*/
*/
case
NDB_LE_BackupStarted
:
#undef EVENT
ndbout_c
(
"Backup %d started from node %d"
,
#define EVENT BackupStarted
event
->
BackupStarted
.
backup_id
,
event
->
BackupStarted
.
starting_node
);
case
NDB_LE_BackupStarted
:
ndbout_c
(
"Node %u: Backup %d started from node %d"
,
R
,
Q
(
backup_id
),
Q
(
starting_node
));
break
;
break
;
#undef EVENT
#define EVENT BackupFailedToStart
case
NDB_LE_BackupFailedToStart
:
case
NDB_LE_BackupFailedToStart
:
ndbout_c
(
"
Backup request from %d failed to start. Error: %d"
,
ndbout_c
(
"
Node %u: Backup request from %d failed to start. Error: %d"
,
event
->
BackupFailedToStart
.
starting_node
,
event
->
BackupFailedToStart
.
error
);
R
,
Q
(
starting_node
),
Q
(
error
)
);
break
;
break
;
#undef EVENT
#define EVENT BackupCompleted
case
NDB_LE_BackupCompleted
:
case
NDB_LE_BackupCompleted
:
ndbout_c
(
"Backup %u started from node %u completed
\n
"
ndbout_c
(
"
Node %u:
Backup %u started from node %u completed
\n
"
" StartGCP: %u StopGCP: %u
\n
"
" StartGCP: %u StopGCP: %u
\n
"
" #Records: %u #LogRecords: %u
\n
"
" #Records: %u #LogRecords: %u
\n
"
" Data: %u bytes Log: %u bytes"
,
" Data: %u bytes Log: %u bytes"
,
R
,
event
->
BackupCompleted
.
backup_id
,
event
->
BackupCompleted
.
starting_node
,
Q
(
backup_id
),
Q
(
starting_node
)
,
event
->
BackupCompleted
.
start_gci
,
event
->
BackupCompleted
.
stop_gci
,
Q
(
start_gci
),
Q
(
stop_gci
)
,
event
->
BackupCompleted
.
n_records
,
event
->
BackupCompleted
.
n_log_records
,
Q
(
n_records
),
Q
(
n_log_records
)
,
event
->
BackupCompleted
.
n_bytes
,
event
->
BackupCompleted
.
n_log_bytes
);
Q
(
n_bytes
),
Q
(
n_log_bytes
)
);
break
;
break
;
#undef EVENT
#define EVENT BackupAborted
case
NDB_LE_BackupAborted
:
case
NDB_LE_BackupAborted
:
ndbout_c
(
"Backup %d started from %d has been aborted. Error: %d"
,
ndbout_c
(
"Node %u: Backup %d started from %d has been aborted. Error: %d"
,
event
->
BackupAborted
.
backup_id
,
event
->
BackupAborted
.
starting_node
,
R
,
Q
(
backup_id
),
Q
(
starting_node
),
Q
(
error
));
event
->
BackupAborted
.
error
);
break
;
break
;
/**
/**
* NDB_MGM_EVENT_CATEGORY_STARTUP
* NDB_MGM_EVENT_CATEGORY_STARTUP
*/
*/
#undef EVENT
#define EVENT NDBStartStarted
case
NDB_LE_NDBStartStarted
:
case
NDB_LE_NDBStartStarted
:
ndbout_c
(
"Start initiated (version %d.%d.%d)"
,
ndbout_c
(
"Node %u: Start initiated (version %d.%d.%d)"
,
getMajor
(
event
->
NDBStartStarted
.
version
),
R
,
QVERSION
);
getMinor
(
event
->
NDBStartStarted
.
version
),
getBuild
(
event
->
NDBStartStarted
.
version
));
break
;
break
;
#undef EVENT
#define EVENT NDBStartCompleted
case
NDB_LE_NDBStartCompleted
:
case
NDB_LE_NDBStartCompleted
:
ndbout_c
(
"Started (version %d.%d.%d)"
,
ndbout_c
(
"Node %u: Started (version %d.%d.%d)"
,
getMajor
(
event
->
NDBStartCompleted
.
version
),
R
,
QVERSION
);
getMinor
(
event
->
NDBStartCompleted
.
version
),
getBuild
(
event
->
NDBStartCompleted
.
version
));
break
;
break
;
#undef EVENT
#define EVENT NDBStopStarted
case
NDB_LE_NDBStopStarted
:
case
NDB_LE_NDBStopStarted
:
ndbout_c
(
"
%s shutdown initiated"
,
ndbout_c
(
"
Node %u: %s shutdown initiated"
,
R
,
(
event
->
NDBStopStarted
.
stoptype
==
1
?
"Cluster"
:
"Node"
));
(
Q
(
stoptype
)
==
1
?
"Cluster"
:
"Node"
));
break
;
break
;
#undef EVENT
#define EVENT NDBStopCompleted
case
NDB_LE_NDBStopCompleted
:
case
NDB_LE_NDBStopCompleted
:
{
{
BaseString
action_str
(
""
);
BaseString
action_str
(
""
);
BaseString
signum_str
(
""
);
BaseString
signum_str
(
""
);
getRestartAction
(
event
->
NDBStopCompleted
.
action
,
action_str
);
getRestartAction
(
Q
(
action
)
,
action_str
);
if
(
event
->
NDBStopCompleted
.
signum
)
if
(
Q
(
signum
)
)
signum_str
.
appfmt
(
" Initiated by signal %d."
,
signum_str
.
appfmt
(
" Initiated by signal %d."
,
event
->
NDBStopCompleted
.
signum
);
Q
(
signum
));
ndbout_c
(
"Node shutdown completed%s.%s"
,
ndbout_c
(
"Node %u: Node shutdown completed%s.%s"
,
action_str
.
c_str
(),
R
,
action_str
.
c_str
(),
signum_str
.
c_str
());
signum_str
.
c_str
());
}
}
break
;
break
;
#undef EVENT
#define EVENT NDBStopForced
case
NDB_LE_NDBStopForced
:
case
NDB_LE_NDBStopForced
:
{
{
BaseString
action_str
(
""
);
BaseString
action_str
(
""
);
BaseString
reason_str
(
""
);
BaseString
reason_str
(
""
);
BaseString
sphase_str
(
""
);
BaseString
sphase_str
(
""
);
int
signum
=
event
->
NDBStopForced
.
signum
;
int
signum
=
Q
(
signum
)
;
int
error
=
event
->
NDBStopForced
.
error
;
int
error
=
Q
(
error
)
;
int
sphase
=
event
->
NDBStopForced
.
sphase
;
int
sphase
=
Q
(
sphase
)
;
int
extra
=
event
->
NDBStopForced
.
extra
;
int
extra
=
Q
(
extra
)
;
getRestartAction
(
event
->
NDBStopForced
.
action
,
action_str
);
getRestartAction
(
Q
(
action
)
,
action_str
);
if
(
signum
)
if
(
signum
)
reason_str
.
appfmt
(
" Initiated by signal %d."
,
signum
);
reason_str
.
appfmt
(
" Initiated by signal %d."
,
signum
);
if
(
error
)
if
(
error
)
...
@@ -796,13 +814,15 @@ printLogEvent(struct ndb_logevent* event)
...
@@ -796,13 +814,15 @@ printLogEvent(struct ndb_logevent* event)
}
}
if
(
sphase
<
255
)
if
(
sphase
<
255
)
sphase_str
.
appfmt
(
" Occured during startphase %u."
,
sphase
);
sphase_str
.
appfmt
(
" Occured during startphase %u."
,
sphase
);
ndbout_c
(
"
Forced node shutdown completed%s.%s%s"
,
ndbout_c
(
"
Node %u: Forced node shutdown completed%s.%s%s"
,
action_str
.
c_str
(),
sphase_str
.
c_str
(),
R
,
action_str
.
c_str
(),
sphase_str
.
c_str
(),
reason_str
.
c_str
());
reason_str
.
c_str
());
}
}
break
;
break
;
#undef EVENT
#define EVENT StopAborted
case
NDB_LE_NDBStopAborted
:
case
NDB_LE_NDBStopAborted
:
ndbout_c
(
"Node
shutdown aborted"
);
ndbout_c
(
"Node
%u: Node shutdown aborted"
,
R
);
break
;
break
;
/**
/**
* default nothing to print
* default nothing to print
...
...
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