From: Bob Glossman Date: Mon, 14 Jan 2013 21:44:26 +0000 (-0800) Subject: LU-2494 tests: add interop support to framework check X-Git-Tag: 2.3.62~53 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=41e53af0690cb4e7b4ff033036663a348d829122 LU-2494 tests: add interop support to framework check Modify the test-framework wait_mds_ost_sync() function to work with mds_sync when old_sync_processed doesn't exist. This should cover both old and new servers. Signed-off-by: Bob Glossman Change-Id: I2e5c430a96ac40a1ca87990696e7daaad5a69102 Reviewed-on: http://review.whamcloud.com/5021 Tested-by: Hudson Tested-by: Maloo Reviewed-by: Jian Yu Reviewed-by: Andreas Dilger --- diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index 4da5ca5..126b44b 100644 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -1897,30 +1897,44 @@ wait_recovery_complete () { } wait_mds_ost_sync () { - # just because recovery is done doesn't mean we've finished - # orphan cleanup. Wait for llogs to get synchronized. - echo "Waiting for orphan cleanup..." - # MAX value includes time needed for MDS-OST reconnection - local MAX=$(( TIMEOUT * 2 )) - local WAIT=0 - while [ $WAIT -lt $MAX ]; do - local -a sync=($(do_nodes $(comma_list $(mdts_nodes)) \ - "$LCTL get_param -n osp.*osc*.old_sync_processed")) - local con=1 - local i - for ((i=0; i<${#sync[@]}; i++)); do - [ ${sync[$i]} -eq 1 ] && continue - # there is a not finished MDS-OST synchronization - con=0 - break; - done - sleep 2 # increase waiting time and cover statfs cache - [ ${con} -eq 1 ] && return 0 - echo "Waiting $WAIT secs for $facet mds-ost sync done." - WAIT=$((WAIT + 2)) - done - echo "$facet recovery not done in $MAX sec. $STATUS" - return 1 + # just because recovery is done doesn't mean we've finished + # orphan cleanup. Wait for llogs to get synchronized. + echo "Waiting for orphan cleanup..." + # MAX value includes time needed for MDS-OST reconnection + local MAX=$(( TIMEOUT * 2 )) + local WAIT=0 + local new_wait=true + local list=$(comma_list $(mdts_nodes)) + local cmd="$LCTL get_param -n osp.*osc*.old_sync_processed" + if ! do_facet $SINGLEMDS \ + "$LCTL list_param osp.*osc*.old_sync_processed 2> /dev/null" + then + # old way, use mds_sync + new_wait=false + list=$(comma_list $(osts_nodes)) + cmd="$LCTL get_param -n obdfilter.*.mds_sync" + fi + while [ $WAIT -lt $MAX ]; do + local -a sync=($(do_nodes $list "$cmd")) + local con=1 + local i + for ((i=0; i<${#sync[@]}; i++)); do + if $new_wait; then + [ ${sync[$i]} -eq 1 ] && continue + else + [ ${sync[$i]} -eq 0 ] && continue + fi + # there is a not finished MDS-OST synchronization + con=0 + break; + done + sleep 2 # increase waiting time and cover statfs cache + [ ${con} -eq 1 ] && return 0 + echo "Waiting $WAIT secs for $facet mds-ost sync done." + WAIT=$((WAIT + 2)) + done + echo "$facet recovery not done in $MAX sec. $STATUS" + return 1 } wait_destroy_complete () {