- do_node $CLIENT2 unlinkmany $DIR/$tdir/$tfile-2- 25 || return 5
-
- zconf_umount_clients $CLIENTS $DIR
- return 0
-}
-run_test 7a "fail MDS, delayed recovery, fail MDS"
-
-test_8a() {
- delayed_recovery_enabled || { skip "No delayed recovery support"; return 0; }
-
- remote_server $CLIENT2 || \
- { skip_env "Client $CLIENT2 is on the server node" && return 0; }
-
- zconf_mount_clients $CLIENT1 $DIR
- zconf_mount_clients $CLIENT2 $DIR
-
- rmultiop_start $CLIENT2 $DIR/$tfile O_tSc || return 1
- do_node $CLIENT2 rm -f $DIR/$tfile
- replay_barrier $SINGLEMDS
- rmultiop_stop $CLIENT2 || return 2
-
- vbr_deactivate_client $CLIENT2
- facet_failover $SINGLEMDS
- client_up $CLIENT1 || return 3
- #client1 is back and will try to open orphan
- vbr_activate_client $CLIENT2
- client_up $CLIENT2 || return 4
-
- do_node $CLIENT2 $CHECKSTAT $DIR/$tfile && error "$tfile exists"
- zconf_umount_clients $CLIENTS $DIR
- return 0
-}
-run_test 8a "orphans are kept until delayed recovery"
-
-test_8b() {
- delayed_recovery_enabled || { skip "No delayed recovery support"; return 0; }
-
- remote_server $CLIENT2 || \
- { skip_env "Client $CLIENT2 is on the server node" && return 0; }
-
- zconf_mount_clients $CLIENT1 $DIR
- zconf_mount_clients $CLIENT2 $DIR
-
- rmultiop_start $CLIENT2 $DIR/$tfile O_tSc|| return 1
- replay_barrier $SINGLEMDS
- do_node $CLIENT1 rm -f $DIR/$tfile
-
- vbr_deactivate_client $CLIENT2
- facet_failover $SINGLEMDS
- client_up $CLIENT1 || return 2
- #client1 is back and will try to open orphan
- vbr_activate_client $CLIENT2
- client_up $CLIENT2 || return 3
-
- rmultiop_stop $CLIENT2 || return 1
- do_node $CLIENT2 $CHECKSTAT $DIR/$tfile && error "$tfile exists"
- zconf_umount_clients $CLIENTS $DIR
- return 0
-}
-run_test 8b "open1 | unlink2 X delayed_replay1, close1"
-
-test_8c() {
- delayed_recovery_enabled || { skip "No delayed recovery support"; return 0; }
-
- remote_server $CLIENT2 || \
- { skip_env "Client $CLIENT2 is on the server node" && return 0; }
-
- zconf_mount_clients $CLIENT1 $DIR
- zconf_mount_clients $CLIENT2 $DIR
-
- rmultiop_start $CLIENT2 $DIR/$tfile O_tSc|| return 1
- replay_barrier $SINGLEMDS
- do_node $CLIENT1 rm -f $DIR/$tfile
- rmultiop_stop $CLIENT2 || return 2
-
- vbr_deactivate_client $CLIENT2
- facet_failover $SINGLEMDS
- client_up $CLIENT1 || return 3
- #client1 is back and will try to open orphan
- vbr_activate_client $CLIENT2
- client_up $CLIENT2 || return 4
-
- do_node $CLIENT2 $CHECKSTAT $DIR/$tfile && error "$tfile exists"
- zconf_umount_clients $CLIENTS $DIR
- return 0
-}
-run_test 8c "open1 | unlink2, close1 X delayed_replay1"
-
-test_8d() {
- delayed_recovery_enabled || { skip "No delayed recovery support"; return 0; }
-
- remote_server $CLIENT2 || \
- { skip_env "Client $CLIENT2 is on the server node" && return 0; }
-
- zconf_mount_clients $CLIENT1 $DIR
- zconf_mount_clients $CLIENT2 $DIR
-
- rmultiop_start $CLIENT1 $DIR/$tfile O_tSc|| return 1
- rmultiop_start $CLIENT2 $DIR/$tfile O_tSc|| return 2
- replay_barrier $SINGLEMDS
- do_node $CLIENT1 rm -f $DIR/$tfile
- rmultiop_stop $CLIENT2 || return 3
- rmultiop_stop $CLIENT1 || return 4
-
- vbr_deactivate_client $CLIENT2
- facet_failover $SINGLEMDS
- client_up $CLIENT1 || return 6
-
- #client1 is back and will try to open orphan
- vbr_activate_client $CLIENT2
- client_up $CLIENT2 || return 8
-
- do_node $CLIENT2 $CHECKSTAT $DIR/$tfile && error "$tfile exists"
- zconf_umount_clients $CLIENTS $DIR
- return 0
-}
-run_test 8d "open1, open2 | unlink2, close1, close2 X delayed_replay1"
-
-test_8e() {
- zconf_mount $CLIENT1 $DIR
- zconf_mount $CLIENT2 $DIR
-
- do_node $CLIENT1 mcreate $DIR/$tfile
- do_node $CLIENT1 mkdir $DIR/$tfile-2
- replay_barrier $SINGLEMDS
- # missed replay from client1 will lead to recovery by versions
- do_node $CLIENT1 touch $DIR/$tfile-2/$tfile
- do_node $CLIENT2 rm $DIR/$tfile || return 1
- do_node $CLIENT2 touch $DIR/$tfile || return 2
-
- zconf_umount $CLIENT1 $DIR
- facet_failover $SINGLEMDS
- client_up $CLIENT2 || return 6
-
- do_node $CLIENT2 rm $DIR/$tfile || error "$tfile doesn't exists"
- zconf_umount_clients $CLIENTS $DIR
- return 0
-}
-run_test 8e "create | unlink, create shouldn't fail"
-
-test_8f() {
- zconf_mount_clients $CLIENT1 $DIR
- zconf_mount_clients $CLIENT2 $DIR
-
- do_node $CLIENT1 touch $DIR/$tfile
- do_node $CLIENT1 mkdir $DIR/$tfile-2
- replay_barrier $SINGLEMDS
- # missed replay from client1 will lead to recovery by versions
- do_node $CLIENT1 touch $DIR/$tfile-2/$tfile
- do_node $CLIENT2 rm -f $DIR/$tfile || return 1
- do_node $CLIENT2 mcreate $DIR/$tfile || return 2
-
- zconf_umount $CLIENT1 $DIR
- facet_failover $SINGLEMDS
- client_up $CLIENT2 || return 6
-
- do_node $CLIENT2 rm $DIR/$tfile || error "$tfile doesn't exists"
- zconf_umount $CLIENT2 $DIR
- return 0
-}
-run_test 8f "create | unlink, create shouldn't fail"
-
-test_8g() {
- zconf_mount_clients $CLIENT1 $DIR
- zconf_mount_clients $CLIENT2 $DIR
-
- do_node $CLIENT1 touch $DIR/$tfile
- do_node $CLIENT1 mkdir $DIR/$tfile-2
- replay_barrier $SINGLEMDS
- # missed replay from client1 will lead to recovery by versions
- do_node $CLIENT1 touch $DIR/$tfile-2/$tfile
- do_node $CLIENT2 rm -f $DIR/$tfile || return 1
- do_node $CLIENT2 mkdir $DIR/$tfile || return 2
-
- zconf_umount $CLIENT1 $DIR
- facet_failover $SINGLEMDS
- client_up $CLIENT2 || return 6