summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
6d57484)
This patch fixes mds-survey.sh and mds-survey to support
multiple MDTs.
Test-Parameters: mdtcount=1 testlist=mds-survey
Test-Parameters: envdefinitions=PTLDEBUG=-1,DEBUG_SIZE=150 mdscount=2 mdtcount=4 testlist=mds-survey
Signed-off-by: Fan Yong <fan.yong@intel.com>
Signed-off-by: Jian Yu <jian.yu@intel.com>
Change-Id: I9193b7fb65ab8b5dfd0817a8c203dae463deb090
Reviewed-on: http://review.whamcloud.com/19437
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Minh Diep <minh.diep@intel.com>
Reviewed-by: wangdi <di.wang@intel.com>
Reviewed-by: James Nunez <james.a.nunez@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
local ndir=$3
local rfile=$4
local mdtidx=$5
local ndir=$3
local rfile=$4
local mdtidx=$5
local idx
for ((idx = 0; idx < $ndir; idx++)); do
local idx
for ((idx = 0; idx < $ndir; idx++)); do
else
dirname="$(printf "${mdtbasedir}" $mdtidx)${basedir}${idx}"
fi
else
dirname="$(printf "${mdtbasedir}" $mdtidx)${basedir}${idx}"
fi
- remote_shell $host $lctl --device $devno test_mkdir /$dirname > $rfile 2>&1
+ remote_shell $host $lctl --device $devno test_mkdir /$dirname \
+ -c $dir_stripes --stripe_index $mdtidx > $rfile 2>&1
while read line; do
echo "$line" | grep -q 'error: test_mkdir'
if [ $? -eq 0 ]; then
while read line; do
echo "$line" | grep -q 'error: test_mkdir'
if [ $? -eq 0 ]; then
mdtidx=${client_indexes[$idx]}
echo "=======> Create $dir_count directories on $client_name" >> $workf
destroy_directories $host $devno $dir_count $tmpf $mdtidx
mdtidx=${client_indexes[$idx]}
echo "=======> Create $dir_count directories on $client_name" >> $workf
destroy_directories $host $devno $dir_count $tmpf $mdtidx
- ret=$(create_directories $host $devno $dir_count $tmpf $mdtidx)
+ ret=$(create_directories $host $devno $dir_count $tmpf $mdtidx $ndevs)
cat $tmpf >> $workf
rm $tmpf
if [ $ret = "ERROR" ]; then
cat $tmpf >> $workf
rm $tmpf
if [ $ret = "ERROR" ]; then
cleanup_mount $MOUNT2
get_target() {
cleanup_mount $MOUNT2
get_target() {
- local mds=$(facet_host $SINGLEMDS)
- echo $(do_nodes $mds 'lctl dl' | \
- awk "{if (\$2 == \"UP\" && \$3 == \"mdt\") {print \$4}}")
+ local node=$1
+ local mdt
+ local mdts
+ local target
+
+ mdts=$(do_node $node "$LCTL dl" |
+ awk "{if (\$2 == \"UP\" && \$3 == \"mdt\") {print \$4}}")
+
+ for mdt in $mdts; do
+ target+="${target:+ }$node:$mdt"
+ done
+
+ echo -n $target
+}
+
+get_targets() {
+ local targets
+ local node
+
+ for node in $(mdts_nodes); do
+ targets+="${targets:+ }$(get_target $node)"
+ done
+
+ echo -n $targets
- local layer=${1:-mdd}
- local stripe_count=${2:-0}
- local mds=$(facet_host $SINGLEMDS)
- local rc=0
-
- rm -f ${TMP}/mds_survey*
-
- local target=$(get_target)
- local cmd="file_count=$file_count thrlo=$thrlo thrhi=$thrhi"
- local cmd+=" dir_count=$dir_count layer=$layer stripe_count=$stripe_count"
- local cmd+=" rslt_loc=${TMP} targets=\"$mds:$target\" $MDSSURVEY"
-
- echo + $cmd
- eval $cmd || rc=$?
- cat ${TMP}/mds_survey*
- rm -f ${TMP}/mds_survey*
- ((rc == 0)) || error "mds-survey failed"
+ local layer=${1:-mdd}
+ local stripe_count=${2:-0}
+ local rc=0
+
+ rm -f ${TMP}/mds_survey*
+
+ local cmd="file_count=$file_count thrlo=$thrlo thrhi=$thrhi"
+ cmd+=" dir_count=$dir_count layer=$layer stripe_count=$stripe_count"
+ cmd+=" rslt_loc=${TMP} targets=\"$(get_targets)\" $MDSSURVEY"
+
+ trap cleanup_echo_devs EXIT ERR
+
+ echo + $cmd
+ eval $cmd || rc=$?
+ cat ${TMP}/mds_survey*
+ rm -f ${TMP}/mds_survey*
+ ((rc == 0)) || error "mds-survey failed"
- local devs=$($LCTL dl | grep echo | awk '{print $4}')
+ trap 0
+ local dev
+ local devs=$($LCTL dl | grep echo | awk '{print $4}')
- for dev in $devs; do
- $LCTL --device $dev cleanup
- $LCTL --device $dev detach
- done
+ for dev in $devs; do
+ $LCTL --device $dev cleanup
+ $LCTL --device $dev detach
+ done