Skip to content
Snippets Groups Projects
replay-single.sh 33.2 KiB
Newer Older
Robert Read's avatar
Robert Read committed
	echo "server went back in time!"
	return 5
    fi
    return 0
}
run_test 48 "Don't lose transno when client is evicted (2525)"

alex's avatar
alex committed
# b=3550 - replay of unlink
test_49() {
Wang Di's avatar
Wang Di committed
    replay_barrier $SINGLEMDS
alex's avatar
alex committed
    createmany -o $DIR/$tfile-%d 400 || return 1
    unlinkmany $DIR/$tfile-%d 0 400 || return 2
Wang Di's avatar
Wang Di committed
    fail $SINGLEMDS
alex's avatar
alex committed
    $CHECKSTAT -t file $DIR/$tfile-* && return 3 || true
}
run_test 49 "re-write records to llog as written during fail"

test_50() {
    local osc_dev=`$LCTL device_list | \
Wang Di's avatar
Wang Di committed
               awk '(/ost_svc_$SINGLEMDS_svc/){print $4}' `
    $LCTL --device %$osc_dev recover &&  $LCTL --device %$osc_dev recover
    # give the mds_lov_sync threads a chance to run
    sleep 5
}
run_test 50 "Double OSC recovery, don't LASSERT (3812)"

Yury Umanets's avatar
Yury Umanets committed
# bug 3462 - simultaneous MDC requests
test_51a() {
Wang Di's avatar
Wang Di committed
    replay_barrier_nodf $SINGLEMDS
Yury Umanets's avatar
Yury Umanets committed
    mkdir -p $DIR/${tdir}-1
    mkdir -p $DIR/${tdir}-2
    touch $DIR/${tdir}-2/f
    multiop $DIR/${tdir}-1/f O_c &
    pid=$!
    # give multiop a chance to open
    sleep 1

Wang Di's avatar
Wang Di committed
    do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000115"
Yury Umanets's avatar
Yury Umanets committed
    kill -USR1 $pid
Wang Di's avatar
Wang Di committed
    do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0"
Yury Umanets's avatar
Yury Umanets committed
    $CHECKSTAT -t file $DIR/${tdir}-2/f || return 1

Wang Di's avatar
Wang Di committed
    fail $SINGLEMDS
Yury Umanets's avatar
Yury Umanets committed

    wait $pid || return 2
    $CHECKSTAT -t file $DIR/${tdir}-1/f || return 3
    rm -rf $DIR/${tdir}-*
}
run_test 51a "|X| close request while two MDC requests in flight"

test_51b() {
Wang Di's avatar
Wang Di committed
    replay_barrier_nodf $SINGLEMDS
Yury Umanets's avatar
Yury Umanets committed
    mkdir -p $DIR/$tdir-1
    mkdir -p $DIR/$tdir-2
    multiop $DIR/$tdir-1/f O_c &
    pid=$!
Yury Umanets's avatar
Yury Umanets committed
    # give multiop a chance to open
    # 1 second seems to be not enough, we met already such a cases
    # --umka
    sleep 5
Wang Di's avatar
Wang Di committed
    do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000107"
Yury Umanets's avatar
Yury Umanets committed
    touch $DIR/${tdir}-2/f &
    usleep 500
Wang Di's avatar
Wang Di committed
    do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0"
Yury Umanets's avatar
Yury Umanets committed

    kill -USR1 $pid
    wait $pid || return 1
                                                                                                                             
Wang Di's avatar
Wang Di committed
    fail $SINGLEMDS
Yury Umanets's avatar
Yury Umanets committed

    $CHECKSTAT -t file $DIR/${tdir}-1/f || return 2
    $CHECKSTAT -t file $DIR/${tdir}-2/f || return 3
    rm -rf $DIR/${tdir}-*
}
run_test 51b "|X| open request while two MDC requests in flight"

test_51c() {
Wang Di's avatar
Wang Di committed
    replay_barrier_nodf $SINGLEMDS
Yury Umanets's avatar
Yury Umanets committed
    mkdir -p $DIR/${tdir}-1
    mkdir -p $DIR/${tdir}-2
    multiop $DIR/${tdir}-1/f O_c &
    pid=$!
    # give multiop a chance to open
    sleep 1

Wang Di's avatar
Wang Di committed
    do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000107"
Yury Umanets's avatar
Yury Umanets committed
    touch $DIR/${tdir}-2/f &
Wang Di's avatar
Wang Di committed
    do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0"
Wang Di's avatar
Wang Di committed
    do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000115"
Yury Umanets's avatar
Yury Umanets committed
    kill -USR1 $pid
Wang Di's avatar
Wang Di committed
    do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0"
Wang Di's avatar
Wang Di committed
    fail $SINGLEMDS
Yury Umanets's avatar
Yury Umanets committed

    wait $pid || return 1
    $CHECKSTAT -t file $DIR/${tdir}-1/f || return 2
    $CHECKSTAT -t file $DIR/${tdir}-2/f || return 3
    rm -rf $DIR/${tdir}-*
}
run_test 51c "|X| open request and close request while two MDC requests in flight"

test_51d() {
Wang Di's avatar
Wang Di committed
    replay_barrier_nodf $SINGLEMDS
Yury Umanets's avatar
Yury Umanets committed
    mkdir -p $DIR/${tdir}-1
    mkdir -p $DIR/${tdir}-2
    touch $DIR/${tdir}-2/f
    multiop $DIR/${tdir}-1/f O_c &
    pid=$!
    # give multiop a chance to open
    sleep 1

Wang Di's avatar
Wang Di committed
    do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000122"
Yury Umanets's avatar
Yury Umanets committed
    kill -USR1 $pid
Wang Di's avatar
Wang Di committed
    do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0"
Yury Umanets's avatar
Yury Umanets committed
    #$CHECKSTAT -t file $DIR/${tdir}-2/f || return 1

Wang Di's avatar
Wang Di committed
    fail $SINGLEMDS
Yury Umanets's avatar
Yury Umanets committed

    wait $pid || return 2
    $CHECKSTAT -t file $DIR/${tdir}-1/f || return 3
    rm -rf $DIR/${tdir}-*
}
run_test 51d "|X| close reply while two MDC requests in flight"

test_51e() {
Wang Di's avatar
Wang Di committed
    replay_barrier_nodf $SINGLEMDS
Yury Umanets's avatar
Yury Umanets committed
    mkdir -p $DIR/$tdir-1
    mkdir -p $DIR/$tdir-2
    multiop $DIR/$tdir-1/f O_c &
    pid=$!
    # give multiop a chance to open
    sleep 1

Wang Di's avatar
Wang Di committed
    do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000119"
Yury Umanets's avatar
Yury Umanets committed
    touch $DIR/${tdir}-2/f &
    usleep 500
Wang Di's avatar
Wang Di committed
    do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0"
Yury Umanets's avatar
Yury Umanets committed

    kill -USR1 $pid
    wait $pid || return 1

Wang Di's avatar
Wang Di committed
    fail $SINGLEMDS
Yury Umanets's avatar
Yury Umanets committed

    $CHECKSTAT -t file $DIR/${tdir}-1/f || return 2
    $CHECKSTAT -t file $DIR/${tdir}-2/f || return 3
    rm -rf $DIR/${tdir}-*
}
run_test 51e "|X| open reply while two MDC requests in flight"

test_51f() {
Wang Di's avatar
Wang Di committed
    replay_barrier_nodf $SINGLEMDS
Yury Umanets's avatar
Yury Umanets committed
    mkdir -p $DIR/${tdir}-1
    mkdir -p $DIR/${tdir}-2
    multiop $DIR/${tdir}-1/f O_c &
    pid=$!
    # give multiop a chance to open
    sleep 1

Wang Di's avatar
Wang Di committed
    do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000119"
Yury Umanets's avatar
Yury Umanets committed
    touch $DIR/${tdir}-2/f &
Wang Di's avatar
Wang Di committed
    do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0"
Wang Di's avatar
Wang Di committed
    do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000122"
Yury Umanets's avatar
Yury Umanets committed
    kill -USR1 $pid
Wang Di's avatar
Wang Di committed
    do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0"
Wang Di's avatar
Wang Di committed
    fail $SINGLEMDS
Yury Umanets's avatar
Yury Umanets committed

    wait $pid || return 1
    $CHECKSTAT -t file $DIR/${tdir}-1/f || return 2
    $CHECKSTAT -t file $DIR/${tdir}-2/f || return 3
    rm -rf $DIR/${tdir}-*
}
run_test 51f "|X| open reply and close reply while two MDC requests in flight"

test_51g() {
Wang Di's avatar
Wang Di committed
    replay_barrier_nodf $SINGLEMDS
Yury Umanets's avatar
Yury Umanets committed
    mkdir -p $DIR/${tdir}-1
    mkdir -p $DIR/${tdir}-2
    multiop $DIR/${tdir}-1/f O_c &
    pid=$!
    # give multiop a chance to open
    sleep 1

Wang Di's avatar
Wang Di committed
    do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000119"
Yury Umanets's avatar
Yury Umanets committed
    touch $DIR/${tdir}-2/f &
Wang Di's avatar
Wang Di committed
    do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0"
Wang Di's avatar
Wang Di committed
    do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000115"
Yury Umanets's avatar
Yury Umanets committed
    kill -USR1 $pid
Wang Di's avatar
Wang Di committed
    do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0"
Wang Di's avatar
Wang Di committed
    fail $SINGLEMDS
Yury Umanets's avatar
Yury Umanets committed

    wait $pid || return 1
    $CHECKSTAT -t file $DIR/${tdir}-1/f || return 2
    $CHECKSTAT -t file $DIR/${tdir}-2/f || return 3
    rm -rf $DIR/${tdir}-*
}
run_test 51g "|X| open reply and close request while two MDC requests in flight"

test_51h() {
Wang Di's avatar
Wang Di committed
    replay_barrier_nodf $SINGLEMDS
Yury Umanets's avatar
Yury Umanets committed
    mkdir -p $DIR/${tdir}-1
    mkdir -p $DIR/${tdir}-2
    multiop $DIR/${tdir}-1/f O_c &
    pid=$!
Wang Di's avatar
Wang Di committed
    # give multio:wp a chance to open
Wang Di's avatar
Wang Di committed
    do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000107"
Yury Umanets's avatar
Yury Umanets committed
    touch $DIR/${tdir}-2/f &
Wang Di's avatar
Wang Di committed
    do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0"
Wang Di's avatar
Wang Di committed
    do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000122"
Yury Umanets's avatar
Yury Umanets committed
    kill -USR1 $pid
Wang Di's avatar
Wang Di committed
    do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0"
Wang Di's avatar
Wang Di committed
    fail $SINGLEMDS
Yury Umanets's avatar
Yury Umanets committed

    wait $pid || return 1
    $CHECKSTAT -t file $DIR/${tdir}-1/f || return 2
    $CHECKSTAT -t file $DIR/${tdir}-2/f || return 3
    rm -rf $DIR/${tdir}-*
}
run_test 51h "|X| open request and close reply while two MDC requests in flight"

# b3764 timed out lock replay
test_52() {
    touch $DIR/$tfile
    cancel_lru_locks MDC

    multiop $DIR/$tfile s
Wang Di's avatar
Wang Di committed
    replay_barrier $SINGLEMDS
    do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x8000030c"
    fail $SINGLEMDS
    do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x0"

    $CHECKSTAT -t file $DIR/$tfile-* && return 3 || true
}
run_test 52 "time out lock replay (3764)"

Yury Umanets's avatar
Yury Umanets committed
test_53() {
Wang Di's avatar
Wang Di committed
    replay_barrier_nodf $SINGLEMDS
Yury Umanets's avatar
Yury Umanets committed
    f1=$DIR/${tfile}-1
    cat <<EOF > $f1
#!/bin/sh
true
EOF
    chmod +x $f1
Wang Di's avatar
Wang Di committed
    do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000107"
Yury Umanets's avatar
Yury Umanets committed
    $f1 || return 1
Wang Di's avatar
Wang Di committed
    do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0"
Wang Di's avatar
Wang Di committed
    fail $SINGLEMDS
Yury Umanets's avatar
Yury Umanets committed
    rm -f $f1
}
run_test 53 "|X| open request and close reply while two MDC requests in flight"

test_54() {
Wang Di's avatar
Wang Di committed
    replay_barrier $SINGLEMDS
Yury Umanets's avatar
Yury Umanets committed
    createmany -o $DIR/$tfile 20
    unlinkmany $DIR/$tfile 20
Wang Di's avatar
Wang Di committed
    fail $SINGLEMDS
Yury Umanets's avatar
Yury Umanets committed
}
run_test 54 "|X| open request and close reply while two MDC requests in flight"

#b3440 ASSERTION(rec->ur_fid2->id) failed
test_55() {
    sysctl -w portals.debug=-1 portals.debug_mb=25
    ln -s foo $DIR/$tfile
Wang Di's avatar
Wang Di committed
    replay_barrier $SINGLEMDS
Yury Umanets's avatar
Yury Umanets committed
    #drop_reply "cat $DIR/$tfile"
Wang Di's avatar
Wang Di committed
    fail $SINGLEMDS
Yury Umanets's avatar
Yury Umanets committed
    sleep 10
}
run_test 55 "don't replay a symlink open request (3440)"

#b3761 ASSERTION(hash != 0) failed
test_56() {
# OBD_FAIL_MDS_OPEN_CREATE | OBD_FAIL_ONCE
Wang Di's avatar
Wang Di committed
    do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x8000012b"
Yury Umanets's avatar
Yury Umanets committed
    touch $DIR/$tfile
    pid=$!
    # give a chance for touch to run
    sleep 5
Wang Di's avatar
Wang Di committed
    do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x0"
Yury Umanets's avatar
Yury Umanets committed
    wait $pid || return 1
    rm $DIR/$tfile
    return 0
}
Eric Mei's avatar
Eric Mei committed
run_test 56 "let MDS_CHECK_RESENT return the original return code instead of 0"
alex's avatar
alex committed
#b7312 LASSERT(!IS_ERR(parent)) in reconstruct_open()
test_57() {
    mkdir $DIR/$tdir || return 1
    touch $DIR/$tdir/$tfile || return 2
    multiop $DIR/$tdir/$tfile o_ &
    MULTIPID=$!
    sleep 1
    rm -f $DIR/$tdir/$tfile || return 3
    rm -rf $DIR/$tdir || return 4
    # drop first reint reply
    sysctl -w lustre.fail_loc=0x0000030c
    facet_failover $SINGLEMDS
    df $MOUNT || return 1
    kill -USR1 $MULTIPID || return 5
    wait $MULTIPID || return 6
    sysctl -w lustre.fail_loc=0
}
run_test 57 "open orphan in reconstruct_open()"

test_58() {
	capa=`cat /proc/fs/lustre/mds/mds*/capa`
	if [ "$capa" == "0" ]; then
		echo "skip testing - no capa enabled"
		return 0
	fi
    	sysctl -w lustre.fail_loc=0x0000030c
	rc=multiop $DIR/$tfile Ow
    	sysctl -w lustre.fail_loc=0
	return rc
}
run_test 58 "open+create resent should return capa"

equals_msg test complete, cleaning up
Lai Siyao's avatar
 
Lai Siyao committed
$CLEANUP
Robert Read's avatar
Robert Read committed