export HSMTOOL=${HSMTOOL:-"lhsmtool_posix"}
export HSMTOOL_VERBOSE=${HSMTOOL_VERBOSE:-""}
+ export HSMTOOL_UPDATE_INTERVAL=${HSMTOOL_UPDATE_INTERVAL:=""}
export HSMTOOL_BASE=$(basename "$HSMTOOL" | cut -f1 -d" ")
HSM_ARCHIVE=$(copytool_device $SINGLEAGT)
HSM_ARCHIVE_NUMBER=2
# independent of hardware
local cmd="$HSMTOOL $HSMTOOL_VERBOSE --daemon --hsm-root $hsm_root"
[[ -z "$arc_id" ]] || cmd+=" --archive $arc_id"
+ [[ -z "$HSMTOOL_UPDATE_INTERVAL" ]] ||
+ cmd+=" --update-interval $HSMTOOL_UPDATE_INTERVAL"
cmd+=" --bandwidth 1 $lustre_mntpnt"
# Redirect the standard output and error to a log file which
error "request on $fid is not $state on $mds"
}
+wait_request_progress() {
+ local fid=$1
+ local request=$2
+ local progress=$3
+ # 4th arg (mdt index) is optional
+ local mdtidx=${4:-0}
+ local mds=mds$((mdtidx + 1))
+
+ local cmd="$LCTL get_param -n ${MDT_PREFIX}${mdtidx}.hsm.active_requests"
+ cmd+=" | awk '/'$fid'.*action='$request'/ {print \\\$12}' | cut -f2 -d="
+
+ wait_result $mds "$cmd" $progress 100 ||
+ error "request on $fid has not made progress $progress on $mds"
+}
+
get_request_state() {
local fid=$1
local request=$2
}
run_test 58 "Truncate a released file will trigger restore"
+test_60() {
+ local interval=5
+ local progress_timeout=$((interval * 2))
+
+ # test needs a new running copytool
+ copytool_cleanup
+ HSMTOOL_UPDATE_INTERVAL=$interval copytool_setup
+
+ mkdir -p $DIR/$tdir
+ local f=$DIR/$tdir/$tfile
+ local fid=$(make_large_for_progress $f)
+
+ local start_at=$(date +%s)
+ $LFS hsm_archive --archive $HSM_ARCHIVE_NUMBER $f ||
+ error "could not archive file"
+ wait_request_progress $fid ARCHIVE 5242880
+ local finish_at=$(date +%s)
+ local elapsed=$((finish_at - start_at))
+
+ if [ $elapsed -gt $progress_timeout ]; then
+ error "Expected progress update within $progress_timeout seconds"
+ elif [ $elapsed -lt $interval ]; then
+ error "Expected progress update after at least $interval seconds"
+ fi
+
+ cdt_clear_no_retry
+ copytool_cleanup
+}
+run_test 60 "Changing progress update interval from default"
+
test_90() {
file_count=57
mkdir -p $DIR/$tdir
" each line of <list_file> consists of <old_FID> <new_FID>\n"
" %s [options] --max-sequence <fsname>\n"
" return the max fid sequence of archived files\n"
- " -A, --archive <#> Archive number (repeatable)\n"
- " -p, --hsm-root <path> Target HSM mount point\n"
- " -q, --quiet Produce less verbose output\n"
- " -v, --verbose Produce more verbose output\n"
- " -c, --chunk-size <sz> I/O size used during data copy\n"
- " (unit can be used, default is MB)\n"
- " --abort-on-error Abort operation on major error\n"
- " --dry-run Don't run, just show what would be done\n"
- " --bandwidth <bw> Limit I/O bandwidth (unit can be used\n,"
- " default is MB)\n",
+ " --abort-on-error Abort operation on major error\n"
+ " -A, --archive <#> Archive number (repeatable)\n"
+ " -b, --bandwidth <bw> Limit I/O bandwidth (unit can be used\n,"
+ " default is MB)\n"
+ " --dry-run Don't run, just show what would be done\n"
+ " -c, --chunk-size <sz> I/O size used during data copy\n"
+ " (unit can be used, default is MB)\n"
+ " -p, --hsm-root <path> Target HSM mount point\n"
+ " -q, --quiet Produce less verbose output\n"
+ " -u, --update-interval <s> Interval between progress reports sent\n"
+ " to Coordinator\n"
+ " -v, --verbose Produce more verbose output\n",
cmd_name, cmd_name, cmd_name, cmd_name, cmd_name);
exit(rc);
{"no_xattr", no_argument, &opt.o_copy_xattrs, 0},
{"quiet", no_argument, NULL, 'q'},
{"rebind", no_argument, NULL, 'r'},
- {"report", required_argument, &opt.o_report_int, 0},
+ {"update-interval", required_argument, NULL, 'u'},
+ {"update_interval", required_argument, NULL, 'u'},
{"verbose", no_argument, NULL, 'v'},
{0, 0, 0, 0}
};
unsigned long long unit;
optind = 0;
- while ((c = getopt_long(argc, argv, "A:b:c:hiMp:qrv",
+ while ((c = getopt_long(argc, argv, "A:b:c:hiMp:qru:v",
long_opts, NULL)) != -1) {
switch (c) {
case 'A':
case 'r':
opt.o_action = CA_REBIND;
break;
+ case 'u':
+ opt.o_report_int = atoi(optarg);
+ if (opt.o_report_int < 0) {
+ rc = -EINVAL;
+ CT_ERROR(rc, "bad value for -%c '%s'", c,
+ optarg);
+ return rc;
+ }
+ break;
case 'v':
opt.o_verbose++;
break;