6 ALWAYS_EXCEPT="12a $REPLAY_VBR_EXCEPT"
9 LUSTRE=${LUSTRE:-$(cd $(dirname $0)/..; echo $PWD)}
12 MOUNT_2=${MOUNT_2:-"yes"}
13 . $LUSTRE/tests/test-framework.sh
15 . ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
18 remote_mds_nodsh && log "SKIP: remote MDS with nodsh" && exit 0
20 [ "$SLOW" = "no" ] && EXCEPT_SLOW="7"
24 check_and_setup_lustre
27 rm -rf $DIR/[df][0-9]*
29 [ "$DAEMONFILE" ] && $LCTL debug_daemon start $DAEMONFILE $DAEMONSIZE
31 # if there is no CLIENT1 defined, some tests can be ran on localhost
32 CLIENT1=${CLIENT1:-$HOSTNAME}
33 # if CLIENT2 doesn't exist then use CLIENT1 instead
34 # All tests should use CLIENT2 with MOUNT2 only therefore it will work if
36 # Exception is the test which need two separate nodes
37 CLIENT2=${CLIENT2:-$CLIENT1}
39 is_mounted $MOUNT2 || error "MOUNT2 is not mounted"
46 # We need to run do_node in bg, because pdsh does not exit
47 # if child process of run script exists.
48 # I.e. pdsh does not exit when runmultiop_bg_pause exited,
49 # because of multiop_bg_pause -> $MULTIOP_PROG &
50 # By the same reason we need sleep a bit after do_nodes starts
51 # to let runmultiop_bg_pause start muliop and
52 # update /tmp/multiop_bg.pid ;
53 # The rm /tmp/multiop_bg.pid guarantees here that
54 # we have the updated by runmultiop_bg_pause
55 # /tmp/multiop_bg.pid file
57 local pid_file=$TMP/multiop_bg.pid.$$
58 do_node $client "MULTIOP_PID_FILE=$pid_file LUSTRE= sh runmultiop_bg_pause $file $cmds" &
62 multiop_pid=$(do_node $client cat $pid_file)
63 [ -n "$multiop_pid" ] || error "$client : Can not get multiop_pid from $pid_file "
64 eval export $(node_var_name $client)_multiop_pid=$multiop_pid
65 eval export $(node_var_name $client)_do_node_pid=$pid
66 local var=$(node_var_name $client)_multiop_pid
67 echo client $client multiop_bg started multiop_pid=${!var}
73 local multiop_pid=$(node_var_name $client)_multiop_pid
74 local do_node_pid=$(node_var_name $client)_do_node_pid
76 echo "Stopping multiop_pid=${!multiop_pid} (kill ${!multiop_pid} on $client)"
77 do_node $client kill -USR1 ${!multiop_pid}
83 local var=${SINGLEMDS}_svc
88 fid=$(do_node $client $LFS path2fid $file)
89 do_facet $SINGLEMDS $LCTL --device ${!var} getobjversion $fid
93 cos_param_file=$TMP/rvbr-cos-params
94 save_lustre_params $(comma_list $(mdts_nodes)) "mdt.*.commit_on_sharing" > $cos_param_file
97 test_1a() { # former test_0a
98 local file=$DIR/$tfile
102 do_node $CLIENT1 mcreate $file
103 pre=$(get_version $CLIENT1 $file)
104 do_node $CLIENT1 openfile -f O_RDWR $file
105 post=$(get_version $CLIENT1 $file)
106 if (($pre != $post)); then
107 error "version changed unexpectedly: pre $pre, post $post"
110 run_test 1a "open and close do not change versions"
112 test_1b() { # former test_0b
113 local var=${SINGLEMDS}_svc
114 zconf_mount $CLIENT2 $MOUNT2
116 do_facet $SINGLEMDS "$LCTL set_param mdd.${!var}.sync_permission=0"
117 do_facet $SINGLEMDS "$LCTL set_param mdt.${!var}.commit_on_sharing=0"
118 do_node $CLIENT1 mkdir -p -m 755 $MOUNT/$tdir
120 replay_barrier $SINGLEMDS
121 do_node $CLIENT2 chmod 777 $MOUNT2/$tdir
122 do_node $CLIENT1 openfile -f O_RDWR:O_CREAT $MOUNT/$tdir/$tfile
123 zconf_umount $CLIENT2 $MOUNT2
124 facet_failover $SINGLEMDS
126 client_evicted $CLIENT1 || error "$CLIENT1 not evicted"
127 if ! do_node $CLIENT1 $CHECKSTAT -a $DIR/$tdir/$tfile; then
128 error "open succeeded unexpectedly"
131 run_test 1b "open (O_CREAT) checks version of parent"
133 test_1c() { # former test_0c
134 local var=${SINGLEMDS}_svc
135 zconf_mount $CLIENT2 $MOUNT2
137 do_facet $SINGLEMDS "$LCTL set_param mdd.${!var}.sync_permission=0"
138 do_facet $SINGLEMDS "$LCTL set_param mdt.${!var}.commit_on_sharing=0"
140 do_node $CLIENT1 mkdir -p -m 755 $DIR/$tdir
141 do_node $CLIENT1 openfile -f O_RDWR:O_CREAT -m 0644 $DIR/$tdir/$tfile
143 replay_barrier $SINGLEMDS
144 do_node $CLIENT2 chmod 0777 $MOUNT2/$tdir
145 do_node $CLIENT2 chmod 0666 $MOUNT2/$tdir/$tfile
146 rmultiop_start $CLIENT1 $DIR/$tdir/$tfile o_c
147 zconf_umount $CLIENT2 $MOUNT2
148 facet_failover $SINGLEMDS
150 client_up $CLIENT1 || error "$CLIENT1 evicted"
151 rmultiop_stop $CLIENT1 || error "close failed"
153 run_test 1c "open (non O_CREAT) does not checks versions"
155 # test set #2: CREAT (not open)
156 # - version of parent is not changed but checked
157 # - pre-version should be -1
158 # - post-version should be valid
159 test_2a() { # extended former test_0d
164 pre=$(get_version $CLIENT1 $DIR)
165 do_node $CLIENT1 mkfifo $DIR/$tfile-fifo
166 post=$(get_version $CLIENT1 $DIR)
167 if (($pre != $post)); then
168 error "version was changed: pre $pre, post $post"
171 pre=$(get_version $CLIENT1 $DIR)
172 do_node $CLIENT1 mkdir $DIR/$tfile-dir
173 post=$(get_version $CLIENT1 $DIR)
174 if (($pre != $post)); then
175 error "version was changed: pre $pre, post $post"
177 do_node $CLIENT1 rmdir $DIR/$tfile-dir
180 pre=$(get_version $CLIENT1 $DIR)
181 do_node $CLIENT1 mkfifo $DIR/$tfile-nod
182 post=$(get_version $CLIENT1 $DIR)
183 if (($pre != $post)); then
184 error "version was changed: pre $pre, post $post"
187 pre=$(get_version $CLIENT1 $DIR)
188 do_node $CLIENT1 mkfifo $DIR/$tfile-symlink
189 post=$(get_version $CLIENT1 $DIR)
190 if (($pre != $post)); then
191 error "version was changed: pre $pre, post $post"
193 do_node $CLIENT1 rm $DIR/$tfile-*
196 run_test 2a "create operations doesn't change version of parent"
198 test_2b() { # former test_0e
199 local var=${SINGLEMDS}_svc
200 zconf_mount $CLIENT2 $MOUNT2
202 do_facet $SINGLEMDS "$LCTL set_param mdd.${!var}.sync_permission=0"
203 do_facet $SINGLEMDS "$LCTL set_param mdt.${!var}.commit_on_sharing=0"
205 do_node $CLIENT1 mkdir -p -m 755 $DIR/$tdir
207 replay_barrier $SINGLEMDS
208 do_node $CLIENT2 chmod 777 $MOUNT2/$tdir
209 do_node $CLIENT1 mkfifo $DIR/$tdir/$tfile
210 zconf_umount $CLIENT2 $MOUNT2
211 facet_failover $SINGLEMDS
213 client_evicted $CLIENT1 || error "$CLIENT1 not evicted"
214 if ! do_node $CLIENT1 $CHECKSTAT -a $DIR/$tdir/$tfile; then
215 error "create succeeded unexpectedly"
218 run_test 2b "create checks version of parent"
220 test_3a() { # former test_0f
224 do_node $CLIENT1 mcreate $DIR/$tfile
225 pre=$(get_version $CLIENT1 $DIR)
226 do_node $CLIENT1 rm $DIR/$tfile
227 post=$(get_version $CLIENT1 $DIR)
228 if (($pre != $post)); then
229 error "version was changed: pre $pre, post $post"
232 run_test 3a "unlink doesn't change version of parent"
234 test_3b() { # former test_0g
235 local var=${SINGLEMDS}_svc
236 zconf_mount $CLIENT2 $MOUNT2
238 do_facet $SINGLEMDS "$LCTL set_param mdd.${!var}.sync_permission=0"
239 do_facet $SINGLEMDS "$LCTL set_param mdt.${!var}.commit_on_sharing=0"
241 do_node $CLIENT1 mkdir -p -m 755 $DIR/$tdir
242 do_node $CLIENT1 mcreate $DIR/$tdir/$tfile
244 replay_barrier $SINGLEMDS
245 do_node $CLIENT2 chmod 777 $MOUNT2/$tdir
246 do_node $CLIENT1 rm $DIR/$tdir/$tfile
247 zconf_umount $CLIENT2 $MOUNT2
248 facet_failover $SINGLEMDS
250 client_evicted $CLIENT1 || error "$CLIENT1 not evicted"
251 if do_node $CLIENT1 $CHECKSTAT -a $DIR/$tdir/$tfile; then
252 error "unlink succeeded unexpectedly"
255 run_test 3b "unlink checks version of parent"
257 test_4a() { # former test_0h
258 local file=$DIR/$tfile
262 do_node $CLIENT1 mcreate $file
263 pre=$(get_version $CLIENT1 $file)
264 do_node $CLIENT1 chown $RUNAS_ID:$RUNAS_GID $file
265 post=$(get_version $CLIENT1 $file)
266 if (($pre == $post)); then
267 error "version not changed: pre $pre, post $post"
270 run_test 4a "setattr of UID changes versions"
272 test_4b() { # former test_0i
273 local file=$DIR/$tfile
277 do_node $CLIENT1 mcreate $file
278 pre=$(get_version $CLIENT1 $file)
279 do_node $CLIENT1 chgrp $RUNAS_GID $file
280 post=$(get_version $CLIENT1 $file)
281 if (($pre == $post)); then
282 error "version not changed: pre $pre, post $post"
285 run_test 4b "setattr of GID changes versions"
287 test_4c() { # former test_0j
288 local file=$DIR/$tfile
289 local var=${SINGLEMDS}_svc
290 zconf_mount $CLIENT2 $MOUNT2
292 do_facet $SINGLEMDS "$LCTL set_param mdd.${!var}.sync_permission=0"
293 do_facet $SINGLEMDS "$LCTL set_param mdt.${!var}.commit_on_sharing=0"
295 do_node $CLIENT1 mcreate $file
297 replay_barrier $SINGLEMDS
298 do_node $CLIENT2 chgrp $RUNAS_GID $MOUNT2/$tfile
299 do_node $CLIENT1 chown $RUNAS_ID:$RUNAS_GID $file
300 zconf_umount $CLIENT2 $MOUNT2
301 facet_failover $SINGLEMDS
303 client_evicted $CLIENT1 || error "$CLIENT1 not evicted"
304 if ! do_node $CLIENT1 $CHECKSTAT -u \\\#$UID $file; then
305 error "setattr of UID succeeded unexpectedly"
308 run_test 4c "setattr of UID checks versions"
310 test_4d() { # former test_0k
311 local file=$DIR/$tfile
312 local var=${SINGLEMDS}_svc
313 zconf_mount $CLIENT2 $MOUNT2
315 do_facet $SINGLEMDS "$LCTL set_param mdd.${!var}.sync_permission=0"
316 do_facet $SINGLEMDS "$LCTL set_param mdt.${!var}.commit_on_sharing=0"
318 do_node $CLIENT1 mcreate $file
320 replay_barrier $SINGLEMDS
321 do_node $CLIENT2 chown $RUNAS_ID:$RUNAS_GID $MOUNT2/$tfile
322 do_node $CLIENT1 chgrp $RUNAS_GID $file
323 zconf_umount $CLIENT2 $MOUNT2
324 facet_failover $SINGLEMDS
326 client_evicted $CLIENT1 || error "$CLIENT1 not evicted"
327 if ! do_node $CLIENT1 $CHECKSTAT -g \\\#$UID $file; then
328 error "setattr of GID succeeded unexpectedly"
331 run_test 4d "setattr of GID checks versions"
333 test_4e() { # former test_0l
334 local file=$DIR/$tfile
338 do_node $CLIENT1 openfile -f O_RDWR:O_CREAT -m 0644 $file
339 pre=$(get_version $CLIENT1 $file)
340 do_node $CLIENT1 chmod 666 $file
341 post=$(get_version $CLIENT1 $file)
342 if (($pre == $post)); then
343 error "version not changed: pre $pre, post $post"
346 run_test 4e "setattr of permission changes versions"
348 test_4f() { # former test_0m
349 local file=$DIR/$tfile
350 local var=${SINGLEMDS}_svc
351 zconf_mount $CLIENT2 $MOUNT2
353 do_facet $SINGLEMDS "$LCTL set_param mdd.${!var}.sync_permission=0"
354 do_facet $SINGLEMDS "$LCTL set_param mdt.${!var}.commit_on_sharing=0"
356 do_node $CLIENT1 openfile -f O_RDWR:O_CREAT -m 0644 $file
358 replay_barrier $SINGLEMDS
359 do_node $CLIENT2 chgrp $RUNAS_GID $MOUNT2/$tfile
360 do_node $CLIENT1 chmod 666 $file
361 zconf_umount $CLIENT2 $MOUNT2
362 facet_failover $SINGLEMDS
364 client_evicted $CLIENT1 || error "$CLIENT1 not evicted"
365 if ! do_node $CLIENT1 $CHECKSTAT -p 0644 $file; then
366 error "setattr of permission succeeded unexpectedly"
369 run_test 4f "setattr of permission checks versions"
371 test_4g() { # former test_0n
372 local file=$DIR/$tfile
376 do_node $CLIENT1 mcreate $file
377 pre=$(get_version $CLIENT1 $file)
378 do_node $CLIENT1 chattr +i $file
379 post=$(get_version $CLIENT1 $file)
380 do_node $CLIENT1 chattr -i $file
381 if (($pre == $post)); then
382 error "version not changed: pre $pre, post $post"
385 run_test 4g "setattr of flags changes versions"
393 if ((${#attr} != 1)); then
394 error "checking multiple attributes not implemented yet"
396 do_node $client lsattr $file | cut -d ' ' -f 1 | grep -q $attr
399 test_4h() { # former test_0o
400 local file=$DIR/$tfile
402 local var=${SINGLEMDS}_svc
403 zconf_mount $CLIENT2 $MOUNT2
405 do_facet $SINGLEMDS "$LCTL set_param mdd.${!var}.sync_permission=0"
406 do_facet $SINGLEMDS "$LCTL set_param mdt.${!var}.commit_on_sharing=0"
408 do_node $CLIENT1 openfile -f O_RDWR:O_CREAT -m 0644 $file
410 replay_barrier $SINGLEMDS
411 do_node $CLIENT2 chmod 666 $MOUNT2/$tfile
412 do_node $CLIENT1 chattr +i $file
413 zconf_umount $CLIENT2 $MOUNT2
414 facet_failover $SINGLEMDS
416 client_evicted $CLIENT1 || error "$CLIENT1 not evicted"
417 checkattr $CLIENT1 i $file
419 do_node $CLIENT1 chattr -i $file
420 if [ $rc -eq 0 ]; then
421 error "setattr of flags succeeded unexpectedly"
424 run_test 4h "setattr of flags checks versions"
426 test_4i() { # former test_0p
427 local file=$DIR/$tfile
431 local var=${SINGLEMDS}_svc
433 ad_orig=$(do_facet $SINGLEMDS "$LCTL get_param mdd.${!var}.atime_diff")
434 do_facet $SINGLEMDS "$LCTL set_param mdd.${!var}.atime_diff=0"
435 do_node $CLIENT1 mcreate $file
436 pre=$(get_version $CLIENT1 $file)
437 do_node $CLIENT1 touch $file
438 post=$(get_version $CLIENT1 $file)
440 # We don't fail MDS in this test. atime_diff shall be
441 # restored to its original value.
443 do_facet $SINGLEMDS "$LCTL set_param $ad_orig"
444 if (($pre != $post)); then
445 error "version changed unexpectedly: pre $pre, post $post"
448 run_test 4i "setattr of times does not change versions"
450 test_4j() { # former test_0q
451 local file=$DIR/$tfile
455 do_node $CLIENT1 mcreate $file
456 pre=$(get_version $CLIENT1 $file)
457 do_node $CLIENT1 $TRUNCATE $file 1
458 post=$(get_version $CLIENT1 $file)
459 if (($pre != $post)); then
460 error "version changed unexpectedly: pre $pre, post $post"
463 run_test 4j "setattr of size does not change versions"
465 test_4k() { # former test_0r
466 local file=$DIR/$tfile
470 local var=${SINGLEMDS}_svc
471 zconf_mount $CLIENT2 $MOUNT2
473 do_facet $SINGLEMDS "$LCTL set_param mdd.${!var}.sync_permission=0"
474 do_facet $SINGLEMDS "$LCTL set_param mdd.${!var}.atime_diff=0"
475 do_facet $SINGLEMDS "$LCTL set_param mdt.${!var}.commit_on_sharing=0"
477 do_node $CLIENT1 openfile -f O_RDWR:O_CREAT -m 0644 $file
479 replay_barrier $SINGLEMDS
480 do_node $CLIENT2 chmod 666 $MOUNT2/$tfile
481 do_node $CLIENT1 $TRUNCATE $file 1
483 mtime_pre=$(do_node $CLIENT1 stat --format=%Y $file)
484 do_node $CLIENT1 touch $file
485 sleep 1 # avoid stat caching
486 mtime_post=$(do_node $CLIENT1 stat --format=%Y $file)
487 zconf_umount $CLIENT2 $MOUNT2
488 facet_failover $SINGLEMDS
490 client_up $CLIENT1 || error "$CLIENT1 evicted"
491 if (($mtime_pre >= $mtime_post)); then
492 error "time not changed: pre $mtime_pre, post $mtime_post"
494 if ! do_node $CLIENT1 $CHECKSTAT -s 1 $file; then
495 error "setattr of size failed"
497 mtime=$(do_node $CLIENT1 stat --format=%Y $file)
498 if (($mtime != $mtime_post)); then
499 error "setattr of times failed: expected $mtime_post, got $mtime"
502 run_test 4k "setattr of times and size does not check versions"
504 test_5a() { # former test_0s
510 do_node $CLIENT1 mcreate $DIR/$tfile
511 do_node $CLIENT1 mkdir -p $DIR/$tdir
512 pre=$(get_version $CLIENT1 $DIR/$tfile)
513 tp_pre=$(get_version $CLIENT1 $DIR/$tdir)
514 do_node $CLIENT1 link $DIR/$tfile $DIR/$tdir/$tfile
515 post=$(get_version $CLIENT1 $DIR/$tfile)
516 tp_post=$(get_version $CLIENT1 $DIR/$tdir)
517 if (($pre == $post)); then
518 error "version of source not changed: pre $pre, post $post"
520 if (($tp_pre != $tp_post)); then
521 error "version of target parent was changed: pre $tp_pre, post $tp_post"
524 run_test 5a "link changes versions of source but not target parent"
526 test_5b() { # former test_0t
527 local var=${SINGLEMDS}_svc
528 zconf_mount $CLIENT2 $MOUNT2
530 do_facet $SINGLEMDS "$LCTL set_param mdd.${!var}.sync_permission=0"
531 do_facet $SINGLEMDS "$LCTL set_param mdt.${!var}.commit_on_sharing=0"
533 do_node $CLIENT1 mcreate $DIR/$tfile
534 do_node $CLIENT1 mkdir -p -m 755 $DIR/$tdir
536 replay_barrier $SINGLEMDS
537 do_node $CLIENT2 chmod 777 $MOUNT2/$tdir
538 do_node $CLIENT1 link $DIR/$tfile $DIR/$tdir/$tfile
539 zconf_umount $CLIENT2 $MOUNT2
540 facet_failover $SINGLEMDS
542 client_evicted $CLIENT1 || error "$CLIENT1 not evicted"
543 if ! do_node $CLIENT1 $CHECKSTAT -a $DIR/$tdir/$tfile; then
544 error "link should fail"
547 run_test 5b "link checks version of target parent"
549 test_5c() { # former test_0u
550 local var=${SINGLEMDS}_svc
551 zconf_mount $CLIENT2 $MOUNT2
553 do_facet $SINGLEMDS "$LCTL set_param mdd.${!var}.sync_permission=0"
554 do_facet $SINGLEMDS "$LCTL set_param mdt.${!var}.commit_on_sharing=0"
556 do_node $CLIENT1 openfile -f O_RDWR:O_CREAT -m 0644 $DIR/$tfile
557 do_node $CLIENT1 mkdir -p $DIR/$tdir
559 replay_barrier $SINGLEMDS
560 do_node $CLIENT2 chmod 666 $MOUNT2/$tfile
561 do_node $CLIENT1 link $DIR/$tfile $DIR/$tdir/$tfile
562 zconf_umount $CLIENT2 $MOUNT2
563 facet_failover $SINGLEMDS
565 client_evicted $CLIENT1 || error "$CLIENT1 not evicted"
566 if ! do_node $CLIENT1 $CHECKSTAT -a $DIR/$tdir/$tfile; then
567 error "link should fail"
570 run_test 5c "link checks version of source"
572 test_6a() { # former test_0v
578 do_node $CLIENT1 mcreate $DIR/$tfile
579 do_node $CLIENT1 mkdir -p $DIR/$tdir
580 sp_pre=$(get_version $CLIENT1 $DIR)
581 tp_pre=$(get_version $CLIENT1 $DIR/$tdir)
582 do_node $CLIENT1 mv $DIR/$tfile $DIR/$tdir/$tfile
583 sp_post=$(get_version $CLIENT1 $DIR)
584 tp_post=$(get_version $CLIENT1 $DIR/$tdir)
585 if (($sp_pre != $sp_post)); then
586 error "version of source parent was changed: pre $sp_pre, post $sp_post"
588 if (($tp_pre != $tp_post)); then
589 error "version of target parent was changed: pre $tp_pre, post $tp_post"
592 run_test 6a "rename doesn't change versions of source parent and target parent"
594 test_6b() { # former test_0w
598 do_node $CLIENT1 mcreate $DIR/$tfile
599 pre=$(get_version $CLIENT1 $DIR)
600 do_node $CLIENT1 mv $DIR/$tfile $DIR/$tfile-new
601 post=$(get_version $CLIENT1 $DIR)
602 if (($pre != $post)); then
603 error "version of parent was changed: pre $pre, post $post"
606 run_test 6b "rename within same dir doesn't change version of parent"
608 test_6c() { # former test_0x
609 local var=${SINGLEMDS}_svc
610 zconf_mount $CLIENT2 $MOUNT2
612 do_facet $SINGLEMDS "$LCTL set_param mdd.${!var}.sync_permission=0"
613 do_facet $SINGLEMDS "$LCTL set_param mdt.${!var}.commit_on_sharing=0"
615 do_node $CLIENT1 mcreate $DIR/$tfile
616 do_node $CLIENT1 mkdir -p -m 755 $DIR/$tdir
618 replay_barrier $SINGLEMDS
619 do_node $CLIENT2 chmod 777 $MOUNT2
620 do_node $CLIENT1 mv $DIR/$tfile $DIR/$tdir/$tfile
621 zconf_umount $CLIENT2 $MOUNT2
622 facet_failover $SINGLEMDS
624 client_evicted $CLIENT1 || error "$CLIENT1 not evicted"
625 if do_node $CLIENT1 $CHECKSTAT -a $DIR/$tfile; then
626 error "rename should fail"
629 run_test 6c "rename checks version of source parent"
631 test_6d() { # former test_0y
632 local var=${SINGLEMDS}_svc
633 zconf_mount $CLIENT2 $MOUNT2
635 do_facet $SINGLEMDS "$LCTL set_param mdd.${!var}.sync_permission=0"
636 do_facet $SINGLEMDS "$LCTL set_param mdt.${!var}.commit_on_sharing=0"
638 do_node $CLIENT1 mcreate $DIR/$tfile
639 do_node $CLIENT1 mkdir -p -m 755 $DIR/$tdir
641 replay_barrier $SINGLEMDS
642 do_node $CLIENT2 chmod 777 $MOUNT2/$tdir
643 do_node $CLIENT1 mv $DIR/$tfile $DIR/$tdir/$tfile
644 zconf_umount $CLIENT2 $MOUNT2
645 facet_failover $SINGLEMDS
647 client_evicted $CLIENT1 || error "$CLIENT1 not evicted"
648 if do_node $CLIENT1 $CHECKSTAT -a $DIR/$tfile; then
649 error "rename should fail"
652 run_test 6d "rename checks version of target parent"
654 # pdirops tests, bug 18143
661 local var=${SINGLEMDS}_svc
662 zconf_mount $CLIENT2 $MOUNT2
664 local cname=$TESTNAME.$cycle
666 echo "start cycle: $cname"
667 do_facet $SINGLEMDS "$LCTL set_param mdd.${!var}.sync_permission=0"
668 do_facet $SINGLEMDS "$LCTL set_param mdt.${!var}.commit_on_sharing=0"
670 do_node $CLIENT1 mkdir -p $DIR/$tdir
671 replay_barrier $SINGLEMDS
673 echo "$cname first: $first"
674 do_node $CLIENT1 $first || error "$cname: Cannot do first operation"
675 # client2 operations that will be lost
676 echo "$cname lost: $lost"
677 do_node $CLIENT2 $lost || error "$cname: Cannot do 'lost' operations"
679 echo "$cname last: $last"
680 do_node $CLIENT1 $last || error "$cname: Cannot do last operation"
681 zconf_umount $CLIENT2 $MOUNT2
682 facet_failover $SINGLEMDS
683 # should fail as conflict expected
684 client_evicted $CLIENT1 || rc=1
686 wait_recovery_complete $SINGLEMDS
687 wait_mds_ost_sync $SINGLEMDS
694 first="createmany -o $DIR/$tdir/$tfile- 1"
695 lost="rm $MOUNT2/$tdir/$tfile-0"
696 last="createmany -o $DIR/$tdir/$tfile- 1"
697 test_7_cycle "$first" "$lost" "$last" || error "Test 7a.1 failed"
699 first="createmany -o $DIR/$tdir/$tfile- 1"
700 lost="rm $MOUNT2/$tdir/$tfile-0"
701 last="mkdir $DIR/$tdir/$tfile-0"
702 test_7_cycle "$first" "$lost" "$last" || error "Test 7a.2 failed"
704 first="mkdir $DIR/$tdir/$tfile-0"
705 lost="mv $MOUNT2/$tdir/$tfile-0 $MOUNT2/$tdir/$tfile-1"
706 last="createmany -o $DIR/$tdir/$tfile- 1"
707 test_7_cycle "$first" "$lost" "$last" || error "Test 7a.3 failed"
710 run_test 7a "create, {lost}, create"
713 first="createmany -o $DIR/$tdir/$tfile- 1"
714 lost="rm $MOUNT2/$tdir/$tfile-0; createmany -o $MOUNT2/$tdir/$tfile- 1"
715 last="rm $DIR/$tdir/$tfile-0"
716 test_7_cycle "$first" "$lost" "$last" || error "Test 7b.1 failed"
718 first="createmany -o $DIR/$tdir/$tfile- 1"
719 lost="touch $MOUNT2/$tdir/$tfile; mv $MOUNT2/$tdir/$tfile $MOUNT2/$tdir/$tfile-0"
720 last="rm $DIR/$tdir/$tfile-0"
721 test_7_cycle "$first" "$lost" "$last" || error "Test 7b.2 failed"
723 first="createmany -o $DIR/$tdir/$tfile- 1"
724 lost="rm $MOUNT2/$tdir/$tfile-0; mkdir $MOUNT2/$tdir/$tfile-0"
725 last="rmdir $DIR/$tdir/$tfile-0"
726 test_7_cycle "$first" "$lost" "$last" || error "Test 7b.3 failed"
729 run_test 7b "create, {lost}, unlink"
732 first="createmany -o $DIR/$tdir/$tfile- 1"
733 lost="rm $MOUNT2/$tdir/$tfile-0; createmany -o $MOUNT2/$tdir/$tfile- 1"
734 last="mv $DIR/$tdir/$tfile-0 $DIR/$tdir/$tfile"
735 test_7_cycle "$first" "$lost" "$last" || error "Test 7c.1 failed"
737 first="createmany -o $DIR/$tdir/$tfile- 2"
738 lost="rm $MOUNT2/$tdir/$tfile-0; mkdir $MOUNT2/$tdir/$tfile-0"
739 last="mv $DIR/$tdir/$tfile-1 $DIR/$tdir/$tfile-0"
740 test_7_cycle "$first" "$lost" "$last" || error "Test 7c.2 failed"
742 first="createmany -o $DIR/$tdir/$tfile- 1; mkdir $DIR/$tdir/$tfile-1-0"
743 lost="rmdir $MOUNT2/$tdir/$tfile-1-0; createmany -o $MOUNT2/$tdir/$tfile-1- 1"
744 last="mv $DIR/$tdir/$tfile-1-0 $DIR/$tdir/$tfile-0"
745 test_7_cycle "$first" "$lost" "$last" || error "Test 7c.3 failed"
747 first="createmany -o $DIR/$tdir/$tfile- 1"
748 lost="mv $MOUNT2/$tdir/$tfile-0 $MOUNT2/$tdir/$tfile"
749 last="mv $DIR/$tdir/$tfile $DIR/$tdir/$tfile-0"
750 test_7_cycle "$first" "$lost" "$last" || error "Test 7c.4 failed"
753 run_test 7c "create, {lost}, rename"
756 first="createmany -o $DIR/$tdir/$tfile- 1; rm $DIR/$tdir/$tfile-0"
757 lost="createmany -o $MOUNT2/$tdir/$tfile- 1; rm $MOUNT2/$tdir/$tfile-0"
758 last="createmany -o $DIR/$tdir/$tfile- 1"
759 test_7_cycle "$first" "$lost" "$last" && error "Test 7d.1 failed"
761 first="createmany -o $DIR/$tdir/$tfile- 1; rm $DIR/$tdir/$tfile-0"
762 lost="mkdir $MOUNT2/$tdir/$tfile-0; rmdir $MOUNT2/$tdir/$tfile-0"
763 last="mkdir $DIR/$tdir/$tfile-0"
764 test_7_cycle "$first" "$lost" "$last" && error "Test 7d.2 failed"
766 first="mkdir $DIR/$tdir/$tfile-0; rmdir $DIR/$tdir/$tfile-0"
767 lost="createmany -o $MOUNT2/$tdir/$tfile- 1; mv $MOUNT2/$tdir/$tfile-0 $MOUNT2/$tdir/$tfile-1"
768 last="createmany -o $DIR/$tdir/$tfile- 1"
769 test_7_cycle "$first" "$lost" "$last" && error "Test 7d.3 failed"
772 run_test 7d "unlink, {lost}, create"
775 first="createmany -o $DIR/$tdir/$tfile- 1; rm $DIR/$tdir/$tfile-0"
776 lost="createmany -o $MOUNT2/$tdir/$tfile- 1; rm $MOUNT2/$tdir/$tfile-0;createmany -o $MOUNT2/$tdir/$tfile- 1"
777 last="rm $DIR/$tdir/$tfile-0"
778 test_7_cycle "$first" "$lost" "$last" || error "Test 7e.1 failed"
780 first="mkdir $DIR/$tdir/$tfile-0; rmdir $DIR/$tdir/$tfile-0"
781 lost="mkdir $MOUNT2/$tdir/$tfile-0; rmdir $MOUNT2/$tdir/$tfile-0; mkdir $MOUNT2/$tdir/$tfile-0"
782 last="rmdir $DIR/$tdir/$tfile-0"
783 test_7_cycle "$first" "$lost" "$last" || error "Test 7e.2 failed"
785 first="createmany -o $DIR/$tdir/$tfile- 1; rm $DIR/$tdir/$tfile-0"
786 lost="mkdir $MOUNT2/$tdir/$tfile-0"
787 last="rmdir $DIR/$tdir/$tfile-0"
788 test_7_cycle "$first" "$lost" "$last" || error "Test 7e.3 failed"
790 first="mkdir $DIR/$tdir/$tfile-0; rmdir $DIR/$tdir/$tfile-0"
791 lost="createmany -o $MOUNT2/$tdir/$tfile- 1"
792 last="rm $DIR/$tdir/$tfile-0"
793 test_7_cycle "$first" "$lost" "$last" || error "Test 7e.4 failed"
795 first="createmany -o $DIR/$tdir/$tfile- 2; rm $DIR/$tdir/$tfile-0"
796 lost="mv $MOUNT2/$tdir/$tfile-1 $MOUNT2/$tdir/$tfile-0"
797 last="rm $DIR/$tdir/$tfile-0"
798 test_7_cycle "$first" "$lost" "$last" || error "Test 7e.5 failed"
801 run_test 7e "unlink, {lost}, unlink"
804 first="createmany -o $DIR/$tdir/$tfile- 1; rm $DIR/$tdir/$tfile-0"
805 lost="createmany -o $MOUNT2/$tdir/$tfile- 1"
806 last="mv $DIR/$tdir/$tfile-0 $DIR/$tdir/$tfile-1"
807 test_7_cycle "$first" "$lost" "$last" || error "Test 7f.1 failed"
809 first="createmany -o $DIR/$tdir/$tfile- 2; rm $DIR/$tdir/$tfile-0"
810 lost="createmany -o $MOUNT2/$tdir/$tfile- 1"
811 last="mv $DIR/$tdir/$tfile-1 $DIR/$tdir/$tfile-0"
812 test_7_cycle "$first" "$lost" "$last" || error "Test 7f.2 failed"
814 first="mkdir $DIR/$tdir/$tfile; createmany -o $DIR/$tdir/$tfile- 1; rmdir $DIR/$tdir/$tfile"
815 lost="mkdir $MOUNT2/$tdir/$tfile"
816 last="mv $DIR/$tdir/$tfile-0 $DIR/$tdir/$tfile"
817 test_7_cycle "$first" "$lost" "$last" || error "Test 7f.3 failed"
819 first="createmany -o $DIR/$tdir/$tfile- 2; rm $DIR/$tdir/$tfile-0"
820 lost="mv $MOUNT2/$tdir/$tfile-1 $MOUNT2/$tdir/$tfile-0"
821 last="mv $DIR/$tdir/$tfile-0 $DIR/$tdir/$tfile-1"
822 test_7_cycle "$first" "$lost" "$last" || error "Test 7f.4 failed"
824 first="createmany -o $DIR/$tdir/$tfile- 2; rm $DIR/$tdir/$tfile-0"
825 lost="mkdir $MOUNT2/$tdir/$tfile-0"
826 last="mv $DIR/$tdir/$tfile-1 $DIR/$tdir/$tfile-0"
827 test_7_cycle "$first" "$lost" "$last" || error "Test 7f.5 failed"
830 run_test 7f "unlink, {lost}, rename"
833 first="createmany -o $DIR/$tdir/$tfile- 1; mv $DIR/$tdir/$tfile-0 $DIR/$tdir/$tfile-1"
834 lost="mkdir $MOUNT2/$tdir/$tfile-0;rmdir $MOUNT2/$tdir/$tfile-0"
835 last="createmany -o $DIR/$tdir/$tfile- 1"
836 test_7_cycle "$first" "$lost" "$last" && error "Test 7g.1 failed"
838 first="createmany -o $DIR/$tdir/$tfile- 2; mv $DIR/$tdir/$tfile-0 $DIR/$tdir/$tfile-1"
839 lost="createmany -o $MOUNT2/$tdir/$tfile- 1; rm $MOUNT2/$tdir/$tfile-0"
840 last="mkdir $DIR/$tdir/$tfile-0"
841 test_7_cycle "$first" "$lost" "$last" && error "Test 7g.2 failed"
843 first="createmany -o $DIR/$tdir/$tfile- 1; mv $DIR/$tdir/$tfile-0 $DIR/$tdir/$tfile"
844 lost="createmany -o $MOUNT2/$tdir/$tfile- 1"
845 last="link $DIR/$tdir/$tfile-0 $DIR/$tdir/$tfile-1"
846 test_7_cycle "$first" "$lost" "$last" || error "Test 7g.3 failed"
849 run_test 7g "rename, {lost}, create"
852 first="createmany -o $DIR/$tdir/$tfile- 1; mv $DIR/$tdir/$tfile-0 $DIR/$tdir/$tfile-1"
853 lost="createmany -o $MOUNT2/$tdir/$tfile- 1"
854 last="rm $DIR/$tdir/$tfile-0"
855 test_7_cycle "$first" "$lost" "$last" || error "Test 7h.1 failed"
857 first="createmany -o $DIR/$tdir/$tfile- 2; mv $DIR/$tdir/$tfile-1 $DIR/$tdir/$tfile-0"
858 lost="rm $MOUNT2/$tdir/$tfile-0; createmany -o $MOUNT2/$tdir/$tfile- 1"
859 last="rm $DIR/$tdir/$tfile-0"
860 test_7_cycle "$first" "$lost" "$last" || error "Test 7h.2 failed"
862 first="createmany -o $DIR/$tdir/$tfile- 1; mkdir $DIR/$tdir/$tfile; mv $DIR/$tdir/$tfile-0 $DIR/$tdir/$tfile"
863 lost="rm $MOUNT2/$tdir/$tfile/$tfile-0"
864 last="rmdir $DIR/$tdir/$tfile"
865 #test_7_cycle "$first" "$lost" "$last" || error "Test 7h.3 failed"
868 run_test 7h "rename, {lost}, unlink"
871 first="createmany -o $DIR/$tdir/$tfile- 1; mv $DIR/$tdir/$tfile-0 $DIR/$tdir/$tfile-1"
872 lost="createmany -o $MOUNT2/$tdir/$tfile- 1"
873 last="mv $DIR/$tdir/$tfile-0 $DIR/$tdir/$tfile-1"
874 test_7_cycle "$first" "$lost" "$last" || error "Test 7i.1 failed"
876 first="createmany -o $DIR/$tdir/$tfile- 1; mv $DIR/$tdir/$tfile-0 $DIR/$tdir/$tfile-1"
877 lost="mkdir $MOUNT2/$tdir/$tfile-0"
878 last="mv $DIR/$tdir/$tfile-1 $DIR/$tdir/$tfile-0"
879 test_7_cycle "$first" "$lost" "$last" || error "Test 7i.1 failed"
881 first="createmany -o $DIR/$tdir/$tfile- 3; mv $DIR/$tdir/$tfile-1 $DIR/$tdir/$tfile-0"
882 lost="mv $MOUNT2/$tdir/$tfile-2 $MOUNT2/$tdir/$tfile-0"
883 last="mv $DIR/$tdir/$tfile-0 $DIR/$tdir/$tfile-2"
884 test_7_cycle "$first" "$lost" "$last" || error "Test 7i.3 failed"
886 first="createmany -o $DIR/$tdir/$tfile- 2; mv $DIR/$tdir/$tfile-0 $DIR/$tdir/$tfile"
887 lost="rm $MOUNT2/$tdir/$tfile-1"
888 last="mv $DIR/$tdir/$tfile $DIR/$tdir/$tfile-1"
889 test_7_cycle "$first" "$lost" "$last" || error "Test 7i.4 failed"
892 run_test 7i "rename, {lost}, rename"
894 # test set #8: orphan handling bug 15392.
895 # Unlink during recovery creates orphan always just in case some late open may
896 # arrive. These orphans will be removed after recovery anyway.
897 # Tests check that valid create,unlink,create sequence will work in this case
898 # too but not fail on second create due to orphan found.
901 local var=${SINGLEMDS}_svc
902 zconf_mount $CLIENT2 $MOUNT2
904 do_facet $SINGLEMDS "$LCTL set_param mdt.${!var}.commit_on_sharing=0"
906 do_node $CLIENT1 mcreate $DIR/$tfile
907 do_node $CLIENT1 mkdir $DIR/$tfile-2
908 replay_barrier $SINGLEMDS
909 # missed replay from client2 will lead to recovery by versions
910 do_node $CLIENT2 touch $MOUNT2/$tfile-2/$tfile
911 do_node $CLIENT1 rm $DIR/$tfile || return 1
912 do_node $CLIENT1 touch $DIR/$tfile || return 2
914 zconf_umount $CLIENT2 $MOUNT2
915 facet_failover $SINGLEMDS
916 client_up $CLIENT1 || return 6
918 do_node $CLIENT1 rm $DIR/$tfile || error "$tfile doesn't exists"
921 run_test 8a "create | unlink, create shouldn't fail"
924 local var=${SINGLEMDS}_svc
925 zconf_mount $CLIENT2 $MOUNT2
927 do_facet $SINGLEMDS "$LCTL set_param mdt.${!var}.commit_on_sharing=0"
929 do_node $CLIENT1 touch $DIR/$tfile
930 do_node $CLIENT1 mkdir $DIR/$tfile-2
931 replay_barrier $SINGLEMDS
932 # missed replay from client2 will lead to recovery by versions
933 do_node $CLIENT2 touch $MOUNT2/$tfile-2/$tfile
934 do_node $CLIENT1 rm -f $MOUNT1/$tfile || return 1
935 do_node $CLIENT1 mcreate $MOUNT1/$tfile || return 2
937 zconf_umount $CLIENT2 $MOUNT2
938 facet_failover $SINGLEMDS
939 client_up $CLIENT1 || return 6
941 do_node $CLIENT1 rm $MOUNT1/$tfile || error "$tfile doesn't exists"
944 run_test 8b "create | unlink, create shouldn't fail"
947 local var=${SINGLEMDS}_svc
948 zconf_mount $CLIENT2 $MOUNT2
950 do_facet $SINGLEMDS "$LCTL set_param mdt.${!var}.commit_on_sharing=0"
952 do_node $CLIENT1 touch $DIR/$tfile
953 do_node $CLIENT1 mkdir $DIR/$tfile-2
954 replay_barrier $SINGLEMDS
955 # missed replay from client2 will lead to recovery by versions
956 do_node $CLIENT2 touch $MOUNT2/$tfile-2/$tfile
957 do_node $CLIENT1 rm -f $MOUNT1/$tfile || return 1
958 do_node $CLIENT1 mkdir $MOUNT1/$tfile || return 2
960 zconf_umount $CLIENT2 $MOUNT2
961 facet_failover $SINGLEMDS
962 client_up $CLIENT1 || return 6
964 do_node $CLIENT1 rmdir $MOUNT1/$tfile || error "$tfile doesn't exists"
967 run_test 8c "create | unlink, create shouldn't fail"
970 # This test uses three Lustre clients on two hosts.
972 # Lustre Client 1: $CLIENT1:$MOUNT ($DIR)
973 # Lustre Client 2: $CLIENT2:$MOUNT2 ($DIR2)
974 # Lustre Client 3: $CLIENT2:$MOUNT1 ($DIR1)
976 test_10b() { # former test_2b
979 local var=${SINGLEMDS}_svc
981 [ -n "$CLIENTS" ] || { skip "Need two or more clients" && exit 0; }
982 [ $CLIENTCOUNT -ge 2 ] || \
983 { skip "Need two or more clients, have $CLIENTCOUNT" && exit 0; }
985 do_facet $SINGLEMDS "$LCTL set_param mdd.${!var}.sync_permission=0"
986 do_facet $SINGLEMDS "$LCTL set_param mdt.${!var}.commit_on_sharing=0"
988 zconf_mount $CLIENT1 $MOUNT
989 zconf_mount $CLIENT2 $MOUNT1
990 zconf_mount $CLIENT2 $MOUNT2
991 do_node $CLIENT1 openfile -f O_RDWR:O_CREAT -m 0644 $DIR/$tfile-a
992 do_node $CLIENT1 openfile -f O_RDWR:O_CREAT -m 0644 $DIR/$tfile-b
995 # Save an MDT transaction number before recovery.
997 do_node $CLIENT1 touch $DIR1/$tfile
998 pre=$(get_version $CLIENT1 $DIR/$tfile)
1001 # Comments on the replay sequence state the expected result
1005 # "U" Unable to replay.
1008 replay_barrier $SINGLEMDS
1009 do_node $CLIENT1 chmod 666 $DIR/$tfile-a # R
1010 do_node $CLIENT2 chmod 666 $DIR1/$tfile-b # R
1011 do_node $CLIENT2 chgrp $RUNAS_GID $DIR2/$tfile-a # U
1012 do_node $CLIENT1 chown $RUNAS_ID:$RUNAS_GID $DIR/$tfile-a # J
1013 do_node $CLIENT2 $TRUNCATE $DIR2/$tfile-b 1 # U
1014 do_node $CLIENT2 chgrp $RUNAS_GID $DIR1/$tfile-b # R
1015 do_node $CLIENT1 chown $RUNAS_ID:$RUNAS_GID $DIR/$tfile-b # R
1016 zconf_umount $CLIENT2 $MOUNT2
1017 facet_failover $SINGLEMDS
1019 client_evicted $CLIENT1 || error "$CLIENT1:$MOUNT not evicted"
1020 client_up $CLIENT2 || error "$CLIENT2:$MOUNT1 evicted"
1023 # Check the MDT epoch. $post must be the first transaction
1024 # number assigned after recovery.
1026 do_node $CLIENT2 chmod 666 $DIR1/$tfile
1027 post=$(get_version $CLIENT2 $DIR1/$tfile)
1028 if (($(($pre >> 32)) == $((post >> 32)))); then
1029 error "epoch not changed: pre $pre, post $post"
1032 if (($(($post & 0x00000000ffffffff)) != 1)); then
1033 error "transno should restart from one: got $post"
1036 do_node $CLIENT2 stat $DIR1/$tfile-a
1037 do_node $CLIENT2 stat $DIR1/$tfile-b
1039 do_node $CLIENT2 $CHECKSTAT -p 0666 -u \\\#$UID -g \\\#$UID \
1040 $DIR1/$tfile-a || error "$DIR/$tfile-a: unexpected state"
1041 do_node $CLIENT2 $CHECKSTAT -p 0666 -u \\\#$RUNAS_ID -g \\\#$RUNAS_GID \
1042 $DIR1/$tfile-b || error "$DIR/$tfile-b: unexpected state"
1044 zconf_umount $CLIENT2 $MOUNT1
1046 run_test 10b "3 clients: some, none, and all reqs replayed"
1048 # test set #11: operations in single directory
1050 local var=${SINGLEMDS}_svc
1051 zconf_mount $CLIENT2 $MOUNT2
1053 do_facet $SINGLEMDS "$LCTL set_param mdt.${!var}.commit_on_sharing=0"
1055 replay_barrier $SINGLEMDS
1057 do_node $CLIENT1 createmany -o $DIR/$tfile-1- 100 &
1059 do_node $CLIENT2 createmany -o $MOUNT2/$tfile-2- 100
1060 zconf_umount $CLIENT2 $MOUNT2
1063 facet_failover $SINGLEMDS
1064 # recovery shouldn't fail due to missing client 2
1065 client_up $CLIENT1 || return 1
1066 # All files from client1 should have been replayed
1067 do_node $CLIENT1 unlinkmany $DIR/$tfile-1- 100 || return 2
1069 [ -e $DIR/$tdir/$tfile-2-0 ] && error "$tfile-2-0 exists"
1072 run_test 11a "concurrent creates don't affect each other"
1075 local var=${SINGLEMDS}_svc
1076 zconf_mount $CLIENT2 $MOUNT2
1078 do_facet $SINGLEMDS "$LCTL set_param mdt.${!var}.commit_on_sharing=0"
1080 do_node $CLIENT2 createmany -o $MOUNT2/$tfile-2- 100
1082 replay_barrier $SINGLEMDS
1083 do_node $CLIENT1 createmany -o $DIR/$tfile-1- 100 &
1085 do_node $CLIENT2 unlinkmany -o $MOUNT2/$tfile-2- 100
1086 zconf_umount $CLIENT2 $MOUNT2
1089 facet_failover $SINGLEMDS
1090 # recovery shouldn't fail due to missing client 2
1091 client_up $CLIENT1 || return 1
1092 # All files from client1 should have been replayed
1093 do_node $CLIENT1 unlinkmany $DIR/$tfile-1- 100 || return 2
1095 [ -e $DIR/$tdir/$tfile-2-0 ] && error "$tfile-2-0 exists"
1098 run_test 11b "concurrent creates and unlinks don't affect each other"
1100 # test set #12: lock replay with VBR, bug 16356
1101 test_12a() { # former test_2a
1102 local var=${SINGLEMDS}_svc
1103 zconf_mount $CLIENT2 $MOUNT2
1105 do_facet $SINGLEMDS "$LCTL set_param mdt.${!var}.commit_on_sharing=0"
1107 do_node $CLIENT2 mkdir -p $MOUNT2/$tdir
1108 replay_barrier $SINGLEMDS
1109 do_node $CLIENT2 mcreate $MOUNT2/$tdir/$tfile
1110 do_node $CLIENT1 createmany -o $DIR/$tfile- 25
1111 #client1 read data from client2 which will be lost
1112 do_node $CLIENT1 $CHECKSTAT $DIR/$tdir/$tfile
1113 do_node $CLIENT1 createmany -o $DIR/$tfile-3- 25
1114 zconf_umount $CLIENT2 $MOUNT2
1116 facet_failover $SINGLEMDS
1117 # recovery shouldn't fail due to missing client 2
1118 client_up $CLIENT1 || return 1
1120 # All 50 files should have been replayed
1121 do_node $CLIENT1 unlinkmany $DIR/$tfile- 25 || return 2
1122 do_node $CLIENT1 unlinkmany $DIR/$tfile-3- 25 || return 3
1123 do_node $CLIENT1 $CHECKSTAT $DIR/$tdir/$tfile && return 4
1127 run_test 12a "lost data due to missed REMOTE client during replay"
1129 #restore COS setting
1130 restore_lustre_params < $cos_param_file
1131 rm -f $cos_param_file
1133 [ "$CLIENTS" ] && zconf_mount_clients $CLIENTS $DIR
1135 complete $(basename $0) $SECONDS
1136 check_and_cleanup_lustre