start_mds || error "MDT start failed"
start_ost || error "OST start failed"
mount_client $MOUNT || error "client start failed"
+ client_up || error "client_up failed"
}
setup_noconfig() {
stop_ost2
stop_mds
stop_mgs
+ #writeconf to remove all ost2 traces for subsequent tests
+ writeconf
}
run_test 21d "start mgs then ost and then mds"
echo mount pid is ${MOUNT_PID}, mount.lustre pid is ${MOUNT_LUSTRE_PID}
ps --ppid $MOUNT_PID
ps --ppid $MOUNT_LUSTRE_PID
- # FIXME why o why can't I kill these? Manual "ctrl-c" works...
- kill -TERM $MOUNT_LUSTRE_PID
echo "waiting for mount to finish"
ps -ef | grep mount
+ # "ctrl-c" sends SIGINT but it usually (in script) does not work on child process
+ # SIGTERM works but it does not spread to offspring processses
+ kill -s TERM $MOUNT_PID
+ kill -s TERM $MOUNT_LUSTRE_PID
# we can not wait $MOUNT_PID because it is not a child of this shell
local PID1
local PID2
at_max_set 0 mds client
fi
- mkdir -p $MOUNT/testdir
- touch $MOUNT/testdir/test
+ mkdir -p $MOUNT/$tdir
log "Injecting EBUSY on MDS"
# Setting OBD_FAIL_MDS_RESEND=0x136
do_facet $SINGLEMDS "$LCTL set_param fail_loc=0x80000136" || return 2
- log "Stat on a test file"
- stat $MOUNT/testdir/test
+ $LCTL set_param mdc.${FSNAME}*.stats=clear
+
+ log "Creating a test file and stat it"
+ touch $MOUNT/$tdir/$tfile
+ stat $MOUNT/$tdir/$tfile
log "Stop injecting EBUSY on MDS"
do_facet $SINGLEMDS "$LCTL set_param fail_loc=0" || return 3
- rm -f $MOUNT/testdir/test
+ rm -f $MOUNT/$tdir/$tfile
log "done"
# restore adaptive timeout
$LCTL dk $TMP/lustre-log-$TESTNAME.log
+ CONNCNT=`$LCTL get_param mdc.${FSNAME}*.stats | awk '/mds_connect/{print $2}'`
+
# retrieve from the log if the client has ever tried to
# contact the fake server after the loss of connection
FAILCONN=`awk "BEGIN {ret = 0;}
log "ERROR: The client tried to reconnect to the failover server while the primary was busy" && \
return 5
- cleanup
+ # LU-290
+ # When OBD_FAIL_MDS_RESEND is hit, we sleep for 2 * obd_timeout
+ # Reconnects are supposed to be rate limited to one every 5s
+ [ $CONNCNT -gt $((2 * $TIMEOUT / 5 + 1)) ] && \
+ log "ERROR: Too many reconnects $CONNCNT" && \
+ return 6
+
+ cleanup
# remove nid settings
writeconf
}
umount_client $MOUNT || error "Unable to unmount client"
stop_ost2 || error "Unable to stop OST2"
stop_mds || error "Unable to stop MDS"
+ #writeconf to remove all ost2 traces for subsequent tests
+ writeconf
}
run_test 50c "lazystatfs one server down =========================="
umount_client $MOUNT || error "Unable to unmount client"
stop_ost2 || error "Unable to stop OST2"
stop_mds || error "Unable to stop MDS"
+ #writeconf to remove all ost2 traces for subsequent tests
+ writeconf
}
run_test 50d "lazystatfs client/server conn race =========================="
wait $pid
stop_ost2 || return 3
cleanup
+ #writeconf to remove all ost2 traces for subsequent tests
+ writeconf
}
run_test 51 "Verify that mdt_reint handles RMF_MDT_MD correctly when an OST is added"
do_facet mgs $LCTL get_param mgs.MGS.live.$FSNAME | grep OST | wc -l
}
+test_58() { # bug 22658
+ [ "$FSTYPE" != "ldiskfs" ] && skip "not supported for $FSTYPE" && return
+ setup
+ mkdir -p $DIR/$tdir
+ createmany -o $DIR/$tdir/$tfile-%d 100
+ # make sure that OSTs do not cancel llog cookies before we unmount the MDS
+#define OBD_FAIL_OBD_LOG_CANCEL_NET 0x601
+ do_facet mds "lctl set_param fail_loc=0x601"
+ unlinkmany $DIR/$tdir/$tfile-%d 100
+ stop mds
+ local MNTDIR=$(facet_mntpt mds)
+ # remove all files from the OBJECTS dir
+ do_facet mds "mount -t ldiskfs $MDSDEV $MNTDIR"
+ do_facet mds "find $MNTDIR/OBJECTS -type f -delete"
+ do_facet mds "umount $MNTDIR"
+ # restart MDS with missing llog files
+ start_mds
+ do_facet mds "lctl set_param fail_loc=0"
+ reformat
+}
+run_test 58 "missing llog files must not prevent MDT from mounting"
+
test_59() {
start_mgsmds >> /dev/null
local C1=$(count_osts)
[ $C4 -eq 2 ] || error "OST2 writeconf should add log"
stop_ost2 >> /dev/null
cleanup_nocli >> /dev/null
+ #writeconf to remove all ost2 traces for subsequent tests
+ writeconf
}
run_test 59 "writeconf mount option"
+test_60() { # LU-471
+ add mds1 $MDS_MKFS_OPTS --mkfsoptions='\" -E stride=64 -O ^uninit_bg\"' --reformat $(mdsdevname 1)
-test_58() { # bug 22658
- [ "$FSTYPE" != "ldiskfs" ] && skip "not supported for $FSTYPE" && return
- setup
- mkdir -p $DIR/$tdir
- createmany -o $DIR/$tdir/$tfile-%d 100
- # make sure that OSTs do not cancel llog cookies before we unmount the MDS
-#define OBD_FAIL_OBD_LOG_CANCEL_NET 0x601
- do_facet mds "lctl set_param fail_loc=0x601"
- unlinkmany $DIR/$tdir/$tfile-%d 100
- stop mds
- local MNTDIR=$(facet_mntpt mds)
- # remove all files from the OBJECTS dir
- do_facet mds "mount -t ldiskfs $MDSDEV $MNTDIR"
- do_facet mds "find $MNTDIR/OBJECTS -type f -delete"
- do_facet mds "umount $MNTDIR"
- # restart MDS with missing llog files
- start_mds
- do_facet mds "lctl set_param fail_loc=0"
+ dump=$(do_facet $SINGLEMDS dumpe2fs $(mdsdevname 1))
+ rc=${PIPESTATUS[0]}
+ [ $rc -eq 0 ] || error "dumpe2fs $(mdsdevname 1) failed"
+
+ # MDT default has dirdata feature
+ echo $dump | grep dirdata > /dev/null || error "dirdata is not set"
+ # we disable uninit_bg feature
+ echo $dump | grep uninit_bg > /dev/null && error "uninit_bg is set"
+ # we set stride extended options
+ echo $dump | grep stride > /dev/null || error "stride is not set"
reformat
}
-run_test 58 "missing llog files must not prevent MDT from mounting"
+run_test 60 "check mkfs.lustre --mkfsoptions -E -O options setting"
if ! combined_mgs_mds ; then
stop mgs