1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

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

This commit is contained in:
msvensson@neptunus.(none)
2006-06-10 21:47:25 +02:00
parent da9d2e3270
commit d13d9dec55

View File

@ -1026,10 +1026,13 @@ sub command_line_setup () {
{ {
for ( my $idx= 0; $idx < $cluster->{'nodes'}; $idx++ ) for ( my $idx= 0; $idx < $cluster->{'nodes'}; $idx++ )
{ {
my $nodeid= $idx+1;
$cluster->{'ndbds'}->[$idx]= $cluster->{'ndbds'}->[$idx]=
{ {
pid => 0, 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, "--nodaemon");
mtr_add_arg($args, "$extra_args"); 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, "", $pid= mtr_spawn($exe_ndbd, $args, "",
$path_ndbd_log, $path_ndbd_log,
$path_ndbd_log, $path_ndbd_log,
@ -2355,9 +2359,10 @@ sub restore_installed_db ($) {
# forcing a clean start of ndb # forcing a clean start of ndb
foreach my $cluster (@{$clusters}) 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'}" );
} }
} }
} }