Whamcloud - gitweb
LU-1999 tests: check LW client eviction in logs
[fs/lustre-release.git] / lustre / tests / recovery-small.sh
index 02b500a..45cf76e 100755 (executable)
@@ -3,7 +3,7 @@
 set -e
 
 #         bug  5494 5493
-ALWAYS_EXCEPT="24   52 $RECOVERY_SMALL_EXCEPT"
+ALWAYS_EXCEPT="24   52    $RECOVERY_SMALL_EXCEPT"
 
 export MULTIOP=${MULTIOP:-multiop}
 PTLDEBUG=${PTLDEBUG:--1}
@@ -1059,7 +1059,10 @@ test_58() { # bug 11546
         lctl set_param fail_loc=0
         drop_bl_callback rm -f $DIR/$tfile
         wait $pid
-        do_facet client "df $DIR"
+        # the first 'df' could tigger the eviction caused by
+        # 'drop_bl_callback', and it's normal case.
+        # but the next 'df' should return successfully.
+        do_facet client "df $DIR" || do_facet client "df $DIR"
 }
 run_test 58 "Eviction in the middle of open RPC reply processing"
 
@@ -1491,6 +1494,48 @@ test_105()
 }
 run_test 105 "IR: NON IR clients support"
 
+cleanup_106() {
+       trap 0
+       umount_client $DIR2
+}
+
+test_106() { # LU-1789
+#define OBD_FAIL_MDC_LIGHTWEIGHT         0x805
+       $LCTL set_param fail_loc=0x805
+
+       trap cleanup_106 EXIT
+
+       # enable lightweight flag on mdc connection
+       mount_client $DIR2
+
+       local MDS_NEXP=$(do_facet $SINGLEMDS \
+                        lctl get_param -n mdt.${mds1_svc}.num_exports |
+                        cut -d' ' -f2)
+       $LCTL set_param fail_loc=0
+
+       touch $DIR2/$tfile || error "failed to create empty file"
+       replay_barrier $SINGLEMDS
+       facet_failover $SINGLEMDS
+
+       # lightweight connection must be evicted
+       touch -c $DIR2/$tfile || true
+       evicted=`dmesg | awk '/test 106/ {start = 1;}
+                             /This client was evicted by .*MDT0000/ {
+                                     if (start) {
+                                             print;
+                                     }
+                             }'`
+       [ -z "$evicted" ] && error "lightweight client not evicted by mds"
+
+       # and all operations performed by lightweight client should be
+       # synchronous, so the file created before mds restart should be there
+       $CHECKSTAT -t file $DIR/$tfile || error "file not present"
+       rm -f $DIR/$tfile
+
+       cleanup_106
+}
+run_test 106 "lightweight connection support"
+
 complete $(basename $0) $SECONDS
 check_and_cleanup_lustre
 exit_status