df -P $DIR || df -P $DIR || true # reconnect
wait_recovery_complete $SINGLEMDS || error "MDS recovery not done"
- # FIXME just because recovery is done doesn't mean we've finished
- # orphan cleanup. Fake it with a sleep for now...
- sleep 10
+ # just because recovery is done doesn't mean we've finished
+ # orphan cleanup. Wait for llogs to get synchronized.
+ echo waiting for orphan cleanup...
+ while [ true ]; do
+ local -a sync=($(do_facet ost "$LCTL get_param obdfilter.*.mds_sync" | awk -F= ' {print $2}'))
+ local con=1
+ for ((i=0; i<${#sync[@]}; i++)); do
+ [ ${sync[$i]} -eq 0 ] && continue
+ # there is a not finished MDS-OST synchronization
+ con=0
+ break;
+ done
+ [ ${con} -eq 1 ] && break
+ sleep 1
+ done
+
+ # let the statfs cache to get old enough.
+ sleep 1
+
AFTERUSED=`df -P $DIR | tail -1 | awk '{ print $3 }'`
log "before $BEFOREUSED, after $AFTERUSED"
[ $AFTERUSED -gt $((BEFOREUSED + 20)) ] && \
# Increment the number of failovers
NUM_FAILOVERS=$((NUM_FAILOVERS+1))
log "$TESTNAME fail mds1 $NUM_FAILOVERS times"
- facet_failover $SINGLEMDS
+ fail $SINGLEMDS
CURRENT_TS=$(date +%s)
ELAPSED=$((CURRENT_TS - START_TS))
done
# bug 18554
test_74() {
stop ost1
- zconf_umount $(hostname) $MOUNT
- fail $SINGLEMDS
- zconf_mount $(hostname) $MOUNT
+ zconf_umount_clients $CLIENTS $MOUNT
+ facet_failover $SINGLEMDS
+ zconf_mount_clients $CLIENTS $MOUNT
mount_facet ost1
touch $DIR/$tfile || return 1
rm $DIR/$tfile || return 2
- df $MOUNT || error "df failed: $?"
+ client_df || error "df failed: $?"
return 0
}
run_test 74 "Ensure applications don't fail waiting for OST reocvery"