Whamcloud - gitweb
LU-482 tests: cleanup clients/OSTs after MDS error
authorAndreas Dilger <adilger@whamcloud.com>
Mon, 4 Jun 2012 03:59:36 +0000 (21:59 -0600)
committerOleg Drokin <green@whamcloud.com>
Sat, 16 Jun 2012 07:20:04 +0000 (03:20 -0400)
If the MDS fails to mount due to LU-482, ensure that the clients
and OSTs are unmounted cleanly.  Otherwise, the normal unmount
will hang on the clients as they wait for the MDS to be recovered.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: Iccd8f81f714974063eaeec45ffbd80f9cef3242b
Reviewed-on: http://review.whamcloud.com/3019
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/replay-dual.sh
lustre/tests/test-framework.sh

index 72b8346..9afcb36 100755 (executable)
@@ -68,8 +68,17 @@ if [ -f "$LU482_FAILED" ]; then
        log "Found check file $LU482_FAILED, aborting test script"
        rm -vf "$LU482_FAILED"
        complete $(basename $0) $SECONDS
-       [ "$MOUNTED2" = yes ] && zconf_umount $HOSTNAME $MOUNT2 || true
-       check_and_cleanup_lustre
+       do_nodes $CLIENTS umount -f $MOUNT2 || true
+       do_nodes $CLIENTS umount -f $MOUNT || true
+       # copied from stopall, but avoid the MDS recovery
+    for num in `seq $OSTCOUNT`; do
+        stop ost$num -f
+        rm -f $TMP/ost${num}active
+    done
+    if ! combined_mgs_mds ; then
+        stop mgs
+    fi
+
        exit_status
 fi
 
index d3a27c9..70435d6 100644 (file)
@@ -672,20 +672,23 @@ mount_facets () {
 }
 
 mount_facet() {
-    local facet=$1
-    shift
-    local dev=$(facet_active $facet)_dev
-    local opt=${facet}_opt
-    local mntpt=$(facet_mntpt $facet)
-
-    echo "Starting ${facet}: ${!opt} $@ ${!dev} $mntpt"
-    do_facet ${facet} "mkdir -p $mntpt; mount -t lustre ${!opt} $@ ${!dev} $mntpt"
-    RC=${PIPESTATUS[0]}
-    # to allow testing LU-482 error handling in mount_facets() and test_0a()
-    [ -f $TMP/test-lu482-trigger ] && RC=2
-    if [ $RC -ne 0 ]; then
-        echo "mount -t lustre $@ ${!dev} $mntpt"
-        echo "Start of ${!dev} on ${facet} failed ${RC}"
+       local facet=$1
+       shift
+       local dev=$(facet_active $facet)_dev
+       local opt=${facet}_opt
+       local mntpt=$(facet_mntpt $facet)
+
+       echo "Starting ${facet}: ${!opt} $@ ${!dev} $mntpt"
+       # for testing LU-482 error handling in mount_facets() and test_0a()
+       if [ -f $TMP/test-lu482-trigger ]; then
+               RC=2
+       else
+               do_facet ${facet} "mkdir -p $mntpt; mount -t lustre ${!opt} \
+                                  $@ ${!dev} $mntpt"
+               RC=${PIPESTATUS[0]}
+       fi
+       if [ $RC -ne 0 ]; then
+               echo "Start of ${!dev} on ${facet} failed ${RC}"
     else
         set_default_debug_facet $facet