}
run_test 67 "test routes conversion and configuration"
+test_68() {
+ local fid
+ local seq
+ local START
+ local END
+
+ [ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.4.53) ] ||
+ { skip "Need MDS version at least 2.4.53"; return 0; }
+
+ umount_client $MOUNT || error "umount client failed"
+
+ start_mdt 1 || error "MDT start failed"
+ start_ost
+
+ # START-END - the sequences we'll be reserving
+ START=$(do_facet $SINGLEMDS \
+ lctl get_param -n seq.ctl*.space | awk -F'[[ ]' '{print $2}')
+ END=$((START + (1 << 30)))
+ do_facet $SINGLEMDS \
+ lctl set_param seq.ctl*.fldb="[$START-$END\):0:mdt"
+
+ # reset the sequences MDT0000 has already assigned
+ do_facet $SINGLEMDS \
+ lctl set_param seq.srv*MDT0000.space=clear
+
+ # remount to let the client allocate new sequence
+ mount_client $MOUNT || error "mount client failed"
+
+ touch $DIR/$tfile
+ do_facet $SINGLEMDS \
+ lctl get_param seq.srv*MDT0000.space
+ $LFS path2fid $DIR/$tfile
+
+ local old_ifs="$IFS"
+ IFS='[:]'
+ fid=($($LFS path2fid $DIR/$tfile))
+ IFS="$old_ifs"
+ let seq=${fid[1]}
+
+ if [[ $seq < $END ]]; then
+ error "used reserved sequence $seq?"
+ fi
+ cleanup || return $?
+}
+run_test 68 "be able to reserve specific sequences in FLDB"
+
+test_69() {
+ setup
+
+ # use OST0000 since it probably has the most creations
+ local OSTNAME=$(ostname_from_index 0)
+ local mdtosc_proc1=$(get_mdtosc_proc_path mds1 $OSTNAME)
+ local last_id=$(do_facet mds1 lctl get_param -n \
+ osc.$mdtosc_proc1.prealloc_last_id)
+
+ # Want to have OST LAST_ID over 1.5 * OST_MAX_PRECREATE to
+ # verify that the LAST_ID recovery is working properly. If
+ # not, then the OST will refuse to allow the MDS connect
+ # because the LAST_ID value is too different from the MDS
+ #define OST_MAX_PRECREATE=20000
+ local num_create=$((20000 * 3/2 - $last_id + 100))
+
+ mkdir $DIR/$tdir
+ $LFS setstripe -i 0 $DIR/$tdir
+ createmany $DIR/$tdir/$tfile- $num_create
+ # delete all of the files with objects on OST0 so the
+ # filesystem is not inconsistent later on
+ $LFS find $MOUNT --index 0 -print0 | xargs -0 unlink
+
+ stop_ost || error "OST0 stop failure"
+ add ost1 $(mkfs_opts ost1 $ostdev) --reformat --replace $ostdev ||
+ error "reformat and replace $ostdev failed"
+ start_ost || error "OST0 restart failure"
+
+ touch $DIR/$tdir/$tfile-last || error "create file after reformat"
+ local idx=$($LFS getstripe -c $DIR/$tdir/$tfile-last)
+ [ $idx -ne 0 ] && error "$DIR/$tdir/$tfile-last on $idx not 0" || true
+
+ cleanup
+}
+run_test 68 "replace an OST with the same index"
+
test_70a() {
[ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs" && return
local MDTIDX=1
+ cleanup
+
start_mdt 1 || error "MDT0 start fail"
start_ost || error "OST0 start fail"
}
run_test 75 "The order of --index should be irrelevant"
+test_76() {
+ [[ $(lustre_version_code mgs) -ge $(version_code 2.4.52) ]] ||
+ { skip "Need MDS version at least 2.4.52" && return 0; }
+ setup
+ local MDMB_PARAM="osc.*.max_dirty_mb"
+ echo "Change MGS params"
+ local MAX_DIRTY_MB=$($LCTL get_param -n $MDMB_PARAM |
+ head -1)
+ echo "max_dirty_mb: $MAX_DIRTY_MB"
+ local NEW_MAX_DIRTY_MB=$((MAX_DIRTY_MB + MAX_DIRTY_MB))
+ echo "new_max_dirty_mb: $NEW_MAX_DIRTY_MB"
+ do_facet mgs $LCTL set_param -P $MDMB_PARAM=$NEW_MAX_DIRTY_MB
+ wait_update $HOSTNAME "lctl get_param -n $MDMB_PARAM |
+ head -1" $NEW_MAX_DIRTY_MB
+ MAX_DIRTY_MB=$($LCTL get_param -n $MDMB_PARAM | head -1)
+ echo "$MAX_DIRTY_MB"
+ [ $MAX_DIRTY_MB = $NEW_MAX_DIRTY_MB ] ||
+ error "error while apply max_dirty_mb"
+
+ echo "Check the value is stored after remount"
+ stopall
+ setupall
+ wait_update $HOSTNAME "lctl get_param -n $MDMB_PARAM |
+ head -1" $NEW_MAX_DIRTY_MB
+ MAX_DIRTY_MB=$($LCTL get_param -n $MDMB_PARAM | head -1)
+ [ $MAX_DIRTY_MB = $NEW_MAX_DIRTY_MB ] ||
+ error "max_dirty_mb is not saved after remount"
+
+ echo "Change OST params"
+ CLIENT_PARAM="obdfilter.*.client_cache_count"
+ local CLIENT_CACHE_COUNT
+ CLIENT_CACHE_COUNT=$(do_facet ost1 $LCTL get_param -n $CLIENT_PARAM |
+ head -1)
+ echo "client_cache_count: $CLIENT_CACHE_COUNT"
+ NEW_CLIENT_CACHE_COUNT=$((CLIENT_CACHE_COUNT+CLIENT_CACHE_COUNT))
+ echo "new_client_cache_count: $NEW_CLIENT_CACHE_COUNT"
+ do_facet mgs $LCTL set_param -P $CLIENT_PARAM=$NEW_CLIENT_CACHE_COUNT
+ wait_update $(facet_host ost1) "lctl get_param -n $CLIENT_PARAM |
+ head -1" $NEW_CLIENT_CACHE_COUNT
+ CLIENT_CACHE_COUNT=$(do_facet ost1 $LCTL get_param -n $CLIENT_PARAM |
+ head -1)
+ echo "$CLIENT_CACHE_COUNT"
+ [ $CLIENT_CACHE_COUNT = $NEW_CLIENT_CACHE_COUNT ] ||
+ error "error while apply client_cache_count"
+
+ echo "Check the value is stored after remount"
+ stopall
+ setupall
+ wait_update $(facet_host ost1) "lctl get_param -n $CLIENT_PARAM |
+ head -1" $NEW_CLIENT_CACHE_COUNT
+ CLIENT_CACHE_COUNT=$(do_facet ost1 $LCTL get_param -n $CLIENT_PARAM |
+ head -1)
+ echo "$CLIENT_CACHE_COUNT"
+ [ $CLIENT_CACHE_COUNT = $NEW_CLIENT_CACHE_COUNT ] ||
+ error "client_cache_count is not saved after remount"
+ stopall
+}
+run_test 76 "set permanent params set_param -P"
+
+test_77() { # LU-3445
+ local server_version=$(lustre_version_code $SINGLEMDS)
+
+ [[ $server_version -ge $(version_code 2.2.60) ]] &&
+ [[ $server_version -le $(version_code 2.4.0) ]] &&
+ skip "Need MDS version < 2.2.60 or > 2.4.0" && return
+
+ if [[ -z "$fs2ost_DEV" || -z "$fs2mds_DEV" ]]; then
+ is_blkdev $SINGLEMDS $(mdsdevname ${SINGLEMDS//mds/}) &&
+ skip_env "mixed loopback and real device not working" && return
+ fi
+
+ local fs2mdsdev=$(mdsdevname 1_2)
+ local fs2ostdev=$(ostdevname 1_2)
+ local fs2mdsvdev=$(mdsvdevname 1_2)
+ local fs2ostvdev=$(ostvdevname 1_2)
+ local fsname=test1234
+ local mgsnid
+ local failnid="$(h2$NETTYPE 1.2.3.4),$(h2$NETTYPE 4.3.2.1)"
+
+ add fs2mds $(mkfs_opts mds1 $fs2mdsdev) --mgs --fsname=$fsname \
+ --reformat $fs2mdsdev $fs2mdsvdev || error "add fs2mds failed"
+ start fs2mds $fs2mdsdev $MDS_MOUNT_OPTS && trap cleanup_24a EXIT INT ||
+ error "start fs2mds failed"
+
+ mgsnid=$(do_facet fs2mds $LCTL list_nids | xargs | tr ' ' ,)
+ [[ $mgsnid = *,* ]] || mgsnid+=",$mgsnid"
+
+ add fs2ost $(mkfs_opts ost1 $fs2ostdev) --mgsnode=$mgsnid \
+ --failnode=$failnid --fsname=$fsname \
+ --reformat $fs2ostdev $fs2ostvdev ||
+ error "add fs2ost failed"
+ start fs2ost $fs2ostdev $OST_MOUNT_OPTS || error "start fs2ost failed"
+
+ mkdir -p $MOUNT2
+ mount -t lustre $mgsnid:/$fsname $MOUNT2 || error "mount $MOUNT2 failed"
+ DIR=$MOUNT2 MOUNT=$MOUNT2 check_mount || error "check $MOUNT2 failed"
+ cleanup_24a
+}
+run_test 77 "comma-separated MGS NIDs and failover node NIDs"
+
if ! combined_mgs_mds ; then
stop mgs
fi