. $LUSTRE/tests/test-framework.sh
init_test_env $@
. ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
-get_lustre_env
# use small MDS + OST size to speed formatting time
# do not use too small MDSSIZE/OSTSIZE, which affect the default journal size
OSTDEV1_2=$fs2ost_DEV
OSTDEV2_2=$fs3ost_DEV
+# bug number for skipped test: LU-11915
+ALWAYS_EXCEPT="$ALWAYS_EXCEPT 110"
+
if ! combined_mgs_mds; then
- # bug number for skipped test: LU-9860 LU-9860 LU-9860
- ALWAYS_EXCEPT="$ALWAYS_EXCEPT 43b 53b 54b"
- # bug number for skipped test: LU-9875 LU-9879 LU-9879 LU-9879 LU-9879
- ALWAYS_EXCEPT="$ALWAYS_EXCEPT 70e 80 84 87 100"
- # bug number for skipped test: LU-8110 LU-9879 LU-9879 LU-9879
- ALWAYS_EXCEPT="$ALWAYS_EXCEPT 102 104 105 107"
+ # bug number for skipped test: LU-11991 LU-11990
+ ALWAYS_EXCEPT="$ALWAYS_EXCEPT 32a 32b 32c 32d 32e 66"
+ # bug number for skipped test: LU-9897 LU-12032
+ ALWAYS_EXCEPT="$ALWAYS_EXCEPT 84 123F"
fi
# pass "-E lazy_itable_init" to mke2fs to speed up the formatting time
LDISKFS_MKFS_OPTS=$(csa_add "$LDISKFS_MKFS_OPTS" -E lazy_itable_init)
fi
-[ $(facet_fstype $SINGLEMDS) = "zfs" ] &&
-# bug number for skipped test:
- ALWAYS_EXCEPT="$ALWAYS_EXCEPT"
-# UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
-
-[ $MDSCOUNT -ge 2 ] &&
-# bug number for skipped test: LU-11915
- ALWAYS_EXCEPT+=" 110"
-# UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
-
init_logging
#
}
run_test 5g "handle missing debugfs"
+test_5h() {
+ setup
+
+ stop mds1
+ #define OBD_FAIL_MDS_FS_SETUP 0x135
+ do_facet mds1 "$LCTL set_param fail_loc=0x80000135"
+ start_mdt 1 && error "start mdt should fail"
+ start_mdt 1 || error "start mdt failed"
+ client_up || error "client_up failed"
+ cleanup
+}
+run_test 5h "start mdt failure at mdt_fs_setup()"
+
+test_5i() {
+ setup
+
+ stop mds1
+ #define OBD_FAIL_QUOTA_INIT 0xA05
+ do_facet mds1 "$LCTL set_param fail_loc=0x80000A05"
+ start_mdt 1 && error "start mdt should fail"
+ start_mdt 1 || error "start mdt failed"
+ client_up || error "client_up failed"
+ cleanup
+}
+run_test 5i "start mdt failure at mdt_quota_init()"
+
test_6() {
setup
manual_umount_client
test_24b() {
local MDSDEV=$(mdsdevname ${SINGLEMDS//mds/})
+ combined_mgs_mds ||
+ skip "needs combined MGT and MDT device"
if [ -z "$fs2mds_DEV" ]; then
local dev=${SINGLEMDS}_dev
add fs2mds $(mkfs_opts mds1 ${fs2mdsdev} ) --mgs --fsname=${FSNAME}2 \
--reformat $fs2mdsdev $fs2mdsvdev || exit 10
setup
- start fs2mds $fs2mdsdev $MDS_MOUNT_OPTS &&
+ start fs2mds $fs2mdsdev $MDS_MOUNT_OPTS && {
+ cleanup
error "start MDS should fail"
+ }
stop fs2mds -f
cleanup || error "cleanup failed with rc $?"
}
run_test 24b "Multiple MGSs on a single node (should return err)"
test_25() {
- setup
+ setup_noconfig
check_mount || error "check_mount failed"
local MODULES=$($LCTL modules | awk '{ print $2 }')
rmmod $MODULES 2>/dev/null || true
run_test 26 "MDT startup failure cleans LOV (should return errs)"
test_27a() {
+ cleanup
start_ost || error "Unable to start OST1"
start_mds || error "Unable to start MDS"
echo "Requeue thread should have started: "
test_27b() {
# FIXME. ~grev
- setup
+ setup_noconfig
local device=$(do_facet $SINGLEMDS "$LCTL get_param -n devices" |
awk '($3 ~ "mdt" && $4 ~ "MDT0000") { print $4 }')
run_test 27b "Reacquire MGS lock after failover"
test_28A() { # was test_28
- setup
- TEST="llite.$FSNAME-*.max_read_ahead_whole_mb"
- PARAM="$FSNAME.llite.max_read_ahead_whole_mb"
- ORIG=$($LCTL get_param -n $TEST)
- FINAL=$(($ORIG + 1))
- set_persistent_param_and_check client "$TEST" "$PARAM" $FINAL
- FINAL=$(($FINAL + 1))
- set_persistent_param_and_check client "$TEST" "$PARAM" $FINAL
+ setup_noconfig
+
+ local TEST="llite.$FSNAME-*.max_read_ahead_whole_mb"
+ local PARAM="$FSNAME.llite.max_read_ahead_whole_mb"
+ local orig=$($LCTL get_param -n $TEST)
+ local max=$($LCTL get_param -n \
+ llite.$FSNAME-*.max_read_ahead_per_file_mb)
+
+ orig=${orig%%.[0-9]*}
+ max=${max%%.[0-9]*}
+ echo "ORIG:$orig MAX:$max"
+ [[ $max -le $orig ]] && orig=$((max - 3))
+ echo "ORIG:$orig MAX:$max"
+
+ local final=$((orig + 1))
+
+ set_persistent_param_and_check client "$TEST" "$PARAM" $final
+ final=$((final + 1))
+ set_persistent_param_and_check client "$TEST" "$PARAM" $final
umount_client $MOUNT || error "umount_client $MOUNT failed"
mount_client $MOUNT || error "mount_client $MOUNT failed"
- RESULT=$($LCTL get_param -n $TEST)
- if [ $RESULT -ne $FINAL ]; then
- error "New config not seen: wanted $FINAL got $RESULT"
+
+ local result=$($LCTL get_param -n $TEST)
+
+ if [ $result -ne $final ]; then
+ error "New config not seen: wanted $final got $result"
else
- echo "New config success: got $RESULT"
+ echo "New config success: got $result"
fi
- set_persistent_param_and_check client "$TEST" "$PARAM" $ORIG
+ set_persistent_param_and_check client "$TEST" "$PARAM" $orig
cleanup || error "cleanup failed with rc $?"
}
run_test 28A "permanent parameter setting"
local new
local device="$FSNAME-OST0000"
- setup
+ setup_noconfig
# In this test we will set three kinds of proc parameters with
# lctl set_param -P or lctl conf_param:
test_29() {
[ "$OSTCOUNT" -lt "2" ] && skip_env "needs >= 2 OSTs"
- setup > /dev/null 2>&1
+ setup_noconfig > /dev/null 2>&1
start_ost2 || error "Unable to start OST2"
sleep 10
# on the MDS servers which is tested with wait_osp_* below.
# For ost_server_uuid that only exist on client so filtering
# is safe.
- local PROC_ACT="osc.$FSNAME-OST0001-osc-*.active"
- local PROC_UUID="osc.$FSNAME-OST0001-osc-[!M]*.ost_server_uuid"
+ local PROC_ACT="osc.$FSNAME-OST0001-osc-[^M]*.active"
+ local PROC_UUID="osc.$FSNAME-OST0001-osc-[^M]*.ost_server_uuid"
ACTV=$($LCTL get_param -n $PROC_ACT)
DEAC=$((1 - $ACTV))
run_test 29 "permanently remove an OST"
test_30a() {
- setup
+ setup_noconfig
echo Big config llog
TEST="llite.$FSNAME-*.max_read_ahead_whole_mb"
mount_client $MOUNT || error "mount_client $MOUNT failed"
FINAL=$($LCTL get_param -n $TEST)
echo "deleted (default) value=$FINAL, orig=$ORIG"
+ ORIG=${ORIG%%.[0-9]*}
+ FINAL=${FINAL%%.[0-9]*}
# assumes this parameter started at the default value
[ "$FINAL" -eq "$ORIG" ] || fail "Deleted value=$FINAL, orig=$ORIG"
run_test 30a "Big config llog and permanent parameter deletion"
test_30b() {
- setup
+ setup_noconfig
local orignids=$($LCTL get_param -n \
osc.$FSNAME-OST0000-osc-[^M]*.import | grep failover_nids)
local fs2ostvdev=$(ostvdevname 1_2)
local fs3ostvdev=$(ostvdevname 2_2)
+ load_modules
add fs2mds $(mkfs_opts mds1 ${fs2mdsdev}) --mgs --fsname=${FSNAME2} \
--reformat $fs2mdsdev $fs2mdsvdev || exit 10
# XXX after we support non 4K disk blocksize in ldiskfs, specify a
if ! do_facet $SINGLEMDS test -b $mdsdev; then
opts=$(csa_add "$opts" -o loop)
fi
+
+ load_modules
mount_op=$(do_facet $SINGLEMDS mount -v -t lustre $opts \
$mdsdev_sym $mntpt 2>&1)
rc=${PIPESTATUS[0]}
then
count=28 # hard coded of RPC protocol
elif [ $(facet_fstype $SINGLEMDS) != ldiskfs ]; then
- count=4000 # max_num 4091 max_ea_size = 32768
+ count=4000 # max_num 4091 max_ea_size = ~65536
elif ! large_xattr_enabled; then
count=450 # max_num 497 max_ea_size = 4012
else
- count=4500 # max_num 8187 max_ea_size = 1048492
+ count=4500 # max_num 8187 max_ea_size = 65452
# not create too much (>5000) to save test time
fi
stopall
done
- reformat
+ reformat_and_config
}
run_test 55 "check lov_objid size"
stopall
MDSJOURNALSIZE=$mds_journal_size_orig
- reformat
+ reformat_and_config
}
run_test 56a "check big OST indexes and out-of-index-order start"
stop mds2
stop mds3
stopall
- reformat
+ reformat_and_config
}
test_56b() {
error "tunefs failed"
start_mgsmds
start_ost && error "OST registration from failnode should fail"
- reformat
+ cleanup
}
run_test 57a "initial registration from failnode should fail (should return errs)"
error "tunefs failed"
start_mgsmds
start_ost || error "OST registration from servicenode should not fail"
- reformat
+ cleanup
}
run_test 57b "initial registration from servicenode should not fail"
# restart MDS with missing llog files
start_mds || error "unable to start MDS"
do_facet $SINGLEMDS "$LCTL set_param fail_loc=0"
- reformat
+ cleanup
}
run_test 58 "missing llog files must not prevent MDT from mounting"
echo $dump | grep uninit_bg > /dev/null && error "uninit_bg is set"
# we set stride extended options
echo $dump | grep stride > /dev/null || error "stride is not set"
- reformat
+ stop_mds
+ reformat_and_config
}
run_test 60 "check mkfs.lustre --mkfsoptions -E -O options setting"
test_61() { # LU-80
- local lxattr=false
+ local lxattr=$(large_xattr_enabled)
[ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.1.53) ] ||
skip "Need MDS version at least 2.1.53"
done
fi
- combined_mgs_mds || stop_mgs || error "stopping MGS service failed"
- setup_noconfig || error "setting up the filesystem failed"
+ setup || error "setting up the filesystem failed"
client_up || error "starting client failed"
local file=$DIR/$tfile
log "remove large xattr $name from $file"
setfattr -x $name $file || error "removing $name from $file failed"
- if $lxattr; then
+ if $lxattr && [ $(facet_fstype $SINGLEMDS) == ldiskfs ]; then
stopall || error "stopping for e2fsck run"
for num in $(seq $MDSCOUNT); do
run_e2fsck $(facet_active_host mds$num) \
# need to delete this file to avoid problems in other tests
rm -f $file
- stopall || error "stopping systems failed"
+ cleanup || error "stopping systems failed"
}
run_test 61 "large xattr"
# If kmalloc-128 is also 1 per page - this is a debug kernel
# and so this is not an error.
local kmalloc128=$(do_facet $SINGLEMDS "cat /proc/slabinfo" |
- awk '/^(kmalloc|size)-128 / { print $5 / $6 }')
+ awk '/^(dma-kmalloc|size)-128 / { print $5 / $6 }')
# 32 128-byte chunks in 4k
[ "${kmalloc128%.*}" -lt "32" ] ||
error "ldiskfs inode too big, only $inode_slab objs/page, " \
check_mount || error "error after nid replace"
cleanup || error "cleanup failed"
- reformat
+ reformat_and_config
}
run_test 66 "replace nids"
umount_client $MOUNT || error "umount client failed"
- if ! combined_mgs_mds; then
- start_mgs || error "start mgs failed"
- fi
-
- start_mdt 1 || error "MDT start failed"
- start_ost || error "Unable to start OST1"
+ start_mgsmds
+ start_ost
# START-END - the sequences we'll be reserving
START=$(do_facet $SINGLEMDS \
[ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.7.62) ] ||
skip "Need MDS version at least 2.7.62"
- cleanup || error "cleanup failed with $?"
+ reformat || error "reformat failed with $?"
+
+ load_modules
local mdsdev=$(mdsdevname 1)
local ostdev=$(ostdevname 1)
local opts_mds="$(mkfs_opts mds1 $mdsdev) --reformat $mdsdev $mdsvdev"
local opts_ost="$(mkfs_opts ost1 $ostdev) --reformat $ostdev $ostvdev"
+ if ! combined_mgs_mds ; then
+ start_mgs
+ fi
+
add mds1 $opts_mds || error "add mds1 failed"
start_mdt 1 || error "start mdt1 failed"
add ost1 $opts_ost || error "add ost1 failed"
local fn=3
local add_options
+ cleanup
+ load_modules
+
if combined_mgs_mds; then
add_options='--reformat'
else
$LCTL get_param -n osc.*OST0000-osc-[^M]*.import | grep failover_nids |
grep 1.2.3.4@$NETTYPE || error "failover nids haven't changed"
umount_client $MOUNT || error "umount client failed"
- stopall
- reformat
+ stop_ost
+ stop_mds
}
run_test 73 "failnode to update from mountdata properly"
local index=0
local opts_mds="$(mkfs_opts mds1 $(mdsdevname 1)) \
- --reformat $(mdsdevname 1) $(mdsvdevname 1)"
+ --replace --reformat $(mdsdevname 1) $(mdsvdevname 1)"
local opts_ost="$(mkfs_opts ost1 $(ostdevname 1)) \
- --reformat $(ostdevname 1) $(ostvdevname 1)"
+ --replace --reformat $(ostdevname 1) $(ostvdevname 1)"
#check with default parameters
add mds1 $opts_mds || error "add mds1 failed for default params"
add mds1 $opts_mds || error "add mds1 failed for new params"
add ost1 $opts_ost || error "add ost1 failed for new params"
- if ! combined_mgs_mds; then
- stop_mgs || error "stop mgs failed"
- fi
- reformat
+
+ reformat_and_config
return 0
}
run_test 75 "The order of --index should be irrelevant"
[[ $(lustre_version_code mgs) -ge $(version_code 2.4.52) ]] ||
skip "Need MDS version at least 2.4.52"
- if ! combined_mgs_mds; then
- start_mgs || error "start mgs failed"
- fi
setup
local MDMB_PARAM="osc.*.max_dirty_mb"
echo "Change MGS params"
# check whether the MDT or OST filesystem was shrunk or not
if ! $shrunk; then
combined_mgs_mds || stop_mgs || error "(9) stop mgs failed"
- reformat || error "(10) reformat Lustre filesystem failed"
+ reformat_and_config ||
+ error "(10) reformat Lustre filesystem failed"
return 0
fi
MDSCOUNT=$saved_MDSCOUNT
OSTCOUNT=$saved_OSTCOUNT
- reformat || error "(14) reformat Lustre filesystem failed"
+ reformat_and_config || error "(14) reformat Lustre filesystem failed"
}
run_test 78 "run resize2fs on MDT and OST filesystems"
if ( $i ~ "--mgsnode" ) { print $i; break } }')
[ -n $mgsnode_opt ] &&
opts_ost1=$(echo $opts_ost1 | sed -e "s/$mgsnode_opt//")
-
+ load_modules
# -MGS, format a mdt without --mgs option
add mds1 $opts_mds1 $mdsdev1 $mdsvdev1 &&
error "Must specify --mgs when formatting mdt combined with mgs"
add ost1 $opts_ost1 $ostdev1 $ostvdev2 &&
error "Must specify --mgsnode when formatting an ost"
- reformat
+ reformat_and_config
}
run_test 79 "format MDT/OST without mgs option (should return errors)"
start_ost2 || error "Failed to start OST2"
do_facet ost1 "$LCTL set_param fail_loc=0"
- stopall
+ stop_ost2
+ stop_ost
+ stop_mds
}
run_test 80 "mgc import reconnect race"
done
OSTCOUNT=$saved_ostcount
- formatall
+ reformat
+ if ! combined_mgs_mds ; then
+ start_mgs
+ fi
}
# The main purpose of this test is to ensure the OST_INDEX_LIST functions as
# Check max_easize.
local max_easize=$($LCTL get_param -n llite.*.max_easize)
- [[ $max_easize -eq 128 ]] ||
- error "max_easize is $max_easize, should be 128 bytes"
+ if [ $MDS1_VERSION -lt $(version_code 2.12.51) ]
+ then
+ [[ $max_easize -eq 128 ]] ||
+ error "max_easize is $max_easize, should be 128 bytes"
+ else
+ # LU-11868
+ # 4012 is 4096 - ldiskfs ea overhead
+ [[ $max_easize -ge 4012 ]] ||
+ error "max_easize is $max_easize, should be at least 4012 bytes"
+
+ # 65452 is XATTR_SIZE_MAX - ldiskfs ea overhead
+ if large_xattr_enabled;
+ then
+ [[ $max_easize -ge 65452 ]] ||
+ error "max_easize is $max_easize, should be at least 65452 bytes"
+ fi
+ fi
restore_ostindex
}
err=$(do_facet ost1 dmesg | grep "VFS: Busy inodes after unmount of")
echo "string err $err"
[ -z "$err" ] || error $err
- reformat
+ reformat_and_config
}
run_test 83 "ENOSPACE on OST doesn't cause message VFS: \
Busy inodes after unmount ..."
unload_modules
reformat
+ if ! combined_mgs_mds ; then
+ start_mgs
+ fi
+
add mds1 $(mkfs_opts mds1 ${mdsdev}) --stripe-count-hint=$stripe_cnt \
--reformat $mdsdev $mdsvdev || error "add mds1 failed"
start_mdt 1 > /dev/null || error "start mdt1 failed"
more than $left_size-byte space left in inode."
echo "Verified: at most $left_size-byte space left in inode."
- stopall
+ umount_ldiskfs $SINGLEMDS
+
+ for i in $(seq $OSTCOUNT); do
+ stop ost$i -f || error "stop ost$i failed"
+ done
}
run_test 87 "check if MDT inode can hold EAs with N stripes properly"
[ $(echo $params | tr ' ' '\n') == "$key=$val1" ] ||
error "on-disk param not added correctly with --erase-params"
- reformat
+ reformat_and_config
}
run_test 89 "check tunefs --param and --erase-param{s} options"
}
test_90a() {
- reformat
- if ! combined_mgs_mds ; then
- start_mgs
- fi
setup
[[ $($LCTL get_param mdc.*.import |
echo "params: $opts"
+ load_modules
add ost1 $opts || error "add ost1 failed with new params"
do_facet ost1 $DEBUGFS -c -R stats `ostdevname 1` | grep "meta_bg" ||
error "meta_bg is not set"
-
- reformat
}
run_test 99 "Adding meta_bg option"
test_100() {
reformat
- start_mds || error "MDS start failed"
+
+ start_mgsmds || error "MDS start failed"
start_ost || error "unable to start OST"
mount_client $MOUNT || error "client start failed"
check_mount || error "check_mount failed"
test_102() {
[[ $(lustre_version_code $SINGLEMDS) -gt $(version_code 2.9.53) ]] ||
skip "Need server version greater than 2.9.53"
+ [[ “$(mdsdevname 1)” != “$(mgsdevname)” ]] &&
+ [[ “$(facet_host mds1)” = “$(facet_host mgs)” ]] &&
+ skip "MGS must be on different node or combined"
+
cleanup || error "cleanup failed with $?"
local mds1dev=$(mdsdevname 1)
#reformat/remount the MDT to apply the MDT_MOUNT_FS_OPT options
formatall
+ if ! combined_mgs_mds ; then
+ start_mgs
+ fi
+
if [ -z "$MDS_MOUNT_OPTS" ]; then
MDS_MOUNT_OPTS="-o noacl"
else
MDS_MOUNT_OPTS=$mds_mountopts
OST_MOUNT_OPTS=$ost_mountopts
MDS_MOUNT_FS_OPTS=$mds_mountfsopts
-
- formatall
- setupall
}
run_test 104 "Make sure user defined options are reflected in mount"
test_105() {
cleanup -f
reformat
- setup
+ setup_noconfig
mkdir -p $TMP/$tdir
mount --bind $DIR $TMP/$tdir || error "mount bind mnt pt failed"
rm -f $TMP/$tdir/$tfile
local repeat=5
reformat
- setupall
+ setup_noconfig
mkdir -p $DIR/$tdir || error "create $tdir failed"
lfs setstripe -c 1 -i 0 $DIR/$tdir
#define OBD_FAIL_CAT_RECORDS 0x1312
#shows that osp code is buggy
do_facet mds1 $LCTL set_param fail_loc=0 fail_val=0
- stopall
+ cleanup
}
run_test 106 "check osp llog processing when catalog is wrapped"
local mgsdev
if ! combined_mgs_mds ; then
- mgsdev=$MGSDEV
+ mgsdev=$(mgsdevname)
stop_mgs || error "stop_mgs failed"
start_mgs "-o nosvc" || error "start_mgs nosvc failed"
else
test_109a()
{
+ [ $MDS1_VERSION -lt $(version_code 2.10.59) ] &&
+ skip "Needs MDS version 2.10.59 or later."
[ "$(facet_fstype mgs)" == "zfs" ] &&
skip "LU-8727: no implementation for ZFS"
+
stopall
reformat
setup_noconfig
client_up || error "client_up failed"
+ #pool commands requires a client on MGS for procfs interfaces
+ if ! combined_mgs_mds ; then
+ mount_mgs_client
+ stack_trap umount_mgs_client EXIT
+ fi
#
# set number of permanent parameters
#
test_109_set_params $FSNAME
+ combined_mgs_mds || umount_mgs_client
umount_client $MOUNT || error "umount_client failed"
stop_ost || error "stop_ost failed"
stop_mds || error "stop_mds failed"
error "failed to clear client config"
setup_noconfig
+ combined_mgs_mds || mount_mgs_client
#
# check that configurations are intact
#
destroy_test_pools || error "destroy test pools failed"
+ combined_mgs_mds || umount_mgs_client
cleanup
}
run_test 109a "test lctl clear_conf fsname"
test_109b()
{
+ [ $MDS1_VERSION -lt $(version_code 2.10.59) ] &&
+ skip "Needs MDS version 2.10.59 or later."
[ "$(facet_fstype mgs)" == "zfs" ] &&
skip "LU-8727: no implementation for ZFS"
+
stopall
reformat
setup_noconfig
client_up || error "client_up failed"
+ #pool commands requires a client on MGS for procfs interfaces
+ if ! combined_mgs_mds ; then
+ mount_mgs_client
+ stack_trap umount_mgs_client EXIT
+ fi
#
# set number of permanent parameters
#
test_109_set_params $FSNAME
+ combined_mgs_mds || umount_mgs_client
umount_client $MOUNT || error "umount_client failed"
stop_ost || error "stop_ost failed"
stop_mds || error "stop_mds failed"
error "failed to clear client config"
setup_noconfig
-
+ combined_mgs_mds || mount_mgs_client
#
# check that configurations are intact
#
#
destroy_test_pools || error "destroy test pools failed"
+ combined_mgs_mds || umount_mgs_client
cleanup
}
run_test 109b "test lctl clear_conf one config"
skip "large_dir option is not supported on OSS"
stopall # stop all targets before modifying the target counts
- stack_trap "MDSCOUNT=$MDSCOUNT OSTCOUNT=$OSTCOUNT" EXIT
+ local old_mdscount=$MDSCOUNT
+ local old_ostcount=$OSTCOUNT
+ local replace=""
+ stack_trap "MDSCOUNT=$old_mdscount OSTCOUNT=$old_ostcount" EXIT
MDSCOUNT=1
OSTCOUNT=1
(( MDSSIZE < CONF_SANITY_110_LINKS / 3 * 4/3 * 4/3 )) &&
CONF_SANITY_110_LINKS=$((MDSSIZE * 3 * 3/4 * 3/4))
+ combined_mgs_mds || replace=" --replace "
local opts="$(mkfs_opts mds1 $(mdsdevname 1)) \
- --reformat $(mdsdevname 1) $(mdsvdevname 1)"
+ $replace --reformat $(mdsdevname 1) $(mdsvdevname 1)"
if [[ $opts != *mkfsoptions* ]]; then
opts+=" --mkfsoptions=\\\"-O large_dir -b 1024 -i 65536\\\""
else
--mkfsoptions=\\\"-O large_dir -b 1024 -i 65536 }"
fi
echo "MDT params: $opts"
+ load_modules
+ combined_mgs_mds || start_mgs
add mds1 $opts || error "add mds1 failed with new params"
start mds1 $(mdsdevname 1) $MDS_MOUNT_OPTS
opts="$(mkfs_opts ost1 $(ostdevname 1)) \
- --reformat $(ostdevname 1) $(ostvdevname 1)"
+ $replace --reformat $(ostdevname 1) $(ostvdevname 1)"
if [[ $opts != *mkfsoptions* ]]; then
opts+=" --mkfsoptions=\\\"-O large_dir\\\" "
echo "waiting for PIDs$pids to complete"
wait $pids || error "createmany failed after $group groups"
+ umount_client $MOUNT2 -f
cleanup
run_e2fsck $(facet_active_host mds1) $(mdsdevname 1) -n
+ MDSCOUNT=$old_mdscount
+ OSTCOUNT=$old_ostcount
}
run_test 110 "Adding large_dir with 3-level htree"
# cleanup before changing target counts
cleanup
+ local old_mdscount=$MDSCOUNT
+ local old_ostcount=$OSTCOUNT
+ local old_mdssize=$MDSSIZE
+ local replace=""
stack_trap "MDSSIZE=$MDSSIZE MDSCOUNT=$MDSCOUNT OSTCOUNT=$OSTCOUNT" EXIT
MDSCOUNT=1
OSTCOUNT=1
(( MDSSIZE < 2400000 )) && MDSSIZE=2400000 # need at least 2.4GB
local mdsdev=$(mdsdevname 1)
-
+ combined_mgs_mds || replace=" --replace "
local opts="$(mkfs_opts mds1 $(mdsdevname 1)) \
- --reformat $(mdsdevname 1) $(mdsvdevname 1)"
+ $replace --reformat $(mdsdevname 1) $(mdsvdevname 1)"
if [[ $opts != *mkfsoptions* ]]; then
opts+=" --mkfsoptions=\\\"-O large_dir -i 1048576 \\\" "
else
--mkfsoptions=\\\"-O large_dir -i 1048576 }"
fi
echo "MDT params: $opts"
+ load_modules
+ combined_mgs_mds || start_mgs
__touch_device mds 1
add mds1 $opts || error "add mds1 failed with new params"
start mds1 $(mdsdevname 1) $MDS_MOUNT_OPTS
opts="$(mkfs_opts ost1 $(ostdevname 1)) \
- --reformat $(ostdevname 1) $(ostvdevname 1)"
+ $replace --reformat $(ostdevname 1) $(ostvdevname 1)"
if [[ $opts != *mkfsoptions* ]]; then
opts+=" --mkfsoptions=\\\"-O large_dir \\\""
else
(( left > 1200 )) && needskip=1
done
+ umount_client $MOUNT2 -f
cleanup
(( $needskip )) && skip "ETA ${left}s after $num files / ${taken}s is too long"
run_e2fsck $(facet_active_host mds1) $(mdsdevname 1) -n
+ MDSCOUNT=$old_mdscount
+ OSTCOUNT=$old_ostcount
+ MDSSIZE=$old_mdssize
}
run_test 111 "Adding large_dir with over 2GB directory"
trap 0
stopall
rm -f $TMP/$tdir/lustre-mdt
- formatall
+ reformat_and_config
}
test_115() {
do_facet $SINGLEMDS $TUNE2FS -l $tmpmnt/$mdtimg |
grep -qw 'features.*extent' || error "extent should be enabled"
+ reformat_and_config
}
run_test 116 "big size MDT support"
#define OBD_FAIL_OFD_SET_OID 0x1e0
do_facet ost1 $LCTL set_param fail_loc=0x00001e0
- setupall
+ setup_noconfig
$LFS mkdir -i1 -c1 $DIR/$tdir
$LFS setstripe -i0 -c1 $DIR/$tdir
do_facet ost1 $LCTL set_param fail_loc=0
createmany -o $DIR/$tdir/file_ 1000 ||
error "Fail to create a new sequence"
- reformat
+ cleanup
}
run_test 122 "Check OST sequence update"
test_123aa() {
remote_mgs_nodsh && skip "remote MGS with nodsh"
- [ -d $MOUNT/.lustre ] || setupall
+ [ -d $MOUNT/.lustre ] || setup
# test old logid format until removal from llog_ioctl.c::str2logid()
if [ $MGS_VERSION -lt $(version_code 3.1.53) ]; then
[[ $MGS_VERSION -gt $(version_code 2.11.51) ]] ||
skip "Need server with working llog_print support"
- [ -d $MOUNT/.lustre ] || setupall
+ [ -d $MOUNT/.lustre ] || setup
local yaml
local orig_val
local start=10
local end=50
- [ -d $MOUNT/.lustre ] || setupall
+ [ -d $MOUNT/.lustre ] || setup
# - { index: 10, event: add_uuid, nid: 192.168.20.1@tcp(0x20000c0a81401,
# node: 192.168.20.1@tcp }
do_facet mgs "$LCTL help llog_print" 2>&1 | grep -q -- --start ||
skip "Need 'lctl llog_print --start' on MGS"
- [ -d $MOUNT/.lustre ] || setupall
+ [ -d $MOUNT/.lustre ] || setup
# append a new record, to avoid issues if last record was cancelled
local old=$($LCTL get_param -n osc.*-OST0000-*.max_dirty_mb | head -1)
}
run_test 123ad "llog_print shows all records"
+test_123ae() { # LU-11566
+ remote_mgs_nodsh && skip "remote MGS with nodsh"
+ [ -d $MOUNT/.lustre ] || setupall
+
+ local max=$($LCTL get_param -n osc.*-OST0000-*.max_dirty_mb | head -1)
+
+ if do_facet mgs "$LCTL help llog_cancel" 2>&1| grep -q -- --log_id; then
+ # save one set_param -P record in case none exist
+ do_facet mgs $LCTL set_param -P osc.*.max_dirty_mb=$max
+
+ local log=params
+ local orig=$(do_facet mgs $LCTL --device MGS llog_print $log |
+ tail -1 | awk '{ print $4 }' | tr -d , )
+ do_facet mgs $LCTL set_param -P osc.*.max_dirty_mb=$max
+ do_facet mgs $LCTL --device MGS llog_print $log | tail -1 |
+ grep "parameter: osc.*.max_dirty_mb" ||
+ error "new set_param -P wasn't stored in params log"
+
+ # - { index: 71, event: set_param, device: general,
+ # param: osc.*.max_dirty_mb, value: 256 }
+ local id=$(do_facet mgs $LCTL --device MGS llog_print $log |
+ tail -1 | awk '{ print $4 }' | tr -d , )
+
+ do_facet mgs $LCTL --device MGS llog_cancel $log --log_idx=$id
+ local new=$(do_facet mgs $LCTL --device MGS llog_print $log |
+ tail -1 | awk '{ print $4 }' | tr -d , )
+ (( new == orig )) ||
+ error "new llog_cancel now $new, not at $orig records"
+ fi
+
+ # test old positional parameters for a while still
+ if [ $(lustre_version_code mgs) -le $(version_code 3.1.53) ]; then
+ log=$FSNAME-client
+ orig=$(do_facet mgs $LCTL --device MGS llog_print $log |
+ tail -1 | awk '{ print $4 }' | tr -d , )
+ do_facet mgs $LCTL conf_param $FSNAME-OST0000.osc.max_dirty_mb=$max
+ do_facet mgs $LCTL --device MGS llog_print $log |
+ tail -1 | grep "parameter: osc.max_dirty_mb" ||
+ error "old conf_param wasn't stored in params log"
+
+ # - { index: 71, event: conf_param, device: testfs-OST0000-osc,
+ # param: osc.max_dirty_mb=256 }
+ id=$(do_facet mgs $LCTL --device MGS llog_print $log |
+ tail -1 | awk '{ print $4 }' | tr -d , )
+ do_facet mgs $LCTL --device MGS llog_cancel $log $id
+ new=$(do_facet mgs $LCTL --device MGS llog_print $log |
+ tail -1 | awk '{ print $4 }' | tr -d , )
+ (( new == orig )) ||
+ error "old llog_cancel now $new, not at $orig records"
+ fi
+}
+run_test 123ae "llog_cancel can cancel requested record"
+
test_123F() {
- setupall
+ remote_mgs_nodsh && skip "remote MGS with nodsh"
+
+ [ -d $MOUNT/.lustre ] || setup
local yaml_file="$TMP/$tfile.yaml"
do_facet mgs rm "$yaml_file"
local cfgfiles=$(do_facet mgs "lctl --device MGS llog_catlist" |
error "$set_val is not testname"
do_facet mgs rm "$yaml_file"
+ cleanup
}
run_test 123F "clear and reset all parameters using set_param -F"
}
run_test 124 "check failover after replace_nids"
+get_max_sectors_kb() {
+ local facet="$1"
+ local device="$2"
+ local dev_base=$(basename $(do_facet ${facet} "readlink -f ${device}"))
+ local max_sectors_path="/sys/block/${dev_base}/queue/max_sectors_kb"
+
+ do_facet ${facet} "[[ -e ${max_sectors_path} ]] &&
+ cat ${max_sectors_path}"
+}
+
+get_max_hw_sectors_kb() {
+ local facet="$1"
+ local device="$2"
+ local dev_base=$(basename $(do_facet ${facet} "readlink -f ${device}"))
+ local max_hw_path="/sys/block/${dev_base}/queue/max_hw_sectors_kb"
+
+ do_facet ${facet} "[[ -e ${max_hw_path} ]] && cat ${max_hw_path}"
+}
+
+set_max_sectors_kb() {
+ local facet="$1"
+ local device="$2"
+ local value="$3"
+ local dev_base=$(basename $(do_facet ${facet} "readlink -f ${device}"))
+ local max_sectors_path="/sys/block/${dev_base}/queue/max_sectors_kb"
+
+ do_facet ${facet} "[[ -e ${max_sectors_path} ]] &&
+ echo ${value} > ${max_sectors_path}"
+ rc=$?
+
+ [[ $rc -ne 0 ]] && echo "Failed to set ${max_sectors_path} to ${value}"
+
+ return $rc
+}
+
+# Return 0 if all slave devices have max_sectors_kb == max_hw_sectors_kb
+# Otherwise return > 0
+check_slaves_max_sectors_kb()
+{
+ local facet="$1"
+ local device="$2"
+ local dev_base=$(basename $(do_facet ${facet} "readlink -f ${device}"))
+ local slaves_dir=/sys/block/${dev_base}/slaves
+ local slave_devices=$(do_facet ${facet} "ls ${slaves_dir} 2>/dev/null")
+ [[ -z ${slave_devices} ]] && return 0
+
+ local slave max_sectors new_max_sectors max_hw_sectors path
+ local rc=0
+ for slave in ${slave_devices}; do
+ path="/dev/${slave}"
+ ! is_blkdev ${facet} ${path} && continue
+ max_sectors=$(get_max_sectors_kb ${facet} ${path})
+ max_hw_sectors=$(get_max_hw_sectors_kb ${facet} ${path})
+ new_max_sectors=${max_hw_sectors}
+ [[ ${new_max_sectors} -gt ${RQ_SIZE_LIMIT} ]] &&
+ new_max_sectors=${RQ_SIZE_LIMIT}
+
+ if [[ ${max_sectors} -ne ${new_max_sectors} ]]; then
+ echo "${path} ${max_sectors} ${new_max_sectors}"
+ ((rc++))
+ fi
+ check_slaves_max_sectors_kb ${facet} ${path}
+ ((rc + $?))
+ done
+
+ return $rc
+}
+
+test_125()
+{
+ local facet_list="mgs mds1 ost1"
+ combined_mgs_mds && facet_list="mgs ost1"
+
+ local facet
+ for facet in ${facet_list}; do
+ [[ $(facet_fstype ${facet}) != ldiskfs ]] &&
+ skip "ldiskfs only test" &&
+ return 0
+ ! is_blkdev ${facet} $(facet_device ${facet}) &&
+ skip "requires all real devices" &&
+ return 0
+ done
+
+ local rc=0
+ # We don't increase IO request size limit past 16MB. See comments in
+ # lustre/utils/libmount_utils_ldiskfs.c:tune_max_sectors_kb()
+ RQ_SIZE_LIMIT=$((16 * 1024))
+ local device old_max_sectors new_max_sectors max_hw_sectors
+ for facet in ${facet_list}; do
+ device=$(facet_device ${facet})
+ old_max_sectors=$(get_max_sectors_kb ${facet} ${device})
+ max_hw_sectors=$(get_max_hw_sectors_kb ${facet} ${device})
+
+ # The expected value after l_tunedisk is executed
+ new_max_sectors=$old_max_sectors
+ [[ ${new_max_sectors_kb} -gt ${RQ_SIZE_LIMIT} ]] &&
+ new_max_sectors_kb=${RQ_SIZE_LIMIT}
+
+ # Ensure the current value of max_sectors_kb does not equal
+ # max_hw_sectors_kb, so we can tell whether l_tunedisk did
+ # anything
+ set_max_sectors_kb ${facet} ${device} $((new_max_sectors - 1))
+
+ # Value before l_tunedisk
+ local pre_max_sectors=$(get_max_sectors_kb ${facet} ${device})
+ if [[ ${pre_max_sectors} -ne $((new_max_sectors - 1)) ]]; then
+ echo "unable to satsify test pre-condition:"
+ echo "${pre_max_sectors} != $((new_max_sectors - 1))"
+ ((rc++))
+ continue
+ fi
+
+ echo "Before: ${facet} ${device} ${pre_max_sectors} ${max_hw_sectors}"
+
+ do_facet ${facet} "libtool execute l_tunedisk ${device}"
+
+ # Value after l_tunedisk
+ local post_max_sectors=$(get_max_sectors_kb ${facet} ${device})
+
+ echo "After: ${facet} ${device} ${post_max_sectors} ${max_hw_sectors}"
+
+ if [[ ${facet} != ost1 ]]; then
+ if [[ ${post_max_sectors} -ne ${pre_max_sectors} ]]; then
+ echo "l_tunedisk modified max_sectors_kb of ${facet}"
+ ((rc++))
+ fi
+
+ set_max_sectors_kb ${facet} ${device} ${old_max_sectors}
+ else
+ if [[ ${post_max_sectors} -eq ${pre_max_sectors} ]]; then
+ echo "l_tunedisk failed to modify max_sectors_kb of ${facet}"
+ ((rc++))
+ fi
+
+ check_slaves_max_sectors_kb ${facet} ${device} ||
+ ((rc++))
+ fi
+ done
+
+ return $rc
+}
+run_test 125 "check l_tunedisk only tunes OSTs and their slave devices"
+
if ! combined_mgs_mds ; then
stop mgs
fi