Whamcloud - gitweb
LU-5407 test: wait MGC import to finish recovery 92/14792/6
authorHongchao Zhang <hongchao.zhang@intel.com>
Sat, 18 Apr 2015 20:56:35 +0000 (04:56 +0800)
committerAndreas Dilger <andreas.dilger@intel.com>
Tue, 26 May 2015 17:34:55 +0000 (17:34 +0000)
in test_58c of replay_single.sh, the MGS is failed over with MDS
by the above subtest "test_58b", and the import of MGC could not
detect it yet, then causes the second Lustre mount to be failed.

this patch also remove test 58c from ALWAYS_EXCEPT list of ZFS

Change-Id: I7311e122964d6d8e14fa4327ed3ad936ac4ef59b
Signed-off-by: Hongchao Zhang <hongchao.zhang@intel.com>
Reviewed-on: http://review.whamcloud.com/14792
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
lustre/tests/replay-single.sh
lustre/tests/test-framework.sh

index 2f34c50..68d88e1 100755 (executable)
@@ -29,8 +29,8 @@ ALWAYS_EXCEPT="                 61d   $REPLAY_SINGLE_EXCEPT"
 [ "$SLOW" = "no" ] && EXCEPT_SLOW="1 2 3 4 6 12 16 44a      44b    65 66 67 68"
 
 [ $(facet_fstype $SINGLEMDS) = "zfs" ] &&
-# bug number for skipped test:        LU-1867  LU-3127 LU-5407
-       ALWAYS_EXCEPT="$ALWAYS_EXCEPT 89        73b     58c"
+# bug number for skipped test:        LU-1867  LU-3127
+       ALWAYS_EXCEPT="$ALWAYS_EXCEPT 89        73b"
 
 build_test_filter
 
@@ -1541,24 +1541,28 @@ test_58b() {
        rm -f $DIR/$tdir/$tfile
        rmdir $DIR/$tdir
        cleanup_58
+       wait_clients_import_state ${CLIENTS:-$HOSTNAME} "mgs" FULL
 }
 run_test 58b "test replay of setxattr op"
 
 test_58c() { # bug 16570
-    local orig
-    local orig1
-    local new
-
-    trap cleanup_58 EXIT
-
-    if large_xattr_enabled; then
-        local xattr_size=$(max_xattr_size)
-        orig="$(generate_string $((xattr_size / 2)))"
-        orig1="$(generate_string $xattr_size)"
-    else
-        orig="bar"
-        orig1="bar1"
-    fi
+       local orig
+       local orig1
+       local new
+
+       trap cleanup_58 EXIT
+
+       if large_xattr_enabled; then
+               local xattr_size=$(max_xattr_size)
+               orig="$(generate_string $((xattr_size / 2)))"
+               orig1="$(generate_string $xattr_size)"
+       else
+               orig="bar"
+               orig1="bar1"
+       fi
+
+       # PING_INTERVAL max(obd_timeout / 4, 1U)
+       sleep $((TIMEOUT / 4))
 
        mount_client $MOUNT2
        mkdir $DIR/$tdir || error "mkdir $DIR/$tdir failed"
index c90d3dc..fda3034 100755 (executable)
@@ -5938,6 +5938,10 @@ get_clientmdc_proc_path() {
     echo "${1}-mdc-*"
 }
 
+get_clientmgc_proc_path() {
+    echo "*"
+}
+
 do_rpc_nodes () {
        local list=$1
        shift
@@ -5952,28 +5956,34 @@ do_rpc_nodes () {
 }
 
 wait_clients_import_state () {
-    local list=$1
-    local facet=$2
-    local expected=$3
+       local list=$1
+       local facet=$2
+       local expected=$3
 
-    local facets=$facet
+       local facets=$facet
 
-    if [ "$FAILURE_MODE" = HARD ]; then
-        facets=$(facets_on_host $(facet_active_host $facet))
-    fi
+       if [ "$FAILURE_MODE" = HARD ]; then
+               facets=$(facets_on_host $(facet_active_host $facet))
+       fi
 
-    for facet in ${facets//,/ }; do
-    local label=$(convert_facet2label $facet)
-    local proc_path
-    case $facet in
-        ost* ) proc_path="osc.$(get_clientosc_proc_path $label).ost_server_uuid" ;;
-        mds* ) proc_path="mdc.$(get_clientmdc_proc_path $label).mds_server_uuid" ;;
-        *) error "unknown facet!" ;;
-    esac
-    local params=$(expand_list $params $proc_path)
-    done
+       for facet in ${facets//,/ }; do
+               local label=$(convert_facet2label $facet)
+               local proc_path
+               case $facet in
+               ost* ) proc_path="osc.$(get_clientosc_proc_path \
+                                 $label).ost_server_uuid" ;;
+               mds* ) proc_path="mdc.$(get_clientmdc_proc_path \
+                                 $label).mds_server_uuid" ;;
+               mgs* ) proc_path="mgc.$(get_clientmgc_proc_path \
+                                 $label).mgs_server_uuid" ;;
+               *) error "unknown facet!" ;;
+               esac
+
+               local params=$(expand_list $params $proc_path)
+       done
 
-       if ! do_rpc_nodes "$list" wait_import_state_mount $expected $params; then
+       if ! do_rpc_nodes "$list" wait_import_state_mount $expected $params;
+       then
                error "import is not in ${expected} state"
                return 1
        fi