Commit f8c3312c authored by unknown's avatar unknown

Cacluate nodeid and ndb_fs path when initializing ndbds, to be used when...

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


parent 61a59626
...@@ -1026,10 +1026,13 @@ sub command_line_setup () { ...@@ -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 ($$$) { ...@@ -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 ($) { ...@@ -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'}" );
} }
} }
} }
......
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