Patch fixes the following test_mkdir() defects:
- test_mkdir() always creates striped dir, this breaks interop
testing with non DNEII servers. For old servers stripe count
is supposed to be set to 1. The tests which call
test_mkdir() -c <value>, where <value> is greater than 1 should
take care about interop with old servers and be skipped for
such servers.
- test_mkdir() creates the striped dir with -c2 only, this limits
the testing on MDSCOUNT > 2 config.
Patch adds the possibilities:
- to specify the exact stripe count if DIRSTRIPE_COUNT set;
default is random and does not depend on the test number now.
- to specify the exact stripe index if DIRSTRIPE_INDEX set;
default is not changed (random).
- set stripe count to 1 for servers without DNE2 (< 2.8.0).
Patch moves get_lustre_env call (added by LU-11607) from sanity.sh,
conf-sanity.sh and sanity-quota.sh to init_logging(). This allows
$MDS1_VERSION to be used in test_mkdir() instead of having to add
get_lustre_env() to every test script test_mkdir() is used in.
Patch does fix sanity 120a(), 120f() to operate with predictable
MDT index. We did not see this failure before test_mkdir()
improvements because tests were never run with mdt_index other
than equal to 0: the randomization
mdt_index=$((test_num % MDSCOUNT))
had set mdt_index equal to 0 for MDSCOUNT {1..6} for these tests.
Patch fixes sanity-scrub.sh:scrub_prep() to create $nfiles on mds$n
and sanity-scrub.sh:test_11() to create $CREATED files on each mds.
Signed-off-by: Elena Gryaznova <c17455@cray.com>
Cray-bug-id: LUS-6434, LUS-5500, LUS-6697
Reviewed-by: Vladimir Saveliev <c17830@cray.com>
Reviewed-by: Alexander Boyko <c17825@cray.com>
Change-Id: I3e6362a0b7c1d3987a289e492c8e9ad090f394d4
Reviewed-on: https://review.whamcloud.com/33611
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Alexandr Boyko <c17825@cray.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
. $LUSTRE/tests/test-framework.sh
init_test_env $@
. ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
. $LUSTRE/tests/test-framework.sh
init_test_env $@
. ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
# use small MDS + OST size to speed formatting time
# do not use too small MDSSIZE/OSTSIZE, which affect the default journal size
# use small MDS + OST size to speed formatting time
# do not use too small MDSSIZE/OSTSIZE, which affect the default journal size
MMAP_CAT=${MMAP_CAT:-mmap_cat}
MOUNT_2=${MOUNT_2:-"yes"}
FAIL_ON_ERROR=false
MMAP_CAT=${MMAP_CAT:-mmap_cat}
MOUNT_2=${MOUNT_2:-"yes"}
FAIL_ON_ERROR=false
-MDS_VERSION_CODE=$(lustre_version_code $SINGLEMDS)
# script only handles up to 10 MDTs (because of MDT_PREFIX)
[ $MDSCOUNT -gt 9 ] &&
# script only handles up to 10 MDTs (because of MDT_PREFIX)
[ $MDSCOUNT -gt 9 ] &&
-if [[ $MDS_VERSION_CODE -lt $(version_code 2.4.53) ]]; then
+if [[ $MDS1_VERSION -lt $(version_code 2.4.53) ]]; then
skip_env "Need MDS version at least 2.4.53"
fi
skip_env "Need MDS version at least 2.4.53"
fi
. $LUSTRE/tests/test-framework.sh
init_test_env $@
. ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
. $LUSTRE/tests/test-framework.sh
init_test_env $@
. ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
init_logging
DIRECTIO=${DIRECTIO:-$LUSTRE/tests/directio}
init_logging
DIRECTIO=${DIRECTIO:-$LUSTRE/tests/directio}
echo "preparing... $(date)"
for n in $(seq $MDSCOUNT); do
echo "creating $nfiles files on mds$n"
echo "preparing... $(date)"
for n in $(seq $MDSCOUNT); do
echo "creating $nfiles files on mds$n"
- test_mkdir -i $((n - 1)) $DIR/$tdir/mds$n ||
+ test_mkdir -i $((n - 1)) -c1 $DIR/$tdir/mds$n ||
error "Failed to create directory mds$n"
cp $LUSTRE/tests/*.sh $DIR/$tdir/mds$n ||
error "Failed to copy files to mds$n"
error "Failed to create directory mds$n"
cp $LUSTRE/tests/*.sh $DIR/$tdir/mds$n ||
error "Failed to copy files to mds$n"
check_mount_and_prep
for n in $(seq $MDSCOUNT); do
check_mount_and_prep
for n in $(seq $MDSCOUNT); do
- test_mkdir -i $((n - 1)) $DIR/$tdir/mds$n ||
+ test_mkdir -i $((n - 1)) -c1 $DIR/$tdir/mds$n ||
error "(1) Fail to mkdir $DIR/$tdir/mds$n"
createmany -o $DIR/$tdir/mds$n/f $CREATED ||
error "(1) Fail to mkdir $DIR/$tdir/mds$n"
createmany -o $DIR/$tdir/mds$n/f $CREATED ||
. $LUSTRE/tests/test-framework.sh
init_test_env $@
. ${CONFIG:=$LUSTRE/tests/cfg/${NAME}.sh}
. $LUSTRE/tests/test-framework.sh
init_test_env $@
. ${CONFIG:=$LUSTRE/tests/cfg/${NAME}.sh}
init_logging
# 5 12 (min)"
init_logging
# 5 12 (min)"
test_120a() {
[ $PARALLEL == "yes" ] && skip "skip parallel run"
remote_mds_nodsh && skip "remote MDS with nodsh"
test_120a() {
[ $PARALLEL == "yes" ] && skip "skip parallel run"
remote_mds_nodsh && skip "remote MDS with nodsh"
+ test_mkdir -i0 -c1 $DIR/$tdir
$LCTL get_param -n mdc.*.connect_flags | grep -q early_lock_cancel ||
skip_env "no early lock cancel on server"
$LCTL get_param -n mdc.*.connect_flags | grep -q early_lock_cancel ||
skip_env "no early lock cancel on server"
cancel_lru_locks osc
stat $DIR/$tdir > /dev/null
cancel_lru_locks osc
stat $DIR/$tdir > /dev/null
- can1=$(do_facet $SINGLEMDS \
"$LCTL get_param -n ldlm.services.ldlm_canceld.stats" |
awk '/ldlm_cancel/ {print $2}')
blk1=$($LCTL get_param -n ldlm.services.ldlm_cbd.stats |
awk '/ldlm_bl_callback/ {print $2}')
"$LCTL get_param -n ldlm.services.ldlm_canceld.stats" |
awk '/ldlm_cancel/ {print $2}')
blk1=$($LCTL get_param -n ldlm.services.ldlm_cbd.stats |
awk '/ldlm_bl_callback/ {print $2}')
- test_mkdir -c1 $DIR/$tdir/d1
- can2=$(do_facet $SINGLEMDS \
+ test_mkdir -i0 -c1 $DIR/$tdir/d1
+ can2=$(do_facet mds1 \
"$LCTL get_param -n ldlm.services.ldlm_canceld.stats" |
awk '/ldlm_cancel/ {print $2}')
blk2=$($LCTL get_param -n ldlm.services.ldlm_cbd.stats |
"$LCTL get_param -n ldlm.services.ldlm_canceld.stats" |
awk '/ldlm_cancel/ {print $2}')
blk2=$($LCTL get_param -n ldlm.services.ldlm_cbd.stats |
test_120c() {
[ $PARALLEL == "yes" ] && skip "skip parallel run"
remote_mds_nodsh && skip "remote MDS with nodsh"
test_120c() {
[ $PARALLEL == "yes" ] && skip "skip parallel run"
remote_mds_nodsh && skip "remote MDS with nodsh"
- test_mkdir -c1 $DIR/$tdir
+ test_mkdir -i0 -c1 $DIR/$tdir
$LCTL get_param -n mdc.*.connect_flags | grep -q early_lock_cancel ||
skip "no early lock cancel on server"
lru_resize_disable mdc
lru_resize_disable osc
$LCTL get_param -n mdc.*.connect_flags | grep -q early_lock_cancel ||
skip "no early lock cancel on server"
lru_resize_disable mdc
lru_resize_disable osc
- test_mkdir -c1 $DIR/$tdir/d1
- test_mkdir -c1 $DIR/$tdir/d2
+ test_mkdir -i0 -c1 $DIR/$tdir/d1
+ test_mkdir -i0 -c1 $DIR/$tdir/d2
touch $DIR/$tdir/d1/f1
cancel_lru_locks mdc
stat $DIR/$tdir/d1 $DIR/$tdir/d2 $DIR/$tdir/d1/f1 > /dev/null
touch $DIR/$tdir/d1/f1
cancel_lru_locks mdc
stat $DIR/$tdir/d1 $DIR/$tdir/d2 $DIR/$tdir/d1/f1 > /dev/null
- can1=$(do_facet $SINGLEMDS \
"$LCTL get_param -n ldlm.services.ldlm_canceld.stats" |
awk '/ldlm_cancel/ {print $2}')
blk1=$($LCTL get_param -n ldlm.services.ldlm_cbd.stats |
awk '/ldlm_bl_callback/ {print $2}')
ln $DIR/$tdir/d1/f1 $DIR/$tdir/d2/f2
"$LCTL get_param -n ldlm.services.ldlm_canceld.stats" |
awk '/ldlm_cancel/ {print $2}')
blk1=$($LCTL get_param -n ldlm.services.ldlm_cbd.stats |
awk '/ldlm_bl_callback/ {print $2}')
ln $DIR/$tdir/d1/f1 $DIR/$tdir/d2/f2
- can2=$(do_facet $SINGLEMDS \
"$LCTL get_param -n ldlm.services.ldlm_canceld.stats" |
awk '/ldlm_cancel/ {print $2}')
blk2=$($LCTL get_param -n ldlm.services.ldlm_cbd.stats |
"$LCTL get_param -n ldlm.services.ldlm_canceld.stats" |
awk '/ldlm_cancel/ {print $2}')
blk2=$($LCTL get_param -n ldlm.services.ldlm_cbd.stats |
test_120d() {
[ $PARALLEL == "yes" ] && skip "skip parallel run"
remote_mds_nodsh && skip "remote MDS with nodsh"
test_120d() {
[ $PARALLEL == "yes" ] && skip "skip parallel run"
remote_mds_nodsh && skip "remote MDS with nodsh"
- test_mkdir -c1 $DIR/$tdir
+ test_mkdir -i0 -c1 $DIR/$tdir
$LCTL get_param -n mdc.*.connect_flags | grep -q early_lock_cancel ||
skip_env "no early lock cancel on server"
$LCTL get_param -n mdc.*.connect_flags | grep -q early_lock_cancel ||
skip_env "no early lock cancel on server"
touch $DIR/$tdir
cancel_lru_locks mdc
stat $DIR/$tdir > /dev/null
touch $DIR/$tdir
cancel_lru_locks mdc
stat $DIR/$tdir > /dev/null
- can1=$(do_facet $SINGLEMDS \
"$LCTL get_param -n ldlm.services.ldlm_canceld.stats" |
awk '/ldlm_cancel/ {print $2}')
blk1=$($LCTL get_param -n ldlm.services.ldlm_cbd.stats |
awk '/ldlm_bl_callback/ {print $2}')
chmod a+x $DIR/$tdir
"$LCTL get_param -n ldlm.services.ldlm_canceld.stats" |
awk '/ldlm_cancel/ {print $2}')
blk1=$($LCTL get_param -n ldlm.services.ldlm_cbd.stats |
awk '/ldlm_bl_callback/ {print $2}')
chmod a+x $DIR/$tdir
- can2=$(do_facet $SINGLEMDS \
"$LCTL get_param -n ldlm.services.ldlm_canceld.stats" |
awk '/ldlm_cancel/ {print $2}')
blk2=$($LCTL get_param -n ldlm.services.ldlm_cbd.stats |
"$LCTL get_param -n ldlm.services.ldlm_canceld.stats" |
awk '/ldlm_cancel/ {print $2}')
blk2=$($LCTL get_param -n ldlm.services.ldlm_cbd.stats |
- test_mkdir -c1 $DIR/$tdir
+ test_mkdir -i0 -c1 $DIR/$tdir
lru_resize_disable mdc
lru_resize_disable osc
! $LCTL get_param debug | grep -q dlmtrace &&
lru_resize_disable mdc
lru_resize_disable osc
! $LCTL get_param debug | grep -q dlmtrace &&
# during unlink (LU-4206), so cancel osc lock now.
sleep 2
cancel_lru_locks osc
# during unlink (LU-4206), so cancel osc lock now.
sleep 2
cancel_lru_locks osc
- can1=$(do_facet $SINGLEMDS \
"$LCTL get_param -n ldlm.services.ldlm_canceld.stats" |
awk '/ldlm_cancel/ {print $2}')
blk1=$($LCTL get_param -n ldlm.services.ldlm_cbd.stats |
awk '/ldlm_bl_callback/ {print $2}')
unlink $DIR/$tdir/f1
sleep 5
"$LCTL get_param -n ldlm.services.ldlm_canceld.stats" |
awk '/ldlm_cancel/ {print $2}')
blk1=$($LCTL get_param -n ldlm.services.ldlm_cbd.stats |
awk '/ldlm_bl_callback/ {print $2}')
unlink $DIR/$tdir/f1
sleep 5
- can2=$(do_facet $SINGLEMDS \
"$LCTL get_param -n ldlm.services.ldlm_canceld.stats" |
awk '/ldlm_cancel/ {print $2}')
blk2=$($LCTL get_param -n ldlm.services.ldlm_cbd.stats |
"$LCTL get_param -n ldlm.services.ldlm_canceld.stats" |
awk '/ldlm_cancel/ {print $2}')
blk2=$($LCTL get_param -n ldlm.services.ldlm_cbd.stats |
skip_env "no early lock cancel on server"
remote_mds_nodsh && skip "remote MDS with nodsh"
skip_env "no early lock cancel on server"
remote_mds_nodsh && skip "remote MDS with nodsh"
- test_mkdir -c1 $DIR/$tdir
+ test_mkdir -i0 -c1 $DIR/$tdir
lru_resize_disable mdc
lru_resize_disable osc
lru_resize_disable mdc
lru_resize_disable osc
- test_mkdir -c1 $DIR/$tdir/d1
- test_mkdir -c1 $DIR/$tdir/d2
+ test_mkdir -i0 -c1 $DIR/$tdir/d1
+ test_mkdir -i0 -c1 $DIR/$tdir/d2
dd if=/dev/zero of=$DIR/$tdir/d1/f1 count=1
dd if=/dev/zero of=$DIR/$tdir/d2/f2 count=1
cancel_lru_locks mdc
dd if=/dev/zero of=$DIR/$tdir/d1/f1 count=1
dd if=/dev/zero of=$DIR/$tdir/d2/f2 count=1
cancel_lru_locks mdc
# during rename (LU-4206), so cancel osc lock now.
sleep 2
cancel_lru_locks osc
# during rename (LU-4206), so cancel osc lock now.
sleep 2
cancel_lru_locks osc
- can1=$(do_facet $SINGLEMDS \
"$LCTL get_param -n ldlm.services.ldlm_canceld.stats" |
awk '/ldlm_cancel/ {print $2}')
blk1=$($LCTL get_param -n ldlm.services.ldlm_cbd.stats |
awk '/ldlm_bl_callback/ {print $2}')
mrename $DIR/$tdir/d1/f1 $DIR/$tdir/d2/f2
sleep 5
"$LCTL get_param -n ldlm.services.ldlm_canceld.stats" |
awk '/ldlm_cancel/ {print $2}')
blk1=$($LCTL get_param -n ldlm.services.ldlm_cbd.stats |
awk '/ldlm_bl_callback/ {print $2}')
mrename $DIR/$tdir/d1/f1 $DIR/$tdir/d2/f2
sleep 5
- can2=$(do_facet $SINGLEMDS \
"$LCTL get_param -n ldlm.services.ldlm_canceld.stats" |
awk '/ldlm_cancel/ {print $2}')
blk2=$($LCTL get_param -n ldlm.services.ldlm_cbd.stats |
"$LCTL get_param -n ldlm.services.ldlm_canceld.stats" |
awk '/ldlm_cancel/ {print $2}')
blk2=$($LCTL get_param -n ldlm.services.ldlm_cbd.stats |
do_facet $SINGLEMDS $LCTL --version)"
log "OSS: $(do_facet ost1 $LCTL lustre_build_version 2> /dev/null ||
do_facet ost1 $LCTL --version)"
do_facet $SINGLEMDS $LCTL --version)"
log "OSS: $(do_facet ost1 $LCTL lustre_build_version 2> /dev/null ||
do_facet ost1 $LCTL --version)"
test_mkdir() {
local path
local p_option
test_mkdir() {
local path
local p_option
- local stripe_count=2
- local stripe_index=-1
+ local dirstripe_count=${DIRSTRIPE_COUNT:-"-1"}
+ local dirstripe_index=${DIRSTRIPE_INDEX:-"-1"}
local OPTIND=1
while getopts "c:i:p" opt; do
case $opt in
local OPTIND=1
while getopts "c:i:p" opt; do
case $opt in
- c) stripe_count=$OPTARG;;
- i) stripe_index=$OPTARG;;
+ c) dirstripe_count=$OPTARG;;
+ i) dirstripe_index=$OPTARG;;
p) p_option="-p";;
\?) error "only support -i -c -p";;
esac
p) p_option="-p";;
\?) error "only support -i -c -p";;
esac
if [ $MDSCOUNT -le 1 ]; then
mkdir $path || error "mkdir '$path' failed"
else
if [ $MDSCOUNT -le 1 ]; then
mkdir $path || error "mkdir '$path' failed"
else
- local test_num=$(echo $testnum | sed -e 's/[^0-9]*//g')
- if [ $stripe_index -eq -1 ]; then
- mdt_index=$((test_num % MDSCOUNT))
+ if [ $dirstripe_index -eq -1 ]; then
+ mdt_index=$((RANDOM % MDSCOUNT))
+ else
+ mdt_index=$dirstripe_index
+ fi
+
+ if (($MDS1_VERSION >= $(version_code 2.8.0))); then
+ if [ $dirstripe_count -eq -1 ]; then
+ dirstripe_count=$((RANDOM % MDSCOUNT + 1))
+ fi
- mdt_index=$stripe_index
- echo "striped dir -i$mdt_index -c$stripe_count $path"
- $LFS mkdir -i$mdt_index -c$stripe_count $path ||
- error "mkdir -i $mdt_index -c$stripe_count $path failed"
+
+ echo "striped dir -i$mdt_index -c$dirstripe_count $path"
+ $LFS mkdir -i$mdt_index -c$dirstripe_count $path ||
+ error "mkdir -i $mdt_index -c$dirstripe_count $path failed"