Whamcloud - gitweb
LU-10997 build: add files to .gitignore
[fs/lustre-release.git] / lustre / tests / lfsck-performance.sh
index 3b6cc7d..dc873bf 100644 (file)
@@ -90,7 +90,7 @@ lfsck_create() {
 
 lfsck_cleanup() {
        do_rpc_nodes $(facet_active_host $SINGLEMDS) unload_modules
-       formatall
+       REFORMAT="yes" cleanup_and_setup_lustre
 }
 
 lfsck_create_nfiles() {
@@ -131,16 +131,20 @@ lfsck_create_nfiles() {
 
 build_test_filter
 
+format_start_mgs () {
+       do_rpc_nodes $(facet_active_host mgs) load_modules_local
+       format_mgs
+       start mgs $(mgsdevname) $MGS_MOUNT_OPTS
+}
+
 test_0() {
        local BCOUNT=0
        local i
 
        stopall
+       combined_mgs_mds || format_start_mgs
        do_rpc_nodes $(facet_active_host $SINGLEMDS) load_modules_local
-       reformat_external_journal
-       add ${SINGLEMDS} $(mkfs_opts ${SINGLEMDS} ${MDT_DEVNAME}) --backfstype \
-               $(facet_fstype ${SINGLEMDS}) --reformat ${MDT_DEVNAME} \
-               $(mdsvdevname 1) >/dev/null || error "Fail to reformat the MDS!"
+       format_mdt $(facet_number $SINGLEMDS)
 
        for ((i = $MINCOUNT; i <= $MAXCOUNT; i = $((i * FACTOR)))); do
                local nfiles=$((i - BCOUNT))
@@ -170,6 +174,7 @@ test_0() {
                echo "lfsck_namespace speed is ${SPEED}/sec"
                stop ${SINGLEMDS} > /dev/null || error "Fail to stop MDS!"
        done
+       combined_mgs_mds || stop mgs
 }
 run_test 0 "lfsck namespace performance (routine case) without load"
 
@@ -181,11 +186,9 @@ test_1() {
        local i
 
        stopall
+       combined_mgs_mds || format_start_mgs
        do_rpc_nodes $(facet_active_host $SINGLEMDS) load_modules_local
-       reformat_external_journal
-       add ${SINGLEMDS} $(mkfs_opts ${SINGLEMDS} ${MDT_DEVNAME}) --backfstype \
-               $(facet_fstype ${SINGLEMDS}) --reformat ${MDT_DEVNAME} \
-               $(mdsvdevname 1) > /dev/null || error "Fail to reformat the MDS"
+       format_mdt $(facet_number $SINGLEMDS)
 
        for ((i = $MINCOUNT_REPAIR; i <= $MAXCOUNT_REPAIR;
              i = $((i * FACTOR)))); do
@@ -226,6 +229,7 @@ test_1() {
                echo "lfsck_namespace speed is ${SPEED}/sec"
                stop ${SINGLEMDS} > /dev/null || error "Fail to stop MDS!"
        done
+       combined_mgs_mds || stop mgs
 }
 run_test 1 "lfsck namespace performance (backup/restore) without load"
 
@@ -235,12 +239,9 @@ test_2() {
        for ((i = $MINCOUNT_REPAIR; i <= $MAXCOUNT_REPAIR;
              i = $((i * FACTOR)))); do
                stopall
+               combined_mgs_mds || format_start_mgs
                do_rpc_nodes $(facet_active_host $SINGLEMDS) load_modules_local
-               reformat_external_journal
-               add ${SINGLEMDS} $(mkfs_opts ${SINGLEMDS} ${MDT_DEVNAME}) \
-                       --backfstype $(facet_fstype ${SINGLEMDS}) --reformat \
-                       ${MDT_DEVNAME} $(mdsvdevname 1) > /dev/null ||
-                       error "Fail to reformat the MDS!"
+               format_mdt $(facet_number $SINGLEMDS)
 
                echo "+++ start to create for ${i} files set at: $(date) +++"
                lfsck_create_nfiles ${i} 0 ${NTHREADS} 1 ||
@@ -266,6 +267,7 @@ test_2() {
                echo "lfsck_namespace speed is ${SPEED}/sec"
                stop ${SINGLEMDS} > /dev/null || error "Fail to stop MDS!"
        done
+       combined_mgs_mds || stop mgs
 }
 run_test 2 "lfsck namespace performance (upgrade from 1.8) without load"
 
@@ -277,11 +279,9 @@ test_3() {
        local i
 
        stopall
+       combined_mgs_mds || format_start_mgs
        do_rpc_nodes $(facet_active_host $SINGLEMDS) load_modules_local
-       reformat_external_journal
-       add ${SINGLEMDS} $(mkfs_opts ${SINGLEMDS} ${MDT_DEVNAME}) --backfstype \
-               $(facet_fstype ${SINGLEMDS}) --reformat ${MDT_DEVNAME} \
-               $(mdsvdevname 1) > /dev/null || error "Fail to reformat the MDS"
+       format_mdt $(facet_number $SINGLEMDS)
 
        for ((i = $inc_count; i <= $BASE_COUNT; i = $((i + inc_count)))); do
                local nfiles=$((i - BCOUNT))
@@ -351,6 +351,7 @@ test_3() {
        lfsck_create_nfiles ${nfiles} ${BCOUNT} ${NTHREADS} ||
                error "Fail to create files!"
        echo "+++ end to create for ${i} files set at: $(date) +++"
+       combined_mgs_mds || stop mgs
 }
 run_test 3 "lfsck namespace impact on create performance"
 
@@ -793,7 +794,7 @@ namespace_gen_one() {
        echo "Creating $count 2-striped sub-dirs under $show_dir," \
                "and 4 regular files under each striped sub-dir at: $(date)"
        for ((m = 0; m < $count; m++)); do
-               $LFS setdirstripe -i ${idx1} -c 2 -t all_char \
+               $LFS setdirstripe -i ${idx1} -c 2 -H all_char \
                        $work_dir/d_s_${m} || {
                        error_noexit \
                        "(27) Fail to make striped-dir $work_dir/d_s_${m}"
@@ -931,8 +932,7 @@ test_7c() {
 run_test 7c "namespace LFSCK performance (repairing bad FID-in-dirent) for DNE"
 
 test_8() {
-       [ $MDSCOUNT -lt 2 ] &&
-               skip "We need at least 2 MDSes for this test" && return
+       [ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs" && return
 
        [ $INCFACTOR -gt 25 ] && INCFACTOR=25
 
@@ -1041,4 +1041,5 @@ run_test 8 "lfsck namespace impact on create performance"
 # cleanup the system at last
 lfsck_cleanup
 complete $SECONDS
+check_and_cleanup_lustre
 exit_status