Whamcloud - gitweb
LU-5581 ldlm: evict clients returning errors on ASTs
[fs/lustre-release.git] / lustre / tests / recovery-small.sh
index 13a0f3e..0573e30 100755 (executable)
@@ -196,6 +196,41 @@ test_10b() {
 }
 run_test 10b "re-send BL AST"
 
+test_10d() {
+       local before=$(date +%s)
+       local evict
+       # sleep 1 is to make sure that BEFORE is not equal to EVICTED below
+       sleep 1
+       rm -f $TMP/$tfile
+       echo -n ", world" | dd of=$TMP/$tfile bs=1c seek=5
+
+       mount_client $MOUNT2
+
+       $LFS setstripe -i 0 -c 1 $DIR1/$tfile
+       echo -n hello > $DIR1/$tfile
+
+       stat $DIR2/$tfile >& /dev/null
+       $LCTL set_param fail_err=71
+       drop_bl_callback_once "echo -n \\\", world\\\" >> $DIR2/$tfile"
+
+       client_reconnect
+
+       cmp $DIR1/$tfile $DIR2/$tfile || error "file contents differ"
+       cmp $DIR1/$tfile $TMP/$tfile || error "wrong content found"
+
+       evict=$(do_facet client $LCTL get_param osc.$FSNAME-OST0000*.state | \
+               tr -d '\-\[\] ' | \
+         awk -F"[ [,]" '/EVICTED$/ { if (mx<$1) {mx=$1;} } END { print mx }')
+
+       [[ $evict -gt $before ]] ||
+               (do_facet client $LCTL get_param osc.$FSNAME-OST0000*.state;
+                   error "no eviction: $evict before:$before")
+
+       rm $TMP/$tfile
+       umount_client $MOUNT2
+}
+run_test 10d "test failed blocking ast"
+
 #bug 2460
 # wake up a thread waiting for completion after eviction
 test_11(){