}
run_test 0b "ensure object created after recover exists. (3284)"
-seq_set_width()
-{
- local mds=$1
- local width=$2
- lctl set_param -n seq.cli-srv-$mds-mdc-*.width=$width
-}
-
-seq_get_width()
-{
- local mds=$1
- lctl get_param -n seq.cli-srv-$mds-mdc-*.width
-}
-
-# This test should pass for single-mds and multi-mds configs.
-# But for different configurations it tests different things.
-#
-# single-mds
-# ----------
-# (1) fld_create replay should happen;
-#
-# (2) fld_create replay should not return -EEXISTS, if it does
-# this means sequence manager recovery code is buggy and allocated
-# same sequence two times after recovery.
-#
-# multi-mds
-# ---------
-# (1) fld_create replay may not happen, because its home MDS is
-# MDS2 which is not involved to revovery;
-#
-# (2) as fld_create does not happen on MDS1, it does not make any
-# problem.
-test_0c() {
- local label=`mdsdevlabel 1`
- [ -z "$label" ] && echo "No label for mds1" && return 1
-
- replay_barrier $SINGLEMDS
- local sw=`seq_get_width $label`
-
- # make seq manager switch to next sequence each
- # time as new fid is needed.
- seq_set_width $label 1
-
- # make sure that fld has created at least one new
- # entry on server
- touch $DIR/$tfile || return 2
- seq_set_width $label $sw
-
- # fail $SINGLEMDS and start recovery, replay RPCs, etc.
- fail $SINGLEMDS
-
- # wait for recovery finish
- sleep 10
- df $MOUNT
-
- # flush fld cache and dentry cache to make it lookup
- # created entry instead of revalidating existent one
- umount $MOUNT
- zconf_mount `hostname` $MOUNT
-
- # issue lookup which should call fld lookup which
- # should fail if client did not replay fld create
- # correctly and server has no fld entry
- touch $DIR/$tfile || return 3
- rm $DIR/$tfile || return 4
-}
-start_full_debug_logging
-run_test 0c "fld create"
-stop_full_debug_logging
-
test_0d() {
replay_barrier $SINGLEMDS
umount $MOUNT