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
bdbaa6b7
Commit
bdbaa6b7
authored
Jun 04, 2004
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed bug in ndb_waiter
parent
9be85440
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
10 deletions
+45
-10
ndb/tools/waiter.cpp
ndb/tools/waiter.cpp
+45
-10
No files found.
ndb/tools/waiter.cpp
View file @
bdbaa6b7
...
@@ -22,6 +22,7 @@
...
@@ -22,6 +22,7 @@
#include <NdbSleep.h>
#include <NdbSleep.h>
#include <getarg.h>
#include <getarg.h>
#include <kernel/ndb_limits.h>
#include <kernel/ndb_limits.h>
#include "../src/common/mgmcommon/LocalConfig.hpp"
#include <NDBT.hpp>
#include <NDBT.hpp>
...
@@ -47,9 +48,43 @@ int main(int argc, const char** argv){
...
@@ -47,9 +48,43 @@ int main(int argc, const char** argv){
arg_printusage
(
args
,
num_args
,
argv
[
0
],
desc
);
arg_printusage
(
args
,
num_args
,
argv
[
0
],
desc
);
return
NDBT_ProgramExit
(
NDBT_WRONGARGS
);
return
NDBT_ProgramExit
(
NDBT_WRONGARGS
);
}
}
char
buf
[
255
];
_hostName
=
argv
[
optind
];
_hostName
=
argv
[
optind
];
// NdbRestarter restarter(_hostName);
if
(
_hostName
==
NULL
){
LocalConfig
lcfg
;
if
(
!
lcfg
.
init
())
{
lcfg
.
printError
();
lcfg
.
printUsage
();
g_err
<<
"Error parsing local config file"
<<
endl
;
return
NDBT_ProgramExit
(
NDBT_FAILED
);
}
for
(
int
i
=
0
;
i
<
lcfg
.
items
;
i
++
)
{
MgmtSrvrId
*
m
=
lcfg
.
ids
[
i
];
switch
(
m
->
type
){
case
MgmId_TCP
:
snprintf
(
buf
,
255
,
"%s:%d"
,
m
->
data
.
tcp
.
remoteHost
,
m
->
data
.
tcp
.
port
);
_hostName
=
buf
;
break
;
case
MgmId_File
:
break
;
default:
break
;
}
if
(
_hostName
!=
NULL
)
break
;
}
if
(
_hostName
==
NULL
)
{
g_err
<<
"No management servers configured in local config file"
<<
endl
;
return
NDBT_ProgramExit
(
NDBT_FAILED
);
}
}
if
(
waitClusterStarted
(
_hostName
)
!=
0
)
if
(
waitClusterStarted
(
_hostName
)
!=
0
)
return
NDBT_ProgramExit
(
NDBT_FAILED
);
return
NDBT_ProgramExit
(
NDBT_FAILED
);
...
@@ -137,15 +172,6 @@ waitClusterStarted(const char* _addr, unsigned int _timeout)
...
@@ -137,15 +172,6 @@ waitClusterStarted(const char* _addr, unsigned int _timeout)
int
_nodes
[
MAX_NDB_NODES
];
int
_nodes
[
MAX_NDB_NODES
];
int
_num_nodes
=
0
;
int
_num_nodes
=
0
;
if
(
getStatus
()
!=
0
)
return
-
1
;
// Collect all nodes into nodes
for
(
size_t
i
=
0
;
i
<
ndbNodes
.
size
();
i
++
){
_nodes
[
i
]
=
ndbNodes
[
i
].
node_id
;
_num_nodes
++
;
}
handle
=
ndb_mgm_create_handle
();
handle
=
ndb_mgm_create_handle
();
if
(
handle
==
NULL
){
if
(
handle
==
NULL
){
g_err
<<
"handle == NULL"
<<
endl
;
g_err
<<
"handle == NULL"
<<
endl
;
...
@@ -158,6 +184,15 @@ waitClusterStarted(const char* _addr, unsigned int _timeout)
...
@@ -158,6 +184,15 @@ waitClusterStarted(const char* _addr, unsigned int _timeout)
return
-
1
;
return
-
1
;
}
}
if
(
getStatus
()
!=
0
)
return
-
1
;
// Collect all nodes into nodes
for
(
size_t
i
=
0
;
i
<
ndbNodes
.
size
();
i
++
){
_nodes
[
i
]
=
ndbNodes
[
i
].
node_id
;
_num_nodes
++
;
}
unsigned
int
attempts
=
0
;
unsigned
int
attempts
=
0
;
unsigned
int
resetAttempts
=
0
;
unsigned
int
resetAttempts
=
0
;
const
unsigned
int
MAX_RESET_ATTEMPTS
=
10
;
const
unsigned
int
MAX_RESET_ATTEMPTS
=
10
;
...
...
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