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
1d56e0df
Commit
1d56e0df
authored
Nov 18, 2004
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adopted testprograms to changes in mgmapi
parent
55c57bf6
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
48 deletions
+27
-48
ndb/test/run-test/main.cpp
ndb/test/run-test/main.cpp
+13
-9
ndb/test/src/NdbBackup.cpp
ndb/test/src/NdbBackup.cpp
+4
-6
ndb/test/src/NdbRestarter.cpp
ndb/test/src/NdbRestarter.cpp
+10
-33
No files found.
ndb/test/run-test/main.cpp
View file @
1d56e0df
...
...
@@ -538,15 +538,19 @@ connect_ndb_mgm(atrt_process & proc){
}
BaseString
tmp
=
proc
.
m_hostname
;
tmp
.
appfmt
(
":%d"
,
proc
.
m_ndb_mgm_port
);
time_t
start
=
time
(
0
);
const
time_t
max_connect_time
=
30
;
do
{
if
(
ndb_mgm_connect
(
handle
,
tmp
.
c_str
())
!=
-
1
){
if
(
ndb_mgm_set_connectstring
(
handle
,
tmp
.
c_str
()))
{
g_logger
.
critical
(
"Unable to create parse connectstring"
);
return
false
;
}
if
(
ndb_mgm_connect
(
handle
,
30
,
1
,
0
)
!=
-
1
)
{
proc
.
m_ndb_mgm_handle
=
handle
;
return
true
;
}
sleep
(
1
);
}
while
(
time
(
0
)
<
(
start
+
max_connect_time
));
g_logger
.
critical
(
"Unable to connect to ndb mgm %s"
,
tmp
.
c_str
());
return
false
;
}
...
...
ndb/test/src/NdbBackup.cpp
View file @
1d56e0df
...
...
@@ -69,16 +69,14 @@ NdbBackup::getBackupDataDirForNode(int _node_id){
/**
* Fetch configuration from management server
*/
LocalConfig
lc
;
if
(
!
lc
.
init
(
0
,
0
))
{
abort
();
}
ConfigRetriever
cr
(
lc
,
0
,
NODE_TYPE_API
);
ConfigRetriever
cr
(
0
,
0
,
NODE_TYPE_API
);
ndb_mgm_configuration
*
p
=
0
;
BaseString
tmp
;
tmp
.
assfmt
(
"%s:%d"
,
host
.
c_str
(),
port
);
NdbMgmHandle
handle
=
ndb_mgm_create_handle
();
if
(
handle
==
0
||
ndb_mgm_connect
(
handle
,
tmp
.
c_str
())
!=
0
||
if
(
handle
==
0
||
ndb_mgm_set_connectstring
(
handle
,
tmp
.
c_str
())
!=
0
||
ndb_mgm_connect
(
handle
,
0
,
0
,
0
)
!=
0
||
(
p
=
ndb_mgm_get_configuration
(
handle
,
0
))
==
0
){
const
char
*
s
=
0
;
...
...
ndb/test/src/NdbRestarter.cpp
View file @
1d56e0df
...
...
@@ -18,7 +18,6 @@
#include <NdbOut.hpp>
#include <NdbSleep.h>
#include <NdbTick.h>
#include <LocalConfig.hpp>
#include <mgmapi_debug.h>
#include <NDBT_Output.hpp>
#include <random.h>
...
...
@@ -38,37 +37,7 @@ NdbRestarter::NdbRestarter(const char* _addr):
m_config
(
0
)
{
if
(
_addr
==
NULL
){
LocalConfig
lcfg
;
if
(
!
lcfg
.
init
()){
lcfg
.
printError
();
lcfg
.
printUsage
();
g_err
<<
"NdbRestarter - Error parsing local config file"
<<
endl
;
return
;
}
if
(
lcfg
.
ids
.
size
()
==
0
){
g_err
<<
"NdbRestarter - No management servers configured in local config file"
<<
endl
;
return
;
}
for
(
int
i
=
0
;
i
<
lcfg
.
ids
.
size
();
i
++
){
MgmtSrvrId
*
m
=
&
lcfg
.
ids
[
i
];
switch
(
m
->
type
){
case
MgmId_TCP
:
char
buf
[
255
];
snprintf
(
buf
,
255
,
"%s:%d"
,
m
->
name
.
c_str
(),
m
->
port
);
addr
.
assign
(
buf
);
host
.
assign
(
m
->
name
.
c_str
());
port
=
m
->
port
;
return
;
break
;
case
MgmId_File
:
break
;
default:
break
;
}
}
addr
.
assign
(
""
);
}
else
{
addr
.
assign
(
_addr
);
}
...
...
@@ -397,7 +366,15 @@ NdbRestarter::connect(){
return
-
1
;
}
g_info
<<
"Connecting to mgmsrv at "
<<
addr
.
c_str
()
<<
endl
;
if
(
ndb_mgm_connect
(
handle
,
addr
.
c_str
())
==
-
1
)
{
if
(
ndb_mgm_set_connectstring
(
handle
,
addr
.
c_str
()))
{
MGMERR
(
handle
);
g_err
<<
"Connection to "
<<
addr
.
c_str
()
<<
" failed"
<<
endl
;
return
-
1
;
}
if
(
ndb_mgm_connect
(
handle
,
0
,
0
,
0
)
==
-
1
)
{
MGMERR
(
handle
);
g_err
<<
"Connection to "
<<
addr
.
c_str
()
<<
" failed"
<<
endl
;
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