From d13d9dec55d0094e9daae3c6f946f4a0f3ca7b7b Mon Sep 17 00:00:00 2001 From: "msvensson@neptunus.(none)" <> Date: Sat, 10 Jun 2006 21:47:25 +0200 Subject: [PATCH] Cacluate nodeid and ndb_fs path when initializing ndbds, to be used when defining log files and when removing the ndb_fs after failed test case --- mysql-test/mysql-test-run.pl | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 76ad686cfe6..cadc98b4e6a 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -1026,10 +1026,13 @@ sub command_line_setup () { { for ( my $idx= 0; $idx < $cluster->{'nodes'}; $idx++ ) { + my $nodeid= $idx+1; $cluster->{'ndbds'}->[$idx]= { pid => 0, - path_pid => "$cluster->{'data_dir'}/ndb_{$idx+1}.pid", + nodeid => $nodeid, + path_pid => "$cluster->{'data_dir'}/ndb_${nodeid}.pid", + path_fs => "$cluster->{'data_dir'}/ndb_${nodeid}_fs", }; } } @@ -1697,7 +1700,8 @@ sub ndbd_start ($$$) { mtr_add_arg($args, "--nodaemon"); mtr_add_arg($args, "$extra_args"); - my $path_ndbd_log= "$cluster->{'data_dir'}/ndb_{$idx+1}.log"; + my $nodeid= $cluster->{'ndbds'}->[$idx]->{'nodeid'}; + my $path_ndbd_log= "$cluster->{'data_dir'}/ndb_${nodeid}.log"; $pid= mtr_spawn($exe_ndbd, $args, "", $path_ndbd_log, $path_ndbd_log, @@ -2355,9 +2359,10 @@ sub restore_installed_db ($) { # forcing a clean start of ndb foreach my $cluster (@{$clusters}) { - for ( my $idx= 0; $idx < $cluster->{'nodes'}; $idx++ ) + foreach my $ndbd (@{$cluster->{'ndbds'}}) { - rmtree("$cluster->{'data_dir'}/ndb_{$idx+1}_fs"); + mtr_verbose("$ndbd->{'path_fs'}" ); + rmtree("$ndbd->{'path_fs'}" ); } } }