# and stop to generate the startup logs.
start_mds
start_ost
- wait_osc_import_state mds ost FULL
+ wait_osc_import_state mds ost FULL
stop_ost
stop_mds
}
}
reformat() {
- formatall
+ formatall
}
start_mgs () {
}
stop_mgs() {
- echo "stop mgs service on `facet_active_host mgs`"
- # These tests all use non-failover stop
- stop mgs -f || return 97
+ echo "stop mgs service on `facet_active_host mgs`"
+ # These tests all use non-failover stop
+ stop mgs -f || return 97
}
start_ost() {
do_facet client "cp /etc/passwd $DIR/a" || return 71
do_facet client "rm $DIR/a" || return 72
# make sure lustre is actually mounted (touch will block,
- # but grep won't, so do it after)
- do_facet client "grep $MOUNT' ' /proc/mounts > /dev/null" || return 73
+ # but grep won't, so do it after)
+ do_facet client "grep $MOUNT' ' /proc/mounts > /dev/null" || return 73
echo "setup single mount lustre success"
}
T32_QID=60000
T32_BLIMIT=40960 # Kbytes
T32_ILIMIT=4
-T32_PRJID=1000
-T32_PROLIMIT=$((T32_BLIMIT/10))
+
#
# This is not really a test but a tool to create new disk
# image tarballs for the upgrade tests.
local remote_dir
local striped_dir
local pushd_dir
- local pfl_dir
- local pfl_file
- local dom_dir
- local dom_file
- local flr_dir
- local flr_file
- local pj_quota_dir
- local pj_quota_file
- local target_dir
if [ $FSNAME != t32fs -o \( -z "$MDSDEV" -a -z "$MDSDEV1" \) -o \
- $OSTCOUNT -ne 2 -o -z "$OSTDEV1" ]; then
- error "Needs FSNAME=t32fs MDSCOUNT=2 " \
- "MDSDEV1=<nonexistent_file> " \
- "MDSDEV2=<nonexistent_file> " \
- "(or MDSDEV, in the case of b1_8) " \
- "OSTCOUNT=2 OSTDEV1=<nonexistent_file> " \
- "OSTDEV2=<nonexistent_file>"
+ $OSTCOUNT -ne 1 -o -z "$OSTDEV1" ]; then
+ error "Needs FSNAME=t32fs MDSCOUNT=2 " \
+ "MDSDEV1=<nonexistent_file>" \
+ "MDSDEV2=<nonexistent_file>" \
+ "(or MDSDEV, in the case of b1_8)" \
+ "OSTCOUNT=1 OSTDEV1=<nonexistent_file>"
fi
mkdir $tmp || {
mkdir $tmp/src || return 1
tar cf - -C $src . | tar xf - -C $tmp/src
+ dd if=/dev/zero of=$tmp/src/t32_qf_old bs=1M \
+ count=$(($T32_BLIMIT / 1024 / 4))
+ chown $T32_QID.$T32_QID $tmp/src/t32_qf_old
# format ost with comma-separated NIDs to verify LU-4460
local failnid="$(h2nettype 1.2.3.4),$(h2nettype 4.3.2.1)"
$LFS setquota -u $T32_QID -b 0 -B $T32_BLIMIT -i 0 -I $T32_ILIMIT \
/mnt/$FSNAME
+ tar cf - -C $tmp/src . | tar xf - -C /mnt/$FSNAME
+
if [[ $MDSCOUNT -ge 2 ]]; then
remote_dir=/mnt/$FSNAME/remote_dir
$LFS mkdir -i 1 $remote_dir
tar cf - -C $tmp/src . | tar xf - -C $remote_dir
- target_dir=$remote_dir
- if [[ $MDS1_VERSION -ge $(version_code 2.7.0) ]]; then
+ if [[ "$MDS1_VERSION" -ge $(version_code 2.7.0) ]]; then
striped_dir=/mnt/$FSNAME/striped_dir_old
$LFS mkdir -i 1 -c 2 $striped_dir
tar cf - -C $tmp/src . | tar xf - -C $striped_dir
fi
- else
- tar cf - -C $tmp/src . | tar xf - -C /mnt/$FSNAME
- target_dir=/mnt/$FSNAME
fi
- # add project quota #
- [[ $mds1_FSTYPE == "ldiskfs" &&
- $MDS1_VERSION -gt $(version_code 2.9.55) ]] ||
- [[ $mds1_FSTYPE == "zfs" &&
- $MDS1_VERSION -gt $(version_code 2.10.53) ]] && {
- pj_quota_dir=$target_dir/project_quota_dir
- pj_quota_file_old=$pj_quota_dir/pj_quota_file_old
-
- enable_project_quota
- set_mdt_qtype ugp ||
- error "enable mdt quota failed"
-
- set_ost_qtype ugp ||
- error "enable ost quota failed"
-
- mkdir -p $pj_quota_dir
- $LFS setquota -p $T32_PRJID -b 0 -B $T32_PROLIMIT -i 0 \
- -I $T32_ILIMIT $pj_quota_dir ||
- error "setquota -p $T32_PRJID failed"
-
- $LFS setstripe $pj_quota_file_old -c 1 ||
- error "setstripe $pj_quota_file_old failed"
-
- chown $T32_QID:$T32_QID $pj_quota_file_old ||
- error "chown $pj_quota_file_old failed"
-
- change_project -p $T32_PRJID $pj_quota_file_old
-
- mkdir -p $tmp/src/project_quota_dir
- cp $pj_quota_file_old $tmp/src/project_quota_dir/
- }
-
- #####################
- tar cf - -C $tmp/src . | tar xf - -C /mnt/$FSNAME
-
- #if [[ $MDSCOUNT -ge 2 ]]; then
- # remote_dir=/mnt/$FSNAME/remote_dir
- # $LFS mkdir -i 1 $remote_dir
- # tar cf - -C $tmp/src . | tar xf - -C $remote_dir
-
- # if [[ "$MDS1_VERSION" -ge $(version_code 2.7.0) ]]; then
- # striped_dir=/mnt/$FSNAME/striped_dir_old
- # $LFS mkdir -i 1 -c 2 $striped_dir
- # tar cf - -C $tmp/src . | tar xf - -C $striped_dir
- # fi
- #fi
-
- # PFL file #
- if [[ $MDS1_VERSION -ge $(version_code 2.9.51) ]]; then
- pfl_dir=$target_dir/pfl_dir
- pfl_file=$pfl_dir/pfl_file
- mkdir -p $pfl_dir
- $LFS setstripe -E 2M -c 1 -o 0 -E -1 -S 2M -c 1 -o 1 \
- $pfl_file ||
- error "Create PFL file failed"
-
- dd if=/dev/urandom of=$pfl_file bs=1k count=3k
- mkdir -p $tmp/src/pfl_dir
- cp $pfl_file $tmp/src/pfl_dir/
- fi
-
- ############
- # DoM / FLR file #
- if [[ $MDS1_VERSION -ge $(version_code 2.10.56) ]]; then
- dom_dir=$target_dir/dom_dir
- dom_file=$dom_dir/dom_file
- flr_dir=$target_dir/flr_dir
- flr_file=$flr_dir/flr_file
-
- mkdir -p $dom_dir
- $LFS setstripe -E 1M -L mdt -E -1 -S 4M $dom_file
- dd if=/dev/urandom of=$dom_file bs=1k count=2k
- mkdir -p $tmp/src/dom_dir
- cp $dom_file $tmp/src/dom_dir
- # FLR #
- mkdir -p $flr_dir
- LFS mirror create -N2 $flr_file
- dd if=/dev/urandom of=$flr_file bs=1k count=1
- mkdir -p $tmp/src/flr_dir
- cp $flr_file $tmp/src/flr_dir
- fi
- ############
stopall
mkdir $tmp/img || return 1
kill -s USR1 $pid
wait $pid
- #################
stopall
pushd $tmp/src
devname=$(mdsvdevname $num)
mv $devname $tmp/img
done
-
- for num in $(seq $OSTCOUNT); do
- local devname=$(ostdevname $num)
- local facet=oss$num
- [[ $(facet_fstype $facet) != zfs ]] ||
- devname=$(ostdevname $num)
- mv $devname $tmp/img
- done
+ mv $OSTDEV1 $tmp/img
version=$(sed -e 's/\(^[0-9]\+\.[0-9]\+\)\(.*$\)/\1/' $tmp/img/commit |
sed -e 's/\./_/g') # E.g., "1.8.7" -> "1_8"
if $shall_cleanup_ost; then
$r $UMOUNT $tmp/mnt/ost || rc=$?
fi
- if $shall_cleanup_ost1; then
- $r $UMOUNT $tmp/mnt/ost1 || rc=$?
- fi
$r rm -rf $tmp
rm -rf $tmp
return 0
}
-getquota() {
- local spec=$4
- local uuid=$3
- local mnt=$5
-
- sync_all_data > /dev/null 2>&1 || true
-
- [ "$uuid" != "global" ] || uuid=$mnt
-
- $LFS quota -v "$1" "$2" $mnt |
- awk 'BEGIN { num='$spec' } { if ($1 == "'$uuid'") \
- { if (NF == 1) { getline } else { num++ } ; print $num;} }' \
- | tr -d "*"
-}
-
t32_test() {
local tarball=$1
local writeconf=$2
local dne_upgrade=${dne_upgrade:-"no"}
local dom_upgrade=${dom_upgrade:-"no"}
+ local project_upgrade=${project_upgrade:-"no"}
local ff_convert=${ff_convert:-"no"}
- local pfl_upgrade=${pfl_upgrade:-"no"}
- local project_quota_upgrade=${project_quota_upgrade:-"no"}
- local dom_new_upgrade=${dom_new_upgrade:-"no"}
- local flr_upgrade=${flr_upgrade:-"no"}
local shall_cleanup_mdt=false
local shall_cleanup_mdt1=false
local shall_cleanup_ost=false
- local shall_cleanup_ost1=false
local shall_cleanup_lustre=false
local mdt2_is_available=false
- local ost2_is_available=false
local node=$(facet_active_host $SINGLEMDS)
local r="do_node $node"
local tmp=$TMP/t32
local mdt_dev=$tmp/mdt
local mdt2_dev=$tmp/mdt2
local ost_dev=$tmp/ost
- local ost2_dev=$tmp/ost2
local stripe_index
local stripe_count
local dir
- local pfl_file=$tmp/mnt/lustre/remote_dir/pfl_dir/pfl_file
- local flr_file=$tmp/mnt/lustre/remote_dir/flr_dir/flr_file
- local dom_file=$tmp/mnt/lustre/remote_dir/dom_dir/dom_file
- local quota_dir=$tmp/mnt/lustre/remote_dir/project_quota_dir
combined_mgs_mds || stop_mgs || error "Unable to stop MGS"
trap 'trap - RETURN; t32_test_cleanup' RETURN
nid=$($r $LCTL list_nids | head -1)
mkdir -p $tmp/mnt/lustre || error "mkdir $tmp/mnt/lustre failed"
- $r mkdir -p $tmp/mnt/{mdt,mdt1,ost,ost1}
+ $r mkdir -p $tmp/mnt/{mdt,mdt1,ost}
$r tar xjvf $tarball -S -C $tmp || {
error_noexit "Unpacking the disk image tarball"
return 1
ff_convert="no"
! $r test -f $mdt2_dev || mdt2_is_available=true
- ! $r test -f $ost2_dev || ost2_is_available=true
if [[ "$mds1_FSTYPE" == zfs ]]; then
# import pool first
mdt_dev=t32fs-mdt1/mdt1
ost_dev=t32fs-ost1/ost1
! $mdt2_is_available || mdt2_dev=t32fs-mdt2/mdt2
- ! $ost2_is_available || ost2_dev=t32fs-ost2/ost2
wait_update_facet $SINGLEMDS "$ZPOOL list |
awk '/^t32fs-mdt1/ { print \\\$1 }'" "t32fs-mdt1" || {
error_noexit "import zfs pool failed"
return 1
}
+ elif [ "$project_upgrade" != "no" ]; then
+ ! $r tune2fs -O project $mdt_dev &&
+ error_noexit "enable project on mdt0 failed" &&
+ return 1
+ $mdt2_is_available && ! $r tune2fs "-O project" $mdt2_dev &&
+ error_noexit "enable project on mdt failed" &&
+ return 1
+ ! $r tune2fs -O project $ost_dev &&
+ error_noexit "enable project on mdt failed" &&
+ return 1
fi
$r $LCTL set_param debug="$PTLDEBUG"
error_noexit "Enable mdt quota feature"
return 1
}
-
- if [ "$project_quota_upgrade" != "no" ]; then
- $r $TUNE2FS -O project $mdt_dev || {
- $r losetup -a
- error_noexit "tune2fs $mdt_dev failed"
- return 1
- }
- echo "enable project quota on $mdt_dev"
- fi
-
if $mdt2_is_available; then
$r $TUNEFS --quota $mdt2_dev || {
$r losetup -a
error_noexit "Enable mdt quota feature"
return 1
}
- if [ "$project_quota_upgrade" != "no" ]; then
- $r $TUNE2FS -O project $mdt2_dev || {
- $r losetup -a
- error_noexit \
- "tune2fs $mdt2_dev failed"
- return 1
- }
- echo "enable project quota on $mdt2_dev"
- fi
fi
fi
else
error_noexit "Mounting the MDT"
return 1
}
- shall_cleanup_mdt1=true
- echo "mount new MDT....$mdt2_dev"
- $r $LCTL set_param -n mdt.${fsname}*.enable_remote_dir=1 || {
+ echo "mount new MDT....$mdt2_dev"
+ $r $LCTL set_param -n mdt.${fsname}*.enable_remote_dir=1 ||
error_noexit "enable remote dir create failed"
- return 1
- }
+ shall_cleanup_mdt1=true
elif [ "$dne_upgrade" != "no" ]; then
local fs2mdsdev=$(mdsdevname 1_2)
local fs2mdsvdev=$(mdsvdevname 1_2)
error_noexit "tunefs.lustre before mounting the OST"
return 1
}
-
- if $ost2_is_available; then
- $r $TUNEFS --dryrun $ost2_dev || {
- error_noexit "tunefs.lustre before mounting the OST"
- return 1
- }
- fi
-
if [ "$writeconf" ]; then
mopts=mgsnode=$nid,$writeconf
- if [ "$ost1_FSTYPE" == ldiskfs ]; then
+ if [ "$mds1_FSTYPE" == ldiskfs ]; then
mopts="loop,$mopts"
$r $TUNEFS --quota $ost_dev || {
$r losetup -a
error_noexit "Enable ost quota feature"
return 1
}
-
- if [ "$project_quota_upgrade" != "no" ]; then
- $r $TUNE2FS -O project $ost_dev || {
- $r losetup -a
- error_noexit "tune2fs $ost_dev failed"
- return 1
- }
- echo "enable project quota on $ost_dev"
- fi
-
- if $ost2_is_available; then
- $r $TUNEFS --quota $ost2_dev || {
- $r losetup -a
- error_noexit "Enable ost2 quota feature"
- return 1
- }
- if [ "$project_quota_upgrade" != "no" ]; then
- $r $TUNE2FS -O project $ost2_dev || {
- $r losetup -a
- error_noexit \
- "tune2fs $ost2_dev failed"
- return 1
- }
- echo "enable project quota on $ost2_dev"
- fi
- fi
fi
else
mopts=mgsnode=$nid
error_noexit "Mounting the OST"
return 1
}
-
- if $ost2_is_available; then
- $r $MOUNT_CMD -onomgs -o$mopts $ost2_dev $tmp/mnt/ost1 || {
- error_noexit "Mounting the OST2"
- return 1
- }
- shall_cleanup_ost1=true
- fi
-
shall_cleanup_ost=true
uuid=$($r $LCTL get_param -n obdfilter.$fsname-OST0000.uuid) || {
return 1
fi
- if $ost2_is_available; then
- uuid=$($r $LCTL get_param -n obdfilter.$fsname-OST0001.uuid) ||{
- error_noexit "Getting OST1 UUID"
- return 1
- }
- if [ "$uuid" != $fsname-OST0001_UUID ]; then
- error_noexit "Unexpected OST1 UUID: \"$uuid\""
- return 1
- fi
- fi
-
if [[ $PERM_CMD == *"set_param -P"* ]]; then
$r $PERM_CMD osc.$fsname-OST0000*.import=connection=$nid || {
error_noexit "Setting OST \"failover.node\""
echo "list verification skipped"
fi
- #non-dom upgrade to dom
if [ "$dom_upgrade" != "no" ]; then
echo "Check DoM file can be created"
$LFS setstripe -E 1M -L mdt -E EOF $tmp/mnt/lustre/dom || {
}
fi
- #dom upgrade
- #$LFS setstripe -E 1M -L mdt -E -1 -S 4M $dom_file
- if [ "$dom_new_upgrade" != "no" ]; then
- if ! $mdt2_is_available; then
- dom_file=$tmp/mnt/lustre/dom_dir/dom_file
- fi
- echo "Check DoM file can be accessed"
- [ $($LFS getstripe -I1 -L $dom_file) == "mdt" ] || {
- error_noexit "Verify a DoM file"
- return 1
- }
- [ $(stat -c%s $dom_file) == $((2 * 1024 * 1024)) ] || {
- error_noexit "DoM: bad size after write"
- return 1
- }
- fi
-
- if [ "$flr_upgrade" != "no" ]; then
- if ! $mdt2_is_available; then
- flr_file=$tmp/mnt/lustre/flr_dir/flr_file
- fi
- local mirror_count=$($LFS getstripe -N $flr_file)
- echo "Check FLR file"
- [ $mirror_count == 2 ] || {
- error_noexit "FLR mirror count wrong"
- return 1
- }
- fi
-
if [ "$dne_upgrade" != "no" ]; then
$LFS mkdir -i 1 -c2 $tmp/mnt/lustre/striped_dir || {
error_noexit "set striped dir failed"
return 1
}
+
$LFS setdirstripe -D -c2 $tmp/mnt/lustre/striped_dir
pushd $tmp/mnt/lustre
popd
fi
- if [ "$pfl_upgrade" != "no" ]; then
- local comp_size
- local comp_cnt
- local stripe_size
- local stripe_cnt
- local comp_id
-
- echo "Check PFL file"
- if ! $mdt2_is_available; then
- pfl_file=$tmp/mnt/lustre/pfl_dir/pfl_file
- fi
- comp_cnt=$($LFS getstripe --component-count $pfl_file)
- [ $comp_cnt == 2 ] || {
- error_noexit "wrong comp_cnt $comp_cnt"
- return 1
- }
-
- comp_size=$($LFS getstripe -I1 -E $pfl_file)
- [ $comp_size == 2097152 ] || {
- error_noexit "wrong component size $comp_size"
- return 1
- }
-
- comp_id=$($LFS getstripe -I1 -i $pfl_file)
- [ $comp_id == 0 ] || {
- error_noexit "wrong comp id $comp_id"
- return 1
- }
-
- comp_id=$($LFS getstripe -I2 -i $pfl_file)
- [ $comp_id -eq 1 ] || {
- error_noexit "wrong comp id $comp_id"
- return 1
- }
-
- stripe_size=$($LFS getstripe -I1 -S $pfl_file)
- [ $stripe_size -eq 1048576 ] || {
- error_noexit "wrong stripe size $stripe_size"
- return 1
- }
-
- stripe_size=$($LFS getstripe -I2 -S $pfl_file)
- [ $comp_size -eq 2097152 ] || {
- error_noexit "wrong component size $comp_size"
- return 1
- }
- fi
-
- if [ "$project_quota_upgrade" != "no" ]; then
- if ! $mdt2_is_available; then
- quota_dir=$tmp/mnt/lustre/project_quota_dir
- fi
- local hardlimit
-
- echo "Check Project Quota"
- hardlimit=$(getquota -p $T32_PRJID global 3 \
- ${tmp}/mnt/lustre)
- [ $hardlimit == $T32_PROLIMIT ] || {
- error_noexit "wrong hardlimit $hardlimit"
- return 1
- }
- fi
-
# If it is upgrade from DNE (2.5), then rename the remote dir,
# which is created in 2.5 to striped dir.
if $mdt2_is_available && [[ "$dne_upgrade" != "no" ]]; then
$r cat $tmp/sha1sums | sort -k 2 >$tmp/sha1sums.orig
if [ "$dne_upgrade" != "no" ]; then
pushd $tmp/mnt/lustre/striped_dir
- elif [ "$pfl_upgrade" != "no" ] ||
- [ "$flr_upgrade" != "no" ] ||
- [ "$dom_new_upgrade" != "no" ] ||
- [ "$project_quota_upgrade" != "no" ]; then
- pushd $tmp/mnt/lustre/remote_dir
else
pushd $tmp/mnt/lustre
fi
echo "sha1sum verification skipped"
fi
- # PFL write test after sha1sum check
- if [ "$pfl_upgrade" != "no" ]; then
- local rw_len=$((3 * 1034 * 1024))
- if ! $mdt2_is_available; then
- pfl_file=$tmp/mnt/lustre/pfl_dir/pfl_file
- fi
- small_write $pfl_file $rw_len || {
- error_noexit "PFL RW Failed"
- return 1
- }
- fi
-
if [ "$dne_upgrade" != "no" ]; then
rm -rf $tmp/mnt/lustre/striped_dir || {
error_noexit "remove remote dir failed"
return 1
}
+ if [ "$mds1_FSTYPE" == ldiskfs -a \
+ "$project_upgrade" != "no" ]; then
+ ! $LFS project -d -p 1 $tmp/mnt/lustre/* &&
+ error_noexit "set project failed" &&
+ return 1
+ fi
+
[[ $(do_facet mds1 pgrep orph_.*-MDD | wc -l) == 0 ]] ||
error "MDD orphan cleanup thread not quit"
error_noexit "Unmounting the OST"
return 1
}
- if $ost2_is_available; then
- $r $UMOUNT $tmp/mnt/ost1 || {
- error_noexit "Unmounting the OST1"
- return 1
- }
- shall_cleanup_ost1=false
- fi
-
- if [[ $ost1_FSTYPE == zfs ]]; then
- $r "$ZPOOL export t32fs-ost1"
- if $ost2_is_available; then
- $r "$ZPOOL export t32fs-ost2"
- fi
+ if [[ "$mds1_FSTYPE" == zfs ]]; then
+ $r "$ZPOOL export t32fs-ost1"
fi
shall_cleanup_ost=false
t32_check
for tarball in $tarballs; do
- banner "testing $tarball upgrade with ff convert"
- ff_convert=yes t32_test $tarball || rc=$?
+ banner "testing $tarball upgrade with ff convert and project upgrade"
+ project_upgrade="no"
+ [[ "$MDS1_VERSION" -ge $(version_code 2.13.54) ]] &&
+ [[ "$tarball" =~ "disk2_4-ldiskfs" ]] &&
+ project_upgrade="yes"
+ project_upgrade=$project_upgrade ff_convert=yes t32_test \
+ $tarball || rc=$?
done
return $rc
}
-run_test 32d "convert ff test"
+run_test 32d "convert ff and project quota upgrade test"
test_32e() {
[[ "$MDS1_VERSION" -ge $(version_code 2.10.56) ]] ||
}
run_test 32e "dom upgrade test"
-test_32f() {
- [[ $MDS1_VERSION -ge $(version_code 2.10.56) ]] ||
- skip "Need MDS version at least 2.10.56"
-
- local tarballs
- local tarball
- local rc=0
-
- t32_check
- for tarball in $tarballs; do
- echo $tarball | grep "2_10" || continue
- pfl_upgrade=yes project_quota_upgrade=yes \
- t32_test $tarball writeconf || let "rc += $?"
- done
- return $rc
-}
-run_test 32f "pfl upgrade test"
-
-test_32g() {
- [[ $MDS1_VERSION -ge $(version_code 2.10.56) ]] ||
- skip "Need MDS version at least 2.10.56"
-
- local tarballs
- local tarball
- local rc=0
-
- t32_check
- for tarball in $tarballs; do
- echo $tarball | grep "2_12" || continue
- flr_upgrade=yes dom_new_upgrade=yes \
- t32_test $tarball writeconf || let "rc += $?"
- done
- return $rc
-}
-run_test 32g "flr/dom upgrade test"
-
test_33a() { # bug 12333, was test_33
local FSNAME2=test-123
local MDSDEV=$(mdsdevname ${SINGLEMDS//mds/})
skip "ldiskfs module has not been loaded"
fi
+ if grep -q "CONFIG_DEBUG_LOCK_ALLOC=y" /boot/config-$(uname -r); then
+ skip "test is not compatible with CONFIG_DEBUG_LOCK_ALLOC=y"
+ fi
+
echo "$inode_slab ldiskfs inodes per page"
[ "${inode_slab%.*}" -ge "3" ] && return 0
}
run_test 90b "check max_mod_rpcs_in_flight is enforced after update"
+save_params_90c() {
+ # get max_rpcs_in_flight value
+ mrif_90c=$($LCTL get_param -n \
+ mdc.$FSNAME-MDT0000-mdc-*.max_rpcs_in_flight)
+ echo "max_rpcs_in_flight is $mrif_90c"
+
+ # get max_mod_rpcs_in_flight value
+ mmrif_90c=$($LCTL get_param -n \
+ mdc.$FSNAME-MDT0000-mdc-*.max_mod_rpcs_in_flight)
+ echo "max_mod_rpcs_in_flight is $mmrif_90c"
+
+ # get MDT max_mod_rpcs_per_client value
+ mmrpc_90c=$(do_facet mds1 \
+ cat /sys/module/mdt/parameters/max_mod_rpcs_per_client)
+ echo "max_mod_rpcs_per_client is $mmrpc_90c"
+}
+
+restore_params_90c() {
+ trap 0
+
+ # restore max_rpcs_in_flight value
+ do_facet mgs $LCTL set_param -P \
+ mdc.$FSNAME-MDT0000-mdc-*.max_rpcs_in_flight=$mrif_90c
+
+ # restore max_mod_rpcs_in_flight value
+ do_facet mgs $LCTL set_param -P \
+ mdc.$FSNAME-MDT0000-mdc-*.max_mod_rpcs_in_flight=$mmrif_90c
+
+ # restore MDT max_mod_rpcs_per_client value
+ do_facet mds1 "echo $mmrpc_90c > \
+ /sys/module/mdt/parameters/max_mod_rpcs_per_client"
+}
+
test_90c() {
local tmp
- local mrif
- local mmrpc
setup
skip "Client not able to send multiple modify RPCs in parallel"
fi
- # get max_rpcs_in_flight value
- mrif=$($LCTL get_param -n mdc.$FSNAME-MDT0000-mdc-*.max_rpcs_in_flight)
- echo "max_rpcs_in_flight is $mrif"
-
- # get MDT max_mod_rpcs_per_client
- mmrpc=$(do_facet mds1 \
- cat /sys/module/mdt/parameters/max_mod_rpcs_per_client)
- echo "max_mod_rpcs_per_client is $mmrpc"
+ save_params_90c
+ stack_trap restore_params_90c
# testcase 1
# attempt to set max_mod_rpcs_in_flight to max_rpcs_in_flight value
# prerequisite: set max_mod_rpcs_per_client to max_rpcs_in_flight value
- umount_client $MOUNT
- do_facet mds1 \
- "echo $mrif > /sys/module/mdt/parameters/max_mod_rpcs_per_client"
- mount_client $MOUNT
+ do_facet mds1 "echo $mrif_90c > \
+ /sys/module/mdt/parameters/max_mod_rpcs_per_client"
- $LCTL set_param \
- mdc.$FSNAME-MDT0000-mdc-*.max_mod_rpcs_in_flight=$mrif &&
- error "set max_mod_rpcs_in_flight to $mrif should fail"
+ # if max_mod_rpcs_in_flight is set to be equal to or larger than
+ # max_rpcs_in_flight, then max_rpcs_in_flight will be increased
+ if [[ "$CLIENT_VERSION" -ge $(version_code 2.13.53) ]]; then
+ $LCTL set_param \
+ mdc.$FSNAME-MDT0000-mdc-*.max_mod_rpcs_in_flight=$mrif_90c ||
+ error "set max_mod_rpcs_in_flight to $mrif_90c failed"
+
+ local new_mrif=$($LCTL get_param -n \
+ mdc.$FSNAME-MDT0000-mdc-*.max_rpcs_in_flight)
+ ((new_mrif == mrif_90c + 1)) ||
+ error "max_rpcs_in_flight was not increased"
+ fi
umount_client $MOUNT
- do_facet mds1 \
- "echo $mmrpc > /sys/module/mdt/parameters/max_mod_rpcs_per_client"
+ do_facet mds1 "echo $mmrpc_90c > \
+ /sys/module/mdt/parameters/max_mod_rpcs_per_client"
mount_client $MOUNT
# testcase 2
# attempt to set max_mod_rpcs_in_flight to max_mod_rpcs_per_client+1
# prerequisite: set max_rpcs_in_flight to max_mod_rpcs_per_client+2
$LCTL set_param \
- mdc.$FSNAME-MDT0000-mdc-*.max_rpcs_in_flight=$((mmrpc + 2))
+ mdc.$FSNAME-MDT0000-mdc-*.max_rpcs_in_flight=$((mmrpc_90c + 2))
$LCTL set_param \
- mdc.$FSNAME-MDT0000-mdc-*.max_mod_rpcs_in_flight=$((mmrpc + 1)) &&
- error "set max_mod_rpcs_in_flight to $((mmrpc + 1)) should fail"
+ mdc.$FSNAME-MDT0000-mdc-*.max_mod_rpcs_in_flight=$((mmrpc_90c + 1)) &&
+ error "set max_mod_rpcs_in_flight to $((mmrpc_90c + 1)) should fail"
+
+ # testcase 3
+ # attempt to set max_mod_rpcs_in_flight permanently
+ do_facet mgs $LCTL set_param -P \
+ mdc.$FSNAME-MDT0000-mdc-*.max_rpcs_in_flight=$mrif_90c
+
+ do_facet mgs $LCTL set_param -P \
+ mdc.$FSNAME-MDT0000-mdc-*.max_mod_rpcs_in_flight=$mrif_90c
+
+ remount_client $MOUNT
+
+ wait_update_facet --verbose client "$LCTL get_param -n \
+ mdc.$FSNAME-MDT0000-mdc-*.max_rpcs_in_flight" \
+ "$((mrif_90c + 1))" ||
+ error "expected '$((mrif_90c + 1))' for max_rpcs_in_flight"
+ wait_update_facet --verbose client "$LCTL get_param -n \
+ mdc.$FSNAME-MDT0000-mdc-*.max_mod_rpcs_in_flight" \
+ "$mrif_90c" ||
+ error "expected '$mrif_90c' for max_mod_rpcs_in_flight"
+
+ restore_params_90c
cleanup
}
run_test 90c "check max_mod_rpcs_in_flight update limits"
}
run_test 123ae "llog_cancel can cancel requested record"
+test_123af() { #LU-13609
+ [ "$MGS_VERSION" -ge $(version_code 2.13.54) -a \
+ "$MDS1_VERSION" -ge $(version_code 2.13.54) ] ||
+ skip "Need both MGS and MDS version at least 2.13.54"
+
+ [ -d $MOUNT/.lustre ] || setupall
+ stack_trap "do_facet mds1 $LCTL set_param fail_loc=0" EXIT
+
+ local device
+ local facet
+ local cmd
+ local orig_clist
+ local orig_count
+ local new_clist
+ local new_count
+
+ for device in "MGS" "$FSNAME-MDT0000"; do
+ cmd="--device $device llog_catlist"
+ echo "lctl $cmd ..."
+ if [ "$device" = "MGS" ]; then
+ facet="mgs"
+ else
+ facet="mds1"
+ fi
+ orig_clist=($(do_facet $facet $LCTL $cmd | awk '{ print $2 }'))
+ orig_count=${#orig_clist[@]}
+ echo "orig_clist: ${orig_clist[@]}"
+
+ #define OBD_FAIL_CATLIST 0x131b
+ #fetch to llog records from the second one
+ do_facet $facet $LCTL set_param fail_loc=0x131b fail_val=2
+
+ new_clist=($(do_facet $facet $LCTL $cmd | awk '{ print $2 }'))
+ new_count=${#new_clist[@]}
+ echo "new_clist: ${new_clist[@]}"
+
+ [ $new_count -eq $((orig_count - 1)) ] ||
+ error "$new_count != $orig_count - 1"
+ for i in $(seq 0 $new_count); do
+ j=$((i + 1))
+ [ "${orig_clist[$j]}" = "${new_clist[$i]}" ] ||
+ error "${orig_clist[$j]} != ${new_clist[$i]}"
+ done
+ do_facet mds1 $LCTL set_param fail_loc=0
+ echo "done"
+ done
+}
+run_test 123af "llog_catlist can show all config files correctly"
+
test_123F() {
remote_mgs_nodsh && skip "remote MGS with nodsh"