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
cee499f1
Commit
cee499f1
authored
Aug 17, 2004
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix testBackup
ndb/src/ndbapi/TransporterFacade.cpp: Retry alloc of node id
parent
e65e823c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
24 deletions
+16
-24
ndb/src/ndbapi/TransporterFacade.cpp
ndb/src/ndbapi/TransporterFacade.cpp
+7
-4
ndb/test/src/NdbBackup.cpp
ndb/test/src/NdbBackup.cpp
+9
-20
No files found.
ndb/src/ndbapi/TransporterFacade.cpp
View file @
cee499f1
...
@@ -353,12 +353,15 @@ TransporterFacade::start_instance(const char * connectString){
...
@@ -353,12 +353,15 @@ TransporterFacade::start_instance(const char * connectString){
if
(
s_config_retriever
->
do_connect
()
==
-
1
)
if
(
s_config_retriever
->
do_connect
()
==
-
1
)
break
;
break
;
const
Uint32
nodeId
=
s_config_retriever
->
allocNodeId
();
Uint32
nodeId
=
s_config_retriever
->
allocNodeId
();
for
(
Uint32
i
=
0
;
nodeId
==
0
&&
i
<
5
;
i
++
){
NdbSleep_SecSleep
(
3
);
nodeId
=
s_config_retriever
->
allocNodeId
();
}
if
(
nodeId
==
0
)
if
(
nodeId
==
0
)
break
;
break
;
ndb_mgm_configuration
*
props
=
s_config_retriever
->
getConfig
();
ndb_mgm_configuration
*
props
=
s_config_retriever
->
getConfig
();
if
(
props
==
0
)
if
(
props
==
0
)
break
;
break
;
...
...
ndb/test/src/NdbBackup.cpp
View file @
cee499f1
...
@@ -70,11 +70,11 @@ NdbBackup::getFileSystemPathForNode(int _node_id){
...
@@ -70,11 +70,11 @@ NdbBackup::getFileSystemPathForNode(int _node_id){
* Fetch configuration from management server
* Fetch configuration from management server
*/
*/
ConfigRetriever
cr
(
0
,
NODE_TYPE_API
);
ConfigRetriever
cr
(
0
,
NODE_TYPE_API
);
ndb_mgm_configuration
*
p
;
ndb_mgm_configuration
*
p
=
0
;
BaseString
tmp
;
tmp
.
assfmt
(
"%s:%d"
,
host
.
c_str
(),
port
);
BaseString
tmp
;
tmp
.
assfmt
(
"%s:%d"
,
host
.
c_str
(),
port
);
NdbMgmHandle
handle
=
ndb_mgm_create_handle
();
NdbMgmHandle
handle
=
ndb_mgm_create_handle
();
if
(
handle
==
0
||
ndb_mgm_connect
(
handle
,
tmp
.
c_str
())
!=
0
&&
if
(
handle
==
0
||
ndb_mgm_connect
(
handle
,
tmp
.
c_str
())
!=
0
||
(
p
=
ndb_mgm_get_configuration
(
handle
,
0
))
==
0
){
(
p
=
ndb_mgm_get_configuration
(
handle
,
0
))
==
0
){
const
char
*
s
=
0
;
const
char
*
s
=
0
;
...
@@ -97,7 +97,8 @@ NdbBackup::getFileSystemPathForNode(int _node_id){
...
@@ -97,7 +97,8 @@ NdbBackup::getFileSystemPathForNode(int _node_id){
ndbout
<<
"Invalid configuration fetched, DB missing"
<<
endl
;
ndbout
<<
"Invalid configuration fetched, DB missing"
<<
endl
;
return
NULL
;
return
NULL
;
}
}
unsigned
int
type
=
123456
;
unsigned
int
type
=
NODE_TYPE_DB
+
1
;
if
(
iter
.
get
(
CFG_TYPE_OF_SECTION
,
&
type
)
||
type
!=
NODE_TYPE_DB
){
if
(
iter
.
get
(
CFG_TYPE_OF_SECTION
,
&
type
)
||
type
!=
NODE_TYPE_DB
){
ndbout
<<
"type = "
<<
type
<<
endl
;
ndbout
<<
"type = "
<<
type
<<
endl
;
ndbout
<<
"Invalid configuration fetched, I'm wrong type of node"
<<
endl
;
ndbout
<<
"Invalid configuration fetched, I'm wrong type of node"
<<
endl
;
...
@@ -148,20 +149,12 @@ NdbBackup::execRestore(bool _restore_data,
...
@@ -148,20 +149,12 @@ NdbBackup::execRestore(bool _restore_data,
ndbout
<<
"res: "
<<
res
<<
endl
;
ndbout
<<
"res: "
<<
res
<<
endl
;
#if 0
snprintf
(
buf
,
255
,
"%sndb_restore -c
\"
nodeid=%d;host=%s
\"
-n %d -b %d %s %s ."
,
snprintf(buf, 255, "ndb_restore -c \"nodeid=%d;host=%s\" -n %d -b %d %s %s %s/BACKUP/BACKUP-%d",
#if 1
ownNodeId,
""
,
addr,
#else
_node_id,
"valgrind --leak-check=yes -v "
_backup_id,
_restore_data?"-r":"",
_restore_meta?"-m":"",
path,
_backup_id);
#endif
#endif
snprintf
(
buf
,
255
,
"valgrind --leak-check=yes -v ndb_restore -c
\"
nodeid=%d;host=%s
\"
-n %d -b %d %s %s ."
,
ownNodeId
,
ownNodeId
,
addr
.
c_str
(),
addr
.
c_str
(),
_node_id
,
_node_id
,
...
@@ -169,10 +162,6 @@ NdbBackup::execRestore(bool _restore_data,
...
@@ -169,10 +162,6 @@ NdbBackup::execRestore(bool _restore_data,
_restore_data
?
"-r"
:
""
,
_restore_data
?
"-r"
:
""
,
_restore_meta
?
"-m"
:
""
);
_restore_meta
?
"-m"
:
""
);
// path,
// _backup_id);
ndbout
<<
"buf: "
<<
buf
<<
endl
;
ndbout
<<
"buf: "
<<
buf
<<
endl
;
res
=
system
(
buf
);
res
=
system
(
buf
);
...
...
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