From 07d01fce91f2412322b94e2fd2b021689fc0c035 Mon Sep 17 00:00:00 2001 From: Yu Jian Date: Wed, 8 Jun 2011 21:23:32 +0800 Subject: [PATCH] LU-372 add $TMP/mgsactive to indicate the active combined MGS/MDS node The current test-framework could not figure out the active MGS node correctly while the MGS and MDS nodes are combined under a failover configuration. We need add a $TMP/mgsactive file to indicate the active MGS node like what we did for the MDS node. Signed-off-by: Yu Jian Change-Id: I74bbf9293f9a290573c4b9fcbf9fea0fcc0aad95 Reviewed-on: http://review.whamcloud.com/913 Tested-by: Hudson Tested-by: Maloo Reviewed-by: Brian J. Murrell Reviewed-by: Chris Gearing Reviewed-by: Oleg Drokin --- lustre/tests/recovery-small.sh | 4 +++- lustre/tests/test-framework.sh | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lustre/tests/recovery-small.sh b/lustre/tests/recovery-small.sh index ea53069..36f8c82 100755 --- a/lustre/tests/recovery-small.sh +++ b/lustre/tests/recovery-small.sh @@ -644,7 +644,9 @@ wait_client_evicted () { local exports=$2 local varsvc=${facet}_svc - wait_update $(facet_host $facet) "lctl get_param -n *.${!varsvc}.num_exports | cut -d' ' -f2" $((exports - 1)) $3 + wait_update $(facet_active_host $facet) \ + "lctl get_param -n *.${!varsvc}.num_exports | cut -d' ' -f2" \ + $((exports - 1)) $3 } test_26a() { # was test_26 bug 5921 - evict dead exports by pinger diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index a28f1f6..aa0e463 100644 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -1711,6 +1711,8 @@ change_active() { # save the active host for this facet local activevar=${facet}active echo "$activevar=${!activevar}" > $TMP/$activevar + [[ $facet = mds1 ]] && combined_mgs_mds && \ + echo "mgsactive=${!activevar}" > $TMP/mgsactive local TO=`facet_active_host $facet` echo "Failover $facet to $TO" done @@ -1840,6 +1842,7 @@ add() { # make sure its not already running stop ${facet} -f rm -f $TMP/${facet}active + [[ $facet = mds1 ]] && combined_mgs_mds && rm -f $TMP/mgsactive do_facet ${facet} $MKFS $* } @@ -1861,6 +1864,8 @@ mdsdevname() { facet_mntpt () { local facet=$1 + [[ $facet = mgs ]] && combined_mgs_mds && facet="mds1" + local var=${facet}_MOUNT eval mntpt=${!var:-${MOUNT%/*}/$facet} @@ -1892,6 +1897,7 @@ stopall() { stop mds$num -f rm -f ${TMP}/mds${num}active done + combined_mgs_mds && rm -f $TMP/mgsactive for num in `seq $OSTCOUNT`; do stop ost$num -f -- 1.8.3.1