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
9381d8c4
Commit
9381d8c4
authored
Nov 28, 2006
by
jonas@perch.ndb.mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ndb - bug#24544
fix so backup message is printed even in case of "ndb_mgm -e"
parent
60b19639
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
85 additions
and
61 deletions
+85
-61
storage/ndb/src/common/debugger/signaldata/BackupSignalData.cpp
...e/ndb/src/common/debugger/signaldata/BackupSignalData.cpp
+3
-2
storage/ndb/src/mgmclient/CommandInterpreter.cpp
storage/ndb/src/mgmclient/CommandInterpreter.cpp
+57
-50
storage/ndb/src/ndbapi/SignalSender.cpp
storage/ndb/src/ndbapi/SignalSender.cpp
+0
-9
storage/ndb/src/ndbapi/TransporterFacade.cpp
storage/ndb/src/ndbapi/TransporterFacade.cpp
+25
-0
No files found.
storage/ndb/src/common/debugger/signaldata/BackupSignalData.cpp
View file @
9381d8c4
...
...
@@ -20,9 +20,10 @@
bool
printBACKUP_REQ
(
FILE
*
output
,
const
Uint32
*
theData
,
Uint32
len
,
Uint16
bno
){
BackupReq
*
sig
=
(
BackupReq
*
)
theData
;
fprintf
(
output
,
" senderData: %d DataLength: %d
\n
"
,
fprintf
(
output
,
" senderData: %d DataLength: %d
flags: %d
\n
"
,
sig
->
senderData
,
sig
->
backupDataLen
);
sig
->
backupDataLen
,
sig
->
flags
);
return
true
;
}
...
...
storage/ndb/src/mgmclient/CommandInterpreter.cpp
View file @
9381d8c4
...
...
@@ -119,7 +119,7 @@ public:
int
executeStatus
(
int
processId
,
const
char
*
parameters
,
bool
all
);
int
executeEventReporting
(
int
processId
,
const
char
*
parameters
,
bool
all
);
int
executeDumpState
(
int
processId
,
const
char
*
parameters
,
bool
all
);
int
executeStartBackup
(
char
*
parameters
);
int
executeStartBackup
(
char
*
parameters
,
bool
interactive
);
int
executeAbortBackup
(
char
*
parameters
);
int
executeStop
(
Vector
<
BaseString
>
&
command_list
,
unsigned
command_pos
,
int
*
node_ids
,
int
no_of_nodes
);
...
...
@@ -991,7 +991,7 @@ CommandInterpreter::execute_impl(const char *_line, bool interactive)
else
if
(
strcasecmp
(
firstToken
,
"START"
)
==
0
&&
allAfterFirstToken
!=
NULL
&&
strncasecmp
(
allAfterFirstToken
,
"BACKUP"
,
sizeof
(
"BACKUP"
)
-
1
)
==
0
){
m_error
=
executeStartBackup
(
allAfterFirstToken
);
m_error
=
executeStartBackup
(
allAfterFirstToken
,
interactive
);
DBUG_RETURN
(
true
);
}
else
if
(
strcasecmp
(
firstToken
,
"ABORT"
)
==
0
&&
...
...
@@ -2442,24 +2442,17 @@ CommandInterpreter::executeEventReporting(int processId,
return
retval
;
}
/*****************************************************************************
* Backup
*****************************************************************************/
int
CommandInterpreter
::
executeStartBackup
(
char
*
parameters
)
CommandInterpreter
::
executeStartBackup
(
char
*
parameters
,
bool
interactive
)
{
struct
ndb_mgm_reply
reply
;
unsigned
int
backupId
;
#if 0
int filter[] = { 15, NDB_MGM_EVENT_CATEGORY_BACKUP, 0 };
int fd = ndb_mgm_listen_event(m_mgmsrv, filter);
if (fd < 0)
{
ndbout << "Initializing start of backup failed" << endl;
printError();
return fd;
}
#endif
int
fd
=
-
1
;
Vector
<
BaseString
>
args
;
{
BaseString
(
parameters
).
split
(
args
);
...
...
@@ -2472,25 +2465,21 @@ CommandInterpreter::executeStartBackup(char* parameters)
int
sz
=
args
.
size
();
int
result
;
i
f
(
sz
==
2
&&
args
[
1
]
==
"NOWAIT"
)
i
nt
flags
=
2
;
if
(
sz
==
2
&&
args
[
1
]
==
"NOWAIT"
)
{
flags
=
0
;
result
=
ndb_mgm_start_backup
(
m_mgmsrv
,
0
,
&
backupId
,
&
reply
);
}
else
if
(
sz
==
1
||
(
sz
==
3
&&
args
[
1
]
==
"WAIT"
&&
args
[
2
]
==
"COMPLETED"
))
else
if
(
sz
==
1
||
(
sz
==
3
&&
args
[
1
]
==
"WAIT"
&&
args
[
2
]
==
"COMPLETED"
))
{
flags
=
2
;
ndbout_c
(
"Waiting for completed, this may take several minutes"
);
result
=
ndb_mgm_start_backup
(
m_mgmsrv
,
2
,
&
backupId
,
&
reply
);
}
else
if
(
sz
==
3
&&
args
[
1
]
==
"WAIT"
&&
args
[
2
]
==
"STARTED"
)
else
if
(
sz
==
3
&&
args
[
1
]
==
"WAIT"
&&
args
[
2
]
==
"STARTED"
)
{
ndbout_c
(
"Waiting for started, this may take several minutes"
);
result
=
ndb_mgm_start_backup
(
m_mgmsrv
,
1
,
&
backupId
,
&
reply
)
;
flags
=
1
;
}
else
{
...
...
@@ -2498,45 +2487,63 @@ CommandInterpreter::executeStartBackup(char* parameters)
return
-
1
;
}
/**
* If interactive...event listner is already running
*/
if
(
flags
==
2
&&
!
interactive
)
{
int
filter
[]
=
{
15
,
NDB_MGM_EVENT_CATEGORY_BACKUP
,
0
,
0
};
fd
=
ndb_mgm_listen_event
(
m_mgmsrv
,
filter
);
if
(
fd
<
0
)
{
ndbout
<<
"Initializing start of backup failed"
<<
endl
;
printError
();
return
fd
;
}
}
result
=
ndb_mgm_start_backup
(
m_mgmsrv
,
flags
,
&
backupId
,
&
reply
);
if
(
result
!=
0
)
{
ndbout
<<
"Backup failed"
<<
endl
;
printError
();
#if 0
close(fd);
#endif
if
(
fd
>=
0
)
close
(
fd
);
return
result
;
}
#if 0
ndbout_c("Waiting for completed, this may take several minutes");
char *tmp;
char buf[1024];
if
(
fd
>=
0
)
{
SocketInputStream in(fd);
int count = 0;
char
*
tmp
;
char
buf
[
1024
];
{
SocketInputStream
in
(
fd
);
int
count
=
0
;
do
{
tmp
=
in
.
gets
(
buf
,
1024
);
if
(
tmp
)
{
ndbout
<<
tmp
;
unsigned
int
id
;
if
(
sscanf
(
tmp
,
"%*[^:]: Backup %d "
,
&
id
)
==
1
&&
id
==
backupId
){
count
++
;
}
}
}
while
(
count
<
2
);
}
SocketInputStream
in
(
fd
,
10
);
do
{
tmp
=
in
.
gets
(
buf
,
1024
);
if(tmp)
if
(
tmp
&&
tmp
[
0
]
!=
0
)
{
ndbout
<<
tmp
;
unsigned int id;
if(sscanf(tmp, "%*[^:]: Backup %d ", &id) == 1 && id == backupId){
count++;
}
}
} while(count < 2);
}
while
(
tmp
&&
tmp
[
0
]
!=
0
);
close
(
fd
);
}
SocketInputStream in(fd, 10);
do {
tmp = in.gets(buf, 1024);
if(tmp && tmp[0] != 0)
{
ndbout << tmp;
}
} while(tmp && tmp[0] != 0);
close(fd);
#endif
return
0
;
}
...
...
storage/ndb/src/ndbapi/SignalSender.cpp
View file @
9381d8c4
...
...
@@ -131,15 +131,6 @@ SignalSender::getNoOfConnectedNodes() const {
return
theFacade
->
theClusterMgr
->
getNoOfConnectedNodes
();
}
SendStatus
SignalSender
::
sendSignal
(
Uint16
nodeId
,
const
SimpleSignal
*
s
){
return
theFacade
->
theTransporterRegistry
->
prepareSend
(
&
s
->
header
,
1
,
// JBB
&
s
->
theData
[
0
],
nodeId
,
&
s
->
ptr
[
0
]);
}
template
<
class
T
>
SimpleSignal
*
SignalSender
::
waitFor
(
Uint32
timeOutMillis
,
T
&
t
)
...
...
storage/ndb/src/ndbapi/TransporterFacade.cpp
View file @
9381d8c4
...
...
@@ -1512,3 +1512,28 @@ void PollGuard::unlock_and_signal()
template
class
Vector
<
NodeStatusFunction
>;
template
class
Vector
<
TransporterFacade
::
ThreadData
::
Object_Execute
>;
#include "SignalSender.hpp"
SendStatus
SignalSender
::
sendSignal
(
Uint16
nodeId
,
const
SimpleSignal
*
s
){
#ifdef API_TRACE
if
(
setSignalLog
()
&&
TRACE_GSN
(
s
->
header
.
theVerId_signalNumber
)){
SignalHeader
tmp
=
s
->
header
;
tmp
.
theSendersBlockRef
=
getOwnRef
();
LinearSectionPtr
ptr
[
3
];
signalLogger
.
sendSignal
(
tmp
,
1
,
s
->
theData
,
nodeId
,
ptr
,
0
);
signalLogger
.
flushSignalLog
();
}
#endif
return
theFacade
->
theTransporterRegistry
->
prepareSend
(
&
s
->
header
,
1
,
// JBB
&
s
->
theData
[
0
],
nodeId
,
&
s
->
ptr
[
0
]);
}
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