Whamcloud - gitweb
LU-372 add $TMP/mgsactive to indicate the active combined MGS/MDS node
authorYu Jian <yujian@whamcloud.com>
Wed, 8 Jun 2011 13:23:32 +0000 (21:23 +0800)
committerOleg Drokin <green@whamcloud.com>
Wed, 27 Jul 2011 15:56:34 +0000 (11:56 -0400)
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 <yujian@whamcloud.com>
Change-Id: I74bbf9293f9a290573c4b9fcbf9fea0fcc0aad95
Reviewed-on: http://review.whamcloud.com/913
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Brian J. Murrell <brian@whamcloud.com>
Reviewed-by: Chris Gearing <chris@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/recovery-small.sh
lustre/tests/test-framework.sh

index ea53069..36f8c82 100755 (executable)
@@ -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
index a28f1f6..aa0e463 100644 (file)
@@ -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