Whamcloud - gitweb
b=19143
authorgrev <grev>
Mon, 4 May 2009 12:34:16 +0000 (12:34 +0000)
committergrev <grev>
Mon, 4 May 2009 12:34:16 +0000 (12:34 +0000)
i=Robert.Read
t-f pri-facet sec-facet different devs names fix

lustre/tests/cfg/local.sh
lustre/tests/test-framework.sh

index 71dc57d..7b1f550 100644 (file)
@@ -15,6 +15,8 @@ MDSDEV=${MDSDEV:-$TMP/${FSNAME}-mdt}
 MDSSIZE=${MDSSIZE:-400000}
 MDSOPT=${MDSOPT:-"--mountfsoptions=acl"}
 
+mdsfailover_dev=${mdsfailover_dev:-$MDSDEV}
+
 OSTCOUNT=${OSTCOUNT:-2}
 OSTDEVBASE=${OSTDEVBASE:-$TMP/${FSNAME}-ost}
 OSTSIZE=${OSTSIZE:-300000}
index 332df64..b76a73b 100644 (file)
@@ -297,7 +297,7 @@ unload_modules() {
 mount_facet() {
     local facet=$1
     shift
-    local dev=${facet}_dev
+    local dev=$(facet_active $facet)_dev
     local opt=${facet}_opt
     echo "Starting ${facet}: ${!opt} $@ ${!dev} ${MOUNT%/*}/${facet}"
     do_facet ${facet} mount -t lustre ${!opt} $@ ${!dev} ${MOUNT%/*}/${facet}
@@ -321,12 +321,20 @@ mount_facet() {
 
 # start facet device options
 start() {
-    facet=$1
+    local facet=$1
     shift
-    device=$1
+    local device=$1
     shift
     eval export ${facet}_dev=${device}
     eval export ${facet}_opt=\"$@\"
+
+    local varname=${facet}failover_dev
+    if [ -n "${!varname}" ] ; then
+        eval export ${facet}failover_dev=${!varname}
+    else
+        eval export ${facet}failover_dev=$device
+    fi
+
     do_facet ${facet} mkdir -p ${MOUNT%/*}/${facet}
     mount_facet ${facet}
     RC=$?
@@ -847,7 +855,7 @@ wait_update () {
 wait_update_facet () {
     local facet=$1
     shift
-    wait_update  $(facet_host $facet) "$@"
+    wait_update  $(facet_active_host $facet) "$@"
 }
 
 wait_delete_completed () {
@@ -1158,17 +1166,17 @@ facet_active_host() {
 
 change_active() {
     local facet=$1
-    failover=${facet}failover
+    local failover=${facet}failover
     host=`facet_host $failover`
     [ -z "$host" ] && return
-    curactive=`facet_active $facet`
+    local curactive=`facet_active $facet`
     if [ -z "${curactive}" -o "$curactive" == "$failover" ] ; then
         eval export ${facet}active=$facet
     else
         eval export ${facet}active=$failover
     fi
     # save the active host for this facet
-    activevar=${facet}active
+    local activevar=${facet}active
     echo "$activevar=${!activevar}" > $TMP/$activevar
 }
 
@@ -1230,9 +1238,9 @@ do_nodes() {
 }
 
 do_facet() {
-    facet=$1
+    local facet=$1
     shift
-    HOST=`facet_active_host $facet`
+    local HOST=`facet_active_host $facet`
     [ -z $HOST ] && echo No host defined for facet ${facet} && exit 1
     do_node $HOST "$@"
 }
@@ -1352,7 +1360,9 @@ setupall() {
         start mds $MDSDEV $MDS_MOUNT_OPTS
         # We started mds, now we should set failover variable properly.
         # Set mdsfailover_HOST if it is not set (the default failnode).
-        mdsfailover_HOST=$(facet_host mds)
+        if [ -z "$mdsfailover_HOST" ]; then
+           mdsfailover_HOST=$(facet_host mds)
+        fi
 
         for num in `seq $OSTCOUNT`; do
             DEVNAME=`ostdevname $num`
@@ -1403,6 +1413,14 @@ init_facet_vars () {
     if [ -z "${!varname}" ]; then
        eval $varname=$(facet_host $facet)
     fi
+
+    # ${facet}failover_dev is set in cfg file
+    varname=${facet}failover_dev
+    if [ -n "${!varname}" ] ; then
+        eval export ${facet}failover_dev=${!varname}
+    else
+        eval export ${facet}failover_dev=$device
+    fi
 }
 
 init_facets_vars () {