echo "$count archive requests submitted"
}
+cleanup_test_40() {
+ trap 0
+ set_hsm_param max_requests $max_requests
+ copytool_cleanup
+}
+
test_40() {
local stream_count=4
local file_count=100
local i=""
local p=""
local fid=""
+ local max_requests=$(get_hsm_param max_requests)
+
+ # Increase the number of HSM request that can be performed in
+ # parallel. With the coordinator running once per second, this
+ # also limits the number of requests per seconds that can be
+ # performed, so we pick a decent number. But we also need to keep
+ # that number low because the copytool has no rate limit and will
+ # fail some requests if if gets too many at once.
+ set_hsm_param max_requests 300
+
+ trap cleanup_test_40 EXIT
for i in $(seq 1 $file_count); do
for p in $(seq 1 $stream_count); do
wait ${pids[*]}
echo OK
wait_all_done 100
- copytool_cleanup
+
+ cleanup_test_40
}
run_test 40 "Parallel archive requests"
DATA=CEA
DATAHEX='[434541]'
test_104() {
- # test needs a running copytool
- copytool_setup
mkdir -p $DIR/$tdir
local f=$DIR/$tdir/$tfile
fid=$(make_custom_file_for_progress $f 39 1000000)
[ $? != 0 ] && skip "not enough free space" && return
- # if cdt is on, it can serve too quickly the request
- cdt_disable
$LFS hsm_archive --archive $HSM_ARCHIVE_NUMBER --data $DATA $f
local data1=$(do_facet $SINGLEMDS "$LCTL get_param -n\
$HSM_PARAM.actions |\
grep $fid | cut -f16 -d=")
- cdt_enable
[[ "$data1" == "$DATAHEX" ]] ||
error "Data field in records is ($data1) and not ($DATAHEX)"
+ # archive the file
+ copytool_setup
+
+ wait_request_state $fid ARCHIVE SUCCEED
+
copytool_cleanup
}
run_test 104 "Copy tool data field"
+cleanup_test_105() {
+ trap 0
+ set_hsm_param max_requests $max_requests
+ copytool_cleanup
+}
+
test_105() {
+ local max_requests=$(get_hsm_param max_requests)
mkdir -p $DIR/$tdir
local i=""
+ set_hsm_param max_requests 300
+
+ trap cleanup_test_105 EXIT
+
cdt_disable
for i in $(seq -w 1 10); do
cp /etc/passwd $DIR/$tdir/$i
$HSM_PARAM.actions |\
grep WAITING | wc -l")
cdt_restart
+
cdt_disable
local reqcnt2=$(do_facet $SINGLEMDS "$LCTL get_param -n\
$HSM_PARAM.actions |\
[[ "$reqcnt1" == "$reqcnt2" ]] ||
error "Requests count after shutdown $reqcnt2 != "\
"before shutdown $reqcnt1"
+
+ cleanup_test_105
}
run_test 105 "Restart of coordinator"
$LFS hsm_archive --archive $HSM_ARCHIVE_NUMBER $f
+ # wait request to reach CT
+ wait_request_state $fid ARCHIVE STARTED
+
rm -f $f
copytool_continue
copytool_suspend
$LFS hsm_restore $f
+
+ # wait request to reach CT
+ wait_request_state $fid RESTORE STARTED
+
rm -f $f
copytool_continue
copytool_suspend
$LFS hsm_remove $f
+
+ # wait for request to reach CT
+ wait_request_state $fid REMOVE STARTED
+
rm -f $f
copytool_continue
}
run_test 406 "attempting to migrate HSM archived files is safe"
+test_407() {
+ needclients 2 || return 0
+ # test needs a running copytool
+ copytool_setup
+
+ mkdir -p $DIR/$tdir
+
+ local f=$DIR/$tdir/$tfile
+ local f2=$DIR2/$tdir/$tfile
+ local fid
+ fid=$(make_custom_file_for_progress $f 39 1000000)
+ [ $? != 0 ] && skip "not enough free space" && return
+
+ $LFS hsm_archive --archive $HSM_ARCHIVE_NUMBER $f
+ wait_request_state $fid ARCHIVE SUCCEED
+ $LFS hsm_release $f
+
+#define OBD_FAIL_MDS_HSM_CDT_DELAY 0x164
+ do_facet $SINGLEMDS $LCTL set_param fail_val=5 fail_loc=0x164
+
+ md5sum $f &
+ # 1st request holds layout lock while appropriate
+ # RESTORE record is still not added to llog
+ md5sum $f2 &
+ sleep 2
+
+ # after umount hsm_actions->O/x/x log shouldn't have
+ # double RESTORE records like below
+ #[0x200000401:0x1:0x0]...0x58d03a0d/0x58d03a0c action=RESTORE...WAITING
+ #[0x200000401:0x1:0x0]...0x58d03a0c/0x58d03a0d action=RESTORE...WAITING
+ sleep 30 &&
+ do_facet $SINGLEMDS "$LCTL get_param $HSM_PARAM.actions"&
+ fail $SINGLEMDS
+
+ wait_request_state $fid RESTORE SUCCEED
+ copytool_cleanup
+}
+run_test 407 "Check for double RESTORE records in llog"
+
test_500()
{
[ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.6.92) ] &&