local mds_last
local ost_last
local ostnum
+ local node
# only test MDT0000
local mdtosc=$(get_mdtosc_proc_path $SINGLEMDS)
param=`echo ${value[0]} | cut -d "=" -f1`
ostname=`echo $param | cut -d "." -f2 | cut -d - -f 1-2`
mds_last=$(do_facet $SINGLEMDS lctl get_param -n $param)
- ostnum=$(echo $ostname | sed "s/${FSNAME}-OST//g" | awk '{print ($1+1)}' )
- ost_last=$(do_facet ost$ostnum lctl get_param -n obdfilter.$ostname.last_id | head -n 1)
+ ostnum=$(index_from_ostuuid ${ostname}_UUID)
+ node=$(facet_active_host ost$((ostnum+1)))
+ param="obdfilter.$ostname.last_id"
+ ost_last=$(do_node $node lctl get_param -n $param | head -n 1)
echo "$ostname.last_id=$ost_last ; MDS.last_id=$mds_last"
if [ $ost_last != $mds_last ]; then
error "$ostname.last_id=$ost_last ; MDS.last_id=$mds_last"
STRIPE_OFFSET=0
local list=$(comma_list $(osts_nodes))
- do_nodes $list $LCTL set_param -n obdfilter.*.read_cache_enable=0
- do_nodes $list $LCTL set_param -n obdfilter.*.writethrough_cache_enable=0
+ set_osd_param $list '' read_cache_enable 0
+ set_osd_param $list '' writethrough_cache_enable 0
trap cleanup_test101bc EXIT
# prepare the read-ahead file
rm -f $DIR/$tfile
local list=$(comma_list $(osts_nodes))
- do_nodes $list $LCTL set_param -n obdfilter.*.read_cache_enable=1
- do_nodes $list $LCTL set_param -n obdfilter.*.writethrough_cache_enable=1
+ set_osd_param $list '' read_cache_enable 1
+ set_osd_param $list '' writethrough_cache_enable 1
}
calc_total() {
function roc_hit() {
local list=$(comma_list $(osts_nodes))
- echo $(get_obdfilter_param $list '' stats |
+ echo $(get_osd_param $list '' stats |
awk '/'cache_hit'/ {sum+=$2} END {print sum}')
}
on=0;
fi
local list=$(comma_list $(osts_nodes))
- set_obdfilter_param $list '' $1_cache_enable $on
+ set_osd_param $list '' $1_cache_enable $on
cancel_lru_locks osc
}
local list=$(comma_list $(osts_nodes))
# check whether obdfilter is cache capable at all
- if ! get_obdfilter_param $list '' read_cache_enable >/dev/null; then
+ if ! get_osd_param $list '' read_cache_enable >/dev/null; then
echo "not cache-capable obdfilter"
return 0
fi
# check cache is enabled on all obdfilters
- if get_obdfilter_param $list '' read_cache_enable | grep 0; then
+ if get_osd_param $list '' read_cache_enable | grep 0; then
echo "oss cache is disabled"
return 0
fi
- set_obdfilter_param $list '' writethrough_cache_enable 1
+ set_osd_param $list '' writethrough_cache_enable 1
# pages should be in the case right after write
dd if=/dev/urandom of=$DIR/$tfile bs=4k count=$CPAGES || error "dd failed"
# the following read invalidates the cache
cancel_lru_locks osc
- set_obdfilter_param $list '' read_cache_enable 0
+ set_osd_param $list '' read_cache_enable 0
cat $DIR/$tfile >/dev/null
# now data shouldn't be found in the cache
error "IN CACHE: before: $BEFORE, after: $AFTER"
fi
- set_obdfilter_param $list '' read_cache_enable 1
+ set_osd_param $list '' read_cache_enable 1
rm -f $DIR/$tfile
}
run_test 151 "test cache on oss and controls ==============================="