Whamcloud - gitweb
b=16509 port recovery ending tests to master
authorMikhail Pershin <mikhail.pershin@oracle.com>
Wed, 6 Oct 2010 12:56:41 +0000 (16:56 +0400)
committerVitaly Fertman <vitaly.fertman@sun.com>
Thu, 7 Oct 2010 22:22:28 +0000 (02:22 +0400)
i=grev

lustre/include/obd_support.h
lustre/ptlrpc/import.c
lustre/tests/replay-dual.sh
lustre/tests/replay-single.sh

index 9f01f0c..78c7a97 100644 (file)
@@ -357,6 +357,7 @@ int obd_alloc_fail(const void *ptr, const char *name, const char *type,
 #define OBD_FAIL_PTLRPC_HPREQ_TIMEOUT    0x511
 #define OBD_FAIL_PTLRPC_HPREQ_NOTIMEOUT  0x512
 #define OBD_FAIL_PTLRPC_DROP_REQ_OPC     0x513
+#define OBD_FAIL_PTLRPC_FINISH_REPLAY    0x514
 
 #define OBD_FAIL_OBD_PING_NET            0x600
 #define OBD_FAIL_OBD_LOG_CANCEL_NET      0x601
index 1a461f1..1464917 100644 (file)
@@ -1209,6 +1209,9 @@ static int signal_completed_replay(struct obd_import *imp)
         struct ptlrpc_request *req;
         ENTRY;
 
+        if (unlikely(OBD_FAIL_CHECK(OBD_FAIL_PTLRPC_FINISH_REPLAY)))
+                RETURN(0);
+
         LASSERT(cfs_atomic_read(&imp->imp_replay_inflight) == 0);
         cfs_atomic_inc(&imp->imp_replay_inflight);
 
index c92bf35..ece5b6a 100755 (executable)
@@ -38,6 +38,39 @@ rm -rf $DIR/[df][0-9]*
 
 [ "$DAEMONFILE" ] && $LCTL debug_daemon start $DAEMONFILE $DAEMONSIZE
 
+test_0a() {
+    touch $MOUNT2/$tfile-A # force sync FLD/SEQ update before barrier
+    replay_barrier $SINGLEMDS
+#define OBD_FAIL_PTLRPC_FINISH_REPLAY | OBD_FAIL_ONCE
+    touch $MOUNT2/$tfile
+    createmany -o $MOUNT1/$tfile- 50
+    $LCTL set_param fail_loc=0x80000514
+    facet_failover $SINGLEMDS
+    client_up || return 1
+    umount -f $MOUNT2
+    client_up || return 1
+    zconf_mount `hostname` $MOUNT2 || error "mount2 fais"
+    unlinkmany $MOUNT1/$tfile- 50 || return 2
+    rm $MOUNT2/$tfile || return 3
+    rm $MOUNT2/$tfile-A || return 4
+}
+run_test 0a "expired recovery with lost client"
+
+test_0b() {
+    replay_barrier $SINGLEMDS
+    touch $MOUNT2/$tfile
+    touch $MOUNT1/$tfile-2
+    umount $MOUNT2
+    facet_failover $SINGLEMDS
+    umount -f $MOUNT1
+    zconf_mount `hostname` $MOUNT1 || error "mount1 fais"
+    zconf_mount `hostname` $MOUNT2 || error "mount2 fais"
+    checkstat $MOUNT1/$tfile-2 && return 1
+    checkstat $MOUNT2/$tfile && return 2
+    return 0
+}
+run_test 0b "lost client during waiting for next transno"
+
 test_1() {
     touch $MOUNT1/a
     replay_barrier $SINGLEMDS
index 6ab0a4f..5ae42c3 100755 (executable)
@@ -124,6 +124,15 @@ start_full_debug_logging
 run_test 0c "fld create"
 stop_full_debug_logging
 
+test_0d() {
+    replay_barrier $SINGLEMDS
+    umount $MOUNT
+    facet_failover $SINGLEMDS
+    zconf_mount `hostname` $MOUNT || error "mount fails"
+    client_up || error "post-failover df failed"
+}
+run_test 0d "expired recovery with no clients"
+
 test_1() {
     replay_barrier $SINGLEMDS
     mcreate $DIR/$tfile