mirror of
https://github.com/MariaDB/server.git
synced 2025-09-11 05:52:26 +03:00
adopting mysql-test-run to new ndb config
+ added option to ndb_waiter to wait for NO CONTACT mysql-test/mysql-test-run.sh: adopting mysql-test-run to new ndb config mysql-test/ndb/ndbcluster.sh: adopting mysql-test-run to new ndb config ndb/tools/waiter.cpp: added option to wait for NO CONTACT
This commit is contained in:
@@ -27,16 +27,21 @@
|
||||
#include <NDBT.hpp>
|
||||
|
||||
int
|
||||
waitClusterStarted(const char* _addr, unsigned int _timeout= 120);
|
||||
waitClusterStatus(const char* _addr,
|
||||
ndb_mgm_node_status _status= NDB_MGM_NODE_STATUS_STARTED,
|
||||
unsigned int _timeout= 120);
|
||||
|
||||
int main(int argc, const char** argv){
|
||||
|
||||
const char* _hostName = NULL;
|
||||
int _no_contact = 0;
|
||||
int _help = 0;
|
||||
|
||||
struct getargs args[] = {
|
||||
{ "no-contact", 0, arg_flag, &_no_contact, "Wait for cluster no contact", "" },
|
||||
{ "usage", '?', arg_flag, &_help, "Print help", "" }
|
||||
};
|
||||
|
||||
int num_args = sizeof(args) / sizeof(args[0]);
|
||||
int optind = 0;
|
||||
char desc[] =
|
||||
@@ -86,7 +91,10 @@ int main(int argc, const char** argv){
|
||||
}
|
||||
}
|
||||
|
||||
if (waitClusterStarted(_hostName) != 0)
|
||||
if (_no_contact) {
|
||||
if (waitClusterStatus(_hostName, NDB_MGM_NODE_STATUS_NO_CONTACT) != 0)
|
||||
return NDBT_ProgramExit(NDBT_FAILED);
|
||||
} else if (waitClusterStatus(_hostName) != 0)
|
||||
return NDBT_ProgramExit(NDBT_FAILED);
|
||||
|
||||
return NDBT_ProgramExit(NDBT_OK);
|
||||
@@ -164,9 +172,10 @@ getStatus(){
|
||||
}
|
||||
|
||||
int
|
||||
waitClusterStarted(const char* _addr, unsigned int _timeout)
|
||||
waitClusterStatus(const char* _addr,
|
||||
ndb_mgm_node_status _status,
|
||||
unsigned int _timeout)
|
||||
{
|
||||
ndb_mgm_node_status _status = NDB_MGM_NODE_STATUS_STARTED;
|
||||
int _startphase = -1;
|
||||
|
||||
int _nodes[MAX_NDB_NODES];
|
||||
@@ -290,7 +299,7 @@ waitClusterStarted(const char* _addr, unsigned int _timeout)
|
||||
allInState = false;
|
||||
}
|
||||
}
|
||||
g_info << "Waiting for cluster enter state"
|
||||
g_info << "Waiting for cluster enter state "
|
||||
<< ndb_mgm_get_node_status_string(_status)<< endl;
|
||||
NdbSleep_SecSleep(1);
|
||||
attempts++;
|
||||
|
Reference in New Issue
Block a user