6 ALWAYS_EXCEPT="$LARGE_SCALE_EXCEPT"
9 PTLDEBUG=${PTLDEBUG:--1}
10 LUSTRE=${LUSTRE:-`dirname $0`/..}
12 CLEANUP=${CLEANUP:-""}
13 . $LUSTRE/tests/test-framework.sh
17 . ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
19 remote_mds_nodsh && log "SKIP: remote MDS with nodsh" && exit 0
21 [ -n "$CLIENTS" ] || { skip_env "$0: Need two or more clients" && exit 0; }
22 [ $CLIENTCOUNT -ge 2 ] || \
23 { skip_env "$0: Need two or more remote clients, have $CLIENTCOUNT" && exit 0; }
26 [ "$SLOW" = "no" ] && EXCEPT_SLOW=""
31 check_and_setup_lustre
32 rm -rf $DIR/[df][0-9]*
34 get_mpiuser_id $MPI_USER
35 MPI_RUNAS=${MPI_RUNAS:-"runas -u $MPI_USER_UID -g $MPI_USER_GID"}
36 $GSS_KRB5 && refresh_krb5_tgt $MPI_USER_UID $MPI_USER_GID $MPI_RUNAS
38 [ "$DAEMONFILE" ] && $LCTL debug_daemon start $DAEMONFILE $DAEMONSIZE
41 assert_env CLIENTS MDSRATE MPIRUN
43 local -a nodes=(${CLIENTS//,/ })
45 # INCREMENT is a number of clients
46 # a half of clients by default
47 increment=${INCREMENT:-$(( CLIENTCOUNT / 2 ))}
49 machinefile=${MACHINEFILE:-$TMP/$(basename $0 .sh).machines}
50 local LOG=$TMP/${TESTSUITE}_$tfile
52 local var=${SINGLEMDS}_svc
53 local procfile="*.${!var}.recovery_status"
54 local iters=${ITERS:-3}
55 local nfiles=${NFILES:-50000}
56 local nthreads=${THREADS_PER_CLIENT:-3}
58 local IFree=$(inodes_available)
59 [ $IFree -gt $nfiles ] || nfiles=$IFree
71 while [ $num -le $CLIENTCOUNT ]; do
72 list=$(comma_list ${nodes[@]:0:$num})
74 generate_machine_file $list $machinefile ||
75 { error "can not generate machinefile"; exit 1; }
77 for i in $(seq $iters); do
78 mdsrate_cleanup $num $machinefile $nfiles $dir 'f%%d' --ignore
80 COMMAND="${MDSRATE} --create --nfiles $nfiles --dir $dir --filefmt 'f%%d'"
81 mpi_run -np $((num * nthreads)) -machinefile $machinefile ${COMMAND} | tee ${LOG} &
86 # 2 threads 100000 creates 117 secs
89 log "$i : Starting failover on $SINGLEMDS"
90 facet_failover $SINGLEMDS
91 if ! wait_recovery_complete $SINGLEMDS $((TIMEOUT * 10)); then
92 echo "$SINGLEMDS recovery is not completed!"
97 duration=$(do_facet $SINGLEMDS lctl get_param -n $procfile | grep recovery_duration)
99 res=( "${res[@]}" "$num" )
100 res=( "${res[@]}" "$duration" )
101 echo "RECOVERY TIME: NFILES=$nfiles number of clients: $num $duration"
105 num=$((num + increment))
108 mdsrate_cleanup $num $machinefile $nfiles $dir 'f%%d' --ignore
111 while [ $i -lt ${#res[@]} ]; do
112 echo "RECOVERY TIME: NFILES=$nfiles number of clients: ${res[i]} ${res[i+1]}"
117 run_test 3a "recovery time, $CLIENTCOUNT clients"
119 equals_msg `basename $0`: test complete, cleaning up
120 check_and_cleanup_lustre
121 [ -f "$TESTSUITELOG" ] && cat $TESTSUITELOG || true