From 997c1e4b251867deedf5f9ee97beea72505ee36f Mon Sep 17 00:00:00 2001 From: Yu Jian Date: Fri, 27 May 2011 12:17:12 +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. In addition, "set_default_debug_nodes()" has a defect to check whether "$nodes" contains the local node or not. The patch contains a fix for that. Signed-off-by: Yu Jian Change-Id: Iae49497601d09fef38968360d8543cc753009e85 Reviewed-on: http://review.whamcloud.com/871 Tested-by: Hudson Reviewed-by: Brian J. Murrell Reviewed-by: Chris Gearing Reviewed-by: Johann Lombardi --- lustre/tests/recovery-small.sh | 4 +++- lustre/tests/test-framework.sh | 23 ++++++++++++++--------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/lustre/tests/recovery-small.sh b/lustre/tests/recovery-small.sh index e3558c1..0ad3f8e 100755 --- a/lustre/tests/recovery-small.sh +++ b/lustre/tests/recovery-small.sh @@ -673,7 +673,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 ecd283e..ab4d286 100644 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -425,20 +425,16 @@ set_default_debug () { sync } -remote_node () { - local node=$1 - [ "$node" != "$(hostname)" ] -} - set_default_debug_nodes () { local nodes=$1 - if remote_node $nodes; then - do_rpc_nodes $nodes set_default_debug \ - \\\"$PTLDEBUG\\\" \\\"$SUBSYSTEM\\\" $DEBUG_SIZE - else + if [[ ,$nodes, = *,$HOSTNAME,* ]]; then + nodes=$(exclude_items_from_list "$nodes" "$HOSTNAME") set_default_debug fi + + [[ -n $nodes ]] && do_rpc_nodes $nodes set_default_debug \ + \\\"$PTLDEBUG\\\" \\\"$SUBSYSTEM\\\" $DEBUG_SIZE || true } set_default_debug_facet () { @@ -1562,6 +1558,8 @@ change_active() { # save the active host for this facet local activevar=${facet}active echo "$activevar=${!activevar}" > $TMP/$activevar + [[ $facet = mds ]] && combined_mgs_mds && \ + echo "mgsactive=${!activevar}" > $TMP/mgsactive local TO=`facet_active_host $facet` echo "Failover $facet to $TO" done @@ -1680,6 +1678,7 @@ add() { # make sure its not already running stop ${facet} -f rm -f $TMP/${facet}active + [[ $facet = mds ]] && combined_mgs_mds && rm -f $TMP/mgsactive do_facet ${facet} $MKFS $* } @@ -1725,6 +1724,7 @@ stopall() { # currently we use do_facet mds in local.sh stop mds -f rm -f ${TMP}/mdsactive + combined_mgs_mds && rm -f $TMP/mgsactive for num in `seq $OSTCOUNT`; do stop ost$num -f rm -f $TMP/ost${num}active @@ -2930,6 +2930,11 @@ ostuuid_from_index() $LFS osts $2 | awk '/^'$1'/ { print $2 }' } +remote_node () { + local node=$1 + [[ $node != $HOSTNAME ]] +} + remote_mds () { remote_node $mds_HOST -- 1.8.3.1