set -e
ONLY=${ONLY:-"$*"}
-# bug number for skipped test: 9977/LU-7105 LU-9452
-ALWAYS_EXCEPT=" 28 29 $SANITYN_EXCEPT"
+# bug number for skipped test: 9977/LU-7105
+ALWAYS_EXCEPT=" 28 $SANITYN_EXCEPT"
# UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
SRCDIR=$(dirname $0)
FSXP=100
fi
-test_16() {
+test_16a() {
local file1=$DIR1/$tfile
local file2=$DIR2/$tfile
fsx -c 50 -p $FSXP -N $FSXNUM -l $((SIZE * 256)) -S 0 -Z -r 4096 \
-w 4096 $file1 $file2 || error "fsx with O_DIRECT failed."
}
-run_test 16 "$FSXNUM iterations of dual-mount fsx"
+run_test 16a "$FSXNUM iterations of dual-mount fsx"
+
+# Consistency check for tiny writes, LU-9409
+test_16b() {
+ local file1=$DIR1/$tfile
+ local file2=$DIR2/$tfile
+
+ # to allocate grant because it may run out due to test_15.
+ lfs setstripe -c -1 $file1
+ dd if=/dev/zero of=$file1 bs=$STRIPE_BYTES count=$OSTCOUNT oflag=sync
+ dd if=/dev/zero of=$file2 bs=$STRIPE_BYTES count=$OSTCOUNT oflag=sync
+ rm -f $file1
+
+ lfs setstripe -c -1 $file1 # b=10919
+ # -o is set to 8192 because writes < 1 page and between 1 and 2 pages
+ # create a mix of tiny writes & normal writes
+ fsx -c 50 -p $FSXP -N $FSXNUM -l $((SIZE * 256)) -o 8192 -S 0 $file1 \
+ $file2
+}
+run_test 16b "$FSXNUM iterations of dual-mount fsx at small size"
test_17() { # bug 3513, 3667
remote_ost_nodsh && skip "remote OST with nodsh" && return
}
test_77a() { #LU-3266
+ local rc
+
oss=$(comma_list $(osts_nodes))
- do_nodes $oss lctl set_param ost.OSS.*.nrs_policies="fifo"
+ do_nodes $oss lctl set_param ost.OSS.*.nrs_policies="fifo" ||
+ rc=$?
+ [[ $rc -eq 3 ]] && skip "no NRS exists" && return
+ [[ $rc -ne 0 ]] && error "failed to set fifo policy"
nrs_write_read
return 0
run_test 77a "check FIFO NRS policy"
test_77b() { #LU-3266
+ local rc
+
oss=$(comma_list $(osts_nodes))
do_nodes $oss lctl set_param ost.OSS.*.nrs_policies="crrn" \
- ost.OSS.*.nrs_crrn_quantum=1
+ ost.OSS.*.nrs_crrn_quantum=1 || rc=$?
+ [[ $rc -eq 3 ]] && skip "no NRS exists" && return
+ [[ $rc -ne 0 ]] && error "failed to set crrn_quantum to 1"
echo "policy: crr-n, crrn_quantum 1"
nrs_write_read
- do_nodes $oss lctl set_param ost.OSS.*.nrs_crrn_quantum=64
+ do_nodes $oss lctl set_param \
+ ost.OSS.*.nrs_crrn_quantum=64 || rc=$?
+ [[ $rc -ne 0 ]] && error "failed to set crrn_quantum to 64"
echo "policy: crr-n, crrn_quantum 64"
nrs_write_read
# cleanup
- do_nodes $oss lctl set_param ost.OSS.ost_io.nrs_policies="fifo"
+ do_nodes $oss lctl set_param \
+ ost.OSS.ost_io.nrs_policies="fifo" || rc=$?
+ [[ $rc -ne 0 ]] && error "failed to set fifo policy"
return 0
}
run_test 77b "check CRR-N NRS policy"
oss=$(comma_list $(osts_nodes))
do_nodes $oss lctl set_param ost.OSS.ost_io.nrs_policies=$policy \
- ost.OSS.*.nrs_"$policy"_quantum=1 \
- ost.OSS.*.nrs_"$policy"_offset_type="physical" \
- ost.OSS.*.nrs_"$policy"_supported="reads"
+ ost.OSS.*.nrs_"$policy"_quantum=1 \
+ ost.OSS.*.nrs_"$policy"_offset_type="physical" \
+ ost.OSS.*.nrs_"$policy"_supported="reads" || return $?
- echo "policy: $policy, ${policy}_quantum 1, ${policy}_offset_type physical, ${policy}_supported reads"
+ echo "policy: $policy, ${policy}_quantum 1, ${policy}_offset_type " \
+ "physical, ${policy}_supported reads"
nrs_write_read
- do_nodes $oss lctl set_param ost.OSS.*.nrs_${policy}_supported="writes" \
- ost.OSS.*.nrs_${policy}_quantum=64
+ do_nodes $oss lctl set_param \
+ ost.OSS.*.nrs_${policy}_supported="writes" \
+ ost.OSS.*.nrs_${policy}_quantum=64 || return $?
- echo "policy: $policy, ${policy}_quantum 64, ${policy}_offset_type physical, ${policy}_supported writes"
+ echo "policy: $policy, ${policy}_quantum 64, ${policy}_offset_type " \
+ "physical, ${policy}_supported writes"
nrs_write_read
- do_nodes $oss lctl set_param ost.OSS.*.nrs_${policy}_supported="reads_and_writes" \
- ost.OSS.*.nrs_${policy}_offset_type="logical"
- echo "policy: $policy, ${policy}_quantum 64, ${policy}_offset_type logical, ${policy}_supported reads_and_writes"
+ do_nodes $oss lctl set_param \
+ ost.OSS.*.nrs_${policy}_supported="reads_and_writes" \
+ ost.OSS.*.nrs_${policy}_offset_type="logical" || return $?
+ echo "policy: $policy, ${policy}_quantum 64, ${policy}_offset_type " \
+ "logical, ${policy}_supported reads_and_writes"
nrs_write_read
# cleanup
- do_nodes $oss lctl set_param ost.OSS.ost_io.nrs_policies="fifo"
+ do_nodes $oss lctl set_param ost.OSS.ost_io.nrs_policies="fifo" ||
+ return $?
return 0
}
test_77c() { #LU-3266
- orr_trr "orr"
+ local rc
+ orr_trr "orr" || rc=$?
+ [[ $rc -eq 3 ]] && skip "no NRS exists" && return
+ [[ $rc -ne 0 ]] && error "orr_trr failed rc:$rc"
return 0
}
run_test 77c "check ORR NRS policy"
test_77d() { #LU-3266
- orr_trr "trr"
+ local rc
+ orr_trr "trr" || rc=$?
+ [[ $rc -eq 3 ]] && skip "no NRS exists" && return
+ [[ $rc -ne 0 ]] && error "orr_trr failed rc:$rc"
return 0
}
run_test 77d "check TRR nrs policy"
}
test_77e() {
- local server_version=$(lustre_version_code ost1)
- [[ $server_version -ge $(version_code 2.7.58) ]] ||
- { skip "Need server version newer than 2.7.57"; return 0; }
+ local rc
oss=$(comma_list $(osts_nodes))
- do_nodes $oss lctl set_param ost.OSS.ost_io.nrs_policies="tbf\ nid"
- [ $? -ne 0 ] && error "failed to set TBF policy"
+ do_nodes $oss lctl set_param ost.OSS.ost_io.nrs_policies="tbf\ nid" ||
+ rc=$?
+ [[ $rc -eq 3 ]] && skip "no NRS TBF exists" && return
+ [[ $rc -ne 0 ]] && error "failed to set TBF NID policy"
local idis
local rateis
run_test 77e "check TBF NID nrs policy"
test_77f() {
- local server_version=$(lustre_version_code ost1)
- [[ $server_version -ge $(version_code 2.7.58) ]] ||
- { skip "Need server version newer than 2.7.57"; return 0; }
+ local rc
oss=$(comma_list $(osts_nodes))
+ do_nodes $oss $LCTL set_param \
+ ost.OSS.ost_io.nrs_policies="tbf\ jobid" || rc=$?
+ [[ $rc -eq 3 ]] && skip "no NRS TBF exists" && return
+ [[ $rc -ne 0 ]] && error "failed to set TBF JOBID policy"
+
# Configure jobid_var
local saved_jobid_var=$($LCTL get_param -n jobid_var)
+ rc=$?
+ [[ $rc -eq 3 ]] && skip "jobid_var not found" && return
+ [[ $rc -ne 0 ]] && error "failed to get param jobid_var"
if [ $saved_jobid_var != procname_uid ]; then
set_conf_param_and_check client \
"$LCTL get_param -n jobid_var" \
"$FSNAME.sys.jobid_var" procname_uid
fi
- do_nodes $oss lctl set_param ost.OSS.ost_io.nrs_policies="tbf\ jobid"
- [ $? -ne 0 ] && error "failed to set TBF policy"
-
local idis
local rateis
if [ $(lustre_version_code ost1) -ge $(version_code 2.8.54) ]; then
nrs_write_read "$RUNAS"
local current_jobid_var=$($LCTL get_param -n jobid_var)
+ [[ $? -ne 0 ]] && error "failed to get param jobid_var"
if [ $saved_jobid_var != $current_jobid_var ]; then
set_conf_param_and_check client \
"$LCTL get_param -n jobid_var" \
run_test 77f "check TBF JobID nrs policy"
test_77g() {
- local server_version=$(lustre_version_code ost1)
- [[ $server_version -ge $(version_code 2.7.58) ]] ||
- { skip "Need server version newer than 2.7.57"; return 0; }
+ local rc=0
oss=$(comma_list $(osts_nodes))
- do_nodes $oss lctl set_param ost.OSS.ost_io.nrs_policies="tbf\ nid"
- [ $? -ne 0 ] && error "failed to set TBF policy"
+ do_nodes $oss lctl set_param ost.OSS.ost_io.nrs_policies="tbf\ nid" ||
+ rc=$?
+ [[ $rc -eq 3 ]] && skip "no NRS TBF exists" && return
+ [[ $rc -ne 0 ]] && error "failed to set TBF NID policy"
- do_nodes $oss lctl set_param ost.OSS.ost_io.nrs_policies="tbf\ jobid"
- [ $? -ne 0 ] && error "failed to set TBF policy"
+ do_nodes $oss lctl set_param \
+ ost.OSS.ost_io.nrs_policies="tbf\ jobid" || rc=$?
+ [[ $rc -ne 0 ]] && error "failed to set TBF JOBID policy"
local idis
local rateis
run_test 77k "check the extended TBF policy with NID/JobID/OPCode expression"
test_77l() {
+ [[ $(lustre_version_code ost1) -ge $(version_code 2.10.56) ]] ||
+ { skip "Need OST version at least 2.10.56"; return 0; }
+
+ do_facet ost1 lctl set_param ost.OSS.ost_io.nrs_policies="tbf\ nid"
+ do_facet ost1 lctl set_param ost.OSS.ost_io.nrs_policies="tbf"
+
+ local output=$(do_facet ost1 lctl get_param \
+ ost.OSS.ost_io.nrs_policies | \
+ awk '/name: tbf/ {print;exit}' | \
+ awk -F ': ' '{print $2}')
+
+ if [ "$output" != "tbf" ]; then
+ error "The generic TBF output is '$output', not 'tbf'"
+ fi
+
+ do_facet ost1 lctl set_param ost.OSS.ost_io.nrs_policies="fifo"
+}
+run_test 77l "check the output of NRS policies for generic TBF"
+
+test_77m() {
if [ $(lustre_version_code ost1) -lt $(version_code 2.9.54) ]; then
skip "Need OST version at least 2.9.54"
return 0
return 0
}
-run_test 77l "check NRS Delay slows write RPC processing"
+run_test 77m "check NRS Delay slows write RPC processing"
test_78() { #LU-6673
- local server_version=$(lustre_version_code ost1)
- [[ $server_version -ge $(version_code 2.7.58) ]] ||
- { skip "Need server version newer than 2.7.57"; return 0; }
-
local rc
oss=$(comma_list $(osts_nodes))
do_nodes $oss lctl set_param ost.OSS.ost_io.nrs_policies="orr" &
do_nodes $oss lctl set_param ost.OSS.*.nrs_orr_quantum=1
rc=$?
+ [[ $rc -eq 3 ]] && skip "no NRS exists" && return
# Valid return codes are:
# 0: Tuning succeeded
# ENODEV: Policy is still stopped