Commit 946f0c83 authored by unknown's avatar unknown

Wait until first mysqld in slave cluster has created cluster/apply_status.ndb,...

Wait until first mysqld in slave cluster has created cluster/apply_status.ndb, put workaround in function workaround_hang_in_select
Add verbose printouts


mysql-test/lib/mtr_process.pl:
  Add verbose printouts
mysql-test/mysql-test-run.pl:
  Wait until first mysqld in slave cluster has created cluster/apply_status.ndb, put workaround in function workaround_hang_in_select
parent fe7751cb
...@@ -539,6 +539,7 @@ sub mtr_check_stop_servers ($) { ...@@ -539,6 +539,7 @@ sub mtr_check_stop_servers ($) {
$ret_pid= waitpid($srv->{'pid'},&WNOHANG); $ret_pid= waitpid($srv->{'pid'},&WNOHANG);
if ($ret_pid == $srv->{'pid'}) if ($ret_pid == $srv->{'pid'})
{ {
mtr_verbose("Catched exit of process $ret_pid");
$srv->{'pid'}= 0; $srv->{'pid'}= 0;
} }
else else
...@@ -754,7 +755,7 @@ sub mtr_ping_with_timeout($) { ...@@ -754,7 +755,7 @@ sub mtr_ping_with_timeout($) {
$res= 1; # We are optimistic $res= 1; # We are optimistic
if ( $srv->{'pid'} and mtr_ping_port($srv->{'port'}) ) if ( $srv->{'pid'} and mtr_ping_port($srv->{'port'}) )
{ {
mtr_report("waiting for process $srv->{'pid'} to stop ". mtr_verbose("waiting for process $srv->{'pid'} to stop ".
"using port $srv->{'port'}"); "using port $srv->{'port'}");
# Millisceond sleep emulated with select # Millisceond sleep emulated with select
......
...@@ -1655,7 +1655,7 @@ sub ndb_mgmd_start ($) { ...@@ -1655,7 +1655,7 @@ sub ndb_mgmd_start ($) {
mtr_add_arg($args, "--config-file=%s", "$cluster->{'data_dir'}/config.ini"); mtr_add_arg($args, "--config-file=%s", "$cluster->{'data_dir'}/config.ini");
my $path_ndb_mgmd_log= "$opt_vardir/log/$cluster->{'name'}_ndb_mgmd.log"; my $path_ndb_mgmd_log= "$opt_vardir/log/\l$cluster->{'name'}_ndb_mgmd.log";
$pid= mtr_spawn($exe_ndb_mgmd, $args, "", $pid= mtr_spawn($exe_ndb_mgmd, $args, "",
$path_ndb_mgmd_log, $path_ndb_mgmd_log,
$path_ndb_mgmd_log, $path_ndb_mgmd_log,
...@@ -1686,7 +1686,7 @@ sub ndbd_start ($$$) { ...@@ -1686,7 +1686,7 @@ sub ndbd_start ($$$) {
mtr_add_arg($args, "$extra_args"); mtr_add_arg($args, "$extra_args");
my $path_ndbd_log= "$opt_vardir/log/$cluster->{'name'}_ndbd_$idx.log"; my $path_ndbd_log= "$opt_vardir/log/\l$cluster->{'name'}_ndbd_$idx.log";
$pid= mtr_spawn($exe_ndbd, $args, "", $pid= mtr_spawn($exe_ndbd, $args, "",
$path_ndbd_log, $path_ndbd_log,
$path_ndbd_log, $path_ndbd_log,
...@@ -3082,6 +3082,24 @@ sub run_testcase_stop_servers($) { ...@@ -3082,6 +3082,24 @@ sub run_testcase_stop_servers($) {
} }
} }
sub workaround_hang_in_select($$) {
my $tinfo= shift;
my $mysqld= shift;
# Wait until mysqld has started and created apply_status table
# FIXME this is a workaround for mysqld not being able to shutdown
# before having connected to ndb_mgmd
if ( ! sleep_until_file_created("$mysqld->{'path_myddir'}/cluster/apply_status.ndb",
$mysqld->{'start_timeout'},
$mysqld->{'pid'}))
{
mtr_report("Failed to create 'cluster/apply_status' table");
report_failure_and_restart($tinfo);
return;
}
}
sub run_testcase_start_servers($) { sub run_testcase_start_servers($) {
my $tinfo= shift; my $tinfo= shift;
...@@ -3178,19 +3196,15 @@ sub run_testcase_start_servers($) { ...@@ -3178,19 +3196,15 @@ sub run_testcase_start_servers($) {
if ( $clusters->[0]->{'pid'} and $master->[1]->{'pid'} ) if ( $clusters->[0]->{'pid'} and $master->[1]->{'pid'} )
{ {
# Test needs cluster, extra mysqld started # Test needs cluster, extra mysqld started
# Wait until it has started and created apply_status table workaround_hang_in_select($tinfo, $master->[1]);
# FIXME this is a workaround for mysqld not being able to shutdown }
# before having connected to ndb_mgmd
if ( ! sleep_until_file_created( if ( $tinfo->{'slave_num'} and
"$master->[1]->{'path_myddir'}/cluster/apply_status.ndb", $clusters->[0]->{'pid'} and
$master->[1]->{'start_timeout'}, $slave->[0]->{'pid'} )
$master->[1]->{'pid'})) {
{ # Slaves are started, test needs cluster, slave mysqld started
mtr_report("Failed to create 'cluster/apply_status' table"); workaround_hang_in_select($tinfo, $slave->[0]);
report_failure_and_restart($tinfo);
return;
}
} }
} }
......
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