From ead3853f34395de3f158d3c94efa254449390754 Mon Sep 17 00:00:00 2001 From: Magnus Svensson Date: Sat, 24 Jan 2009 12:18:52 +0100 Subject: [PATCH] WL#4189 mtr.pl v2 - Don't save ndb_*_fs directory after test failure --- mysql-test/mysql-test-run.pl | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 63f57492ba4..b9963ce23aa 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -3632,6 +3632,17 @@ sub save_datadir_after_failure($$) { } +sub remove_ndbfs_from_ndbd_datadir { + my ($ndbd_datadir)= @_; + # Remove the ndb_*_fs directory from ndbd.X/ dir + foreach my $ndbfs_dir ( glob("$ndbd_datadir/ndb_*_fs") ) + { + next unless -d $ndbfs_dir; # Skip if not a directory + rmtree($ndbfs_dir); + } +} + + sub after_failure ($) { my ($tinfo)= @_; @@ -3657,6 +3668,14 @@ sub after_failure ($) { if ( clusters() ) { foreach my $cluster ( clusters() ) { my $cluster_dir= "$opt_vardir/".$cluster->{name}; + + # Remove the fileystem of each ndbd + foreach my $ndbd ( in_cluster($cluster, ndbds()) ) + { + my $ndbd_datadir= $ndbd->value("DataDir"); + remove_ndbfs_from_ndbd_datadir($ndbd_datadir); + } + save_datadir_after_failure($cluster_dir, $save_dir); } }