Commit aace9afb authored by unknown's avatar unknown

Add extra parameter to 'ndbcluster_wait_started' so it can be used to wait...

Add extra parameter to 'ndbcluster_wait_started' so it can be used to wait until ndb_mgmd has started


parent 0224c9de
...@@ -348,7 +348,7 @@ sub check_ndbcluster_support (); ...@@ -348,7 +348,7 @@ sub check_ndbcluster_support ();
sub rm_ndbcluster_tables ($); sub rm_ndbcluster_tables ($);
sub ndbcluster_start_install ($); sub ndbcluster_start_install ($);
sub ndbcluster_start ($$); sub ndbcluster_start ($$);
sub ndbcluster_wait_started ($); sub ndbcluster_wait_started ($$);
sub mysqld_wait_started($); sub mysqld_wait_started($);
sub run_benchmarks ($); sub run_benchmarks ($);
sub initialize_servers (); sub initialize_servers ();
...@@ -1669,19 +1669,29 @@ sub ndbcluster_start_install ($) { ...@@ -1669,19 +1669,29 @@ sub ndbcluster_start_install ($) {
} }
sub ndbcluster_wait_started($){ sub ndbcluster_wait_started($$){
my $cluster= shift; my $cluster= shift;
my $ndb_waiter_extra_opt= shift;
my $path_waiter_log= "$cluster->{'data_dir'}/ndb_waiter.log"; my $path_waiter_log= "$cluster->{'data_dir'}/ndb_waiter.log";
my $args;
mtr_init_args(\$args);
mtr_add_arg($args, "--no-defaults");
mtr_add_arg($args, "--core");
mtr_add_arg($args, "--ndb-connectstring=%s", $cluster->{'connect_string'});
mtr_add_arg($args, "--timeout=60");
if ($ndb_waiter_extra_opt)
{
mtr_add_arg($args, "$ndb_waiter_extra_opt");
}
# Start the ndb_waiter which will connect to the ndb_mgmd # Start the ndb_waiter which will connect to the ndb_mgmd
# and poll it for state of the ndbd's, will return when # and poll it for state of the ndbd's, will return when
# all nodes in the cluster is started # all nodes in the cluster is started
my $res= mtr_run($exe_ndb_waiter, my $res= mtr_run($exe_ndb_waiter, $args,
["--no-defaults", "", $path_waiter_log, $path_waiter_log, "");
"--core",
"--ndb-connectstring=$cluster->{'connect_string'}",
"--timeout=60"],
"", $path_waiter_log, $path_waiter_log, "");
mtr_verbose("ndbcluster_wait_started, returns: $res") if $res; mtr_verbose("ndbcluster_wait_started, returns: $res") if $res;
return $res; return $res;
} }
...@@ -1722,19 +1732,16 @@ sub ndb_mgmd_start ($) { ...@@ -1722,19 +1732,16 @@ sub ndb_mgmd_start ($) {
# FIXME Should not be needed # FIXME Should not be needed
# Unfortunately the cluster nodes will fail to start # Unfortunately the cluster nodes will fail to start
# if ndb_mgmd has not started properly # if ndb_mgmd has not started properly
sleep(1); while (ndbcluster_wait_started($cluster, "--no-contact"))
{
# if (!sleep_until_file_created($cluster->{'path_pid'}, select(undef, undef, undef, 0.1);
# 30, # Seconds }
# $pid))
# {
# mtr_warning("Failed to start ndb_mgd for $cluster->{'name'} cluster");
# return 1;
# }
# Remember pid of ndb_mgmd # Remember pid of ndb_mgmd
$cluster->{'pid'}= $pid; $cluster->{'pid'}= $pid;
mtr_verbose("ndb_mgmd_start, pid: $pid");
return $pid; return $pid;
} }
...@@ -1991,11 +1998,10 @@ sub mysql_install_db () { ...@@ -1991,11 +1998,10 @@ sub mysql_install_db () {
$cluster->{'installed_ok'}= "YES"; # Assume install suceeds $cluster->{'installed_ok'}= "YES"; # Assume install suceeds
if (ndbcluster_wait_started($cluster)) if (ndbcluster_wait_started($cluster, ""))
{ {
# failed to install, disable usage and flag that its no ok # failed to install, disable usage and flag that its no ok
mtr_report("ndbcluster_install of $cluster->{'name'} failed, " . mtr_report("ndbcluster_install of $cluster->{'name'} failed");
"continuing without it");
$cluster->{"installed_ok"}= "NO"; $cluster->{"installed_ok"}= "NO";
$cluster_started_ok= 0; $cluster_started_ok= 0;
...@@ -3314,7 +3320,7 @@ sub run_testcase_start_servers($) { ...@@ -3314,7 +3320,7 @@ sub run_testcase_start_servers($) {
next if !$cluster->{'pid'}; next if !$cluster->{'pid'};
if (ndbcluster_wait_started($cluster)) if (ndbcluster_wait_started($cluster, ""))
{ {
# failed to start # failed to start
mtr_report("Start of $cluster->{'name'} cluster failed, "); mtr_report("Start of $cluster->{'name'} cluster failed, ");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment