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}
20 remote_mds_nodsh && log "SKIP: remote MDS with nodsh" && exit 0
22 [ -n "$CLIENTS" ] || { skip_env "$0: Need two or more clients" && exit 0; }
23 [ $CLIENTCOUNT -ge 2 ] || \
24 { skip_env "$0: Need two or more remote clients, have $CLIENTCOUNT" && exit 0; }
27 [ "$SLOW" = "no" ] && EXCEPT_SLOW=""
32 check_and_setup_lustre
33 rm -rf $DIR/[df][0-9]*
35 get_mpiuser_id $MPI_USER
36 MPI_RUNAS=${MPI_RUNAS:-"runas -u $MPI_USER_UID -g $MPI_USER_GID"}
37 $GSS_KRB5 && refresh_krb5_tgt $MPI_USER_UID $MPI_USER_GID $MPI_RUNAS
39 [ "$DAEMONFILE" ] && $LCTL debug_daemon start $DAEMONFILE $DAEMONSIZE
42 assert_env CLIENTS MDSRATE MPIRUN
44 local -a nodes=(${CLIENTS//,/ })
46 # INCREMENT is a number of clients
47 # a half of clients by default
48 increment=${INCREMENT:-$(( CLIENTCOUNT / 2 ))}
50 machinefile=${MACHINEFILE:-$TMP/$(basename $0 .sh).machines}
51 local LOG=$TMP/${TESTSUITE}_$tfile
53 local var=${SINGLEMDS}_svc
54 local procfile="*.${!var}.recovery_status"
55 local iters=${ITERS:-3}
56 local nfiles=${NFILES:-50000}
57 local nthreads=${THREADS_PER_CLIENT:-3}
59 local IFree=$(inodes_available)
60 [ $IFree -gt $nfiles ] || nfiles=$IFree
62 local dir=$DIR/d0.$TESTNAME
72 while [ $num -le $CLIENTCOUNT ]; do
73 list=$(comma_list ${nodes[@]:0:$num})
75 generate_machine_file $list $machinefile ||
76 { error "can not generate machinefile"; exit 1; }
78 for i in $(seq $iters); do
79 mdsrate_cleanup $num $machinefile $nfiles $dir 'f%%d' --ignore
81 COMMAND="${MDSRATE} --create --nfiles $nfiles --dir $dir --filefmt 'f%%d'"
82 mpi_run -np $((num * nthreads)) -machinefile $machinefile ${COMMAND} | tee ${LOG} &
87 # 2 threads 100000 creates 117 secs
90 log "$i : Starting failover on $SINGLEMDS"
91 facet_failover $SINGLEMDS
92 if ! wait_recovery_complete $SINGLEMDS $((TIMEOUT * 10)); then
93 echo "$SINGLEMDS recovery is not completed!"
98 duration=$(do_facet $SINGLEMDS lctl get_param -n $procfile | grep recovery_duration)
100 res=( "${res[@]}" "$num" )
101 res=( "${res[@]}" "$duration" )
102 echo "RECOVERY TIME: NFILES=$nfiles number of clients: $num $duration"
106 num=$((num + increment))
109 mdsrate_cleanup $num $machinefile $nfiles $dir 'f%%d' --ignore
112 while [ $i -lt ${#res[@]} ]; do
113 echo "RECOVERY TIME: NFILES=$nfiles number of clients: ${res[i]} ${res[i+1]}"
118 run_test 3a "recovery time, $CLIENTCOUNT clients"
120 complete $(basename $0) $SECONDS
121 check_and_cleanup_lustre