From: Mikhail Pershin Date: Wed, 6 Oct 2010 12:56:41 +0000 (+0400) Subject: b=16509 port recovery ending tests to master X-Git-Tag: 2.0.53.0~5 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=99cd761456b8aa9d970c3e0ec0b3bc2fb6c7411e b=16509 port recovery ending tests to master i=grev --- diff --git a/lustre/include/obd_support.h b/lustre/include/obd_support.h index 9f01f0c..78c7a97 100644 --- a/lustre/include/obd_support.h +++ b/lustre/include/obd_support.h @@ -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 diff --git a/lustre/ptlrpc/import.c b/lustre/ptlrpc/import.c index 1a461f1..1464917 100644 --- a/lustre/ptlrpc/import.c +++ b/lustre/ptlrpc/import.c @@ -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); diff --git a/lustre/tests/replay-dual.sh b/lustre/tests/replay-dual.sh index c92bf35..ece5b6a 100755 --- a/lustre/tests/replay-dual.sh +++ b/lustre/tests/replay-dual.sh @@ -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 diff --git a/lustre/tests/replay-single.sh b/lustre/tests/replay-single.sh index 6ab0a4f..5ae42c3 100755 --- a/lustre/tests/replay-single.sh +++ b/lustre/tests/replay-single.sh @@ -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