Whamcloud - gitweb
LU-13941 test: Restrict create_count to valid range 98/39798/3
authorShaun Tancheff <shaun.tancheff@hpe.com>
Tue, 15 Sep 2020 21:35:08 +0000 (16:35 -0500)
committerOleg Drokin <green@whamcloud.com>
Fri, 25 Sep 2020 03:13:20 +0000 (03:13 +0000)
create_count range is restricted to:
  [OST_MIN_PRECREATE=32, OST_MAX_PRECREATE=20000]

Enforce this restriction rather that halt with an error.

Test-Parameters: trivial testlist=parallel-scale
HPE-bug-id: LUS-5960
Fixes: 21501dedf64e ("LU-9780 tests: Testing Round-Robin allocation")
Signed-off-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Change-Id: I125f2121a57d16a9031ed21938ce2f0b99b9dea8
Reviewed-on: https://review.whamcloud.com/39798
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Nunez <jnunez@whamcloud.com>
lustre/tests/functions.sh

index 9a27e27..cf35d89 100644 (file)
@@ -1041,7 +1041,7 @@ run_rr_alloc() {
        # Save mdt values, set threshold to 100% i.e always Round Robin,
        # restore the saved values again after creating files...
        save_lustre_params mds1 \
-               "lov.$FSNAME-MDT0000*.qos_threshold_rr" > $qos_prec_objs
+               "lod.$FSNAME-MDT0000*.qos_threshold_rr" > $qos_prec_objs
        save_lustre_params mds1 \
                "osp.$FSNAME-OST*-osc-MDT0000.create_count" >> $qos_prec_objs
 
@@ -1057,10 +1057,20 @@ run_rr_alloc() {
 
        foeo_calc=$((rr_alloc_NFILES * total_MNTPTS / OSTCOUNT))
        local create_count=$((2 * foeo_calc))
-       do_facet mds1 "$LCTL set_param -n \
-               lov.$FSNAME-MDT0000*.qos_threshold_rr 100 \
-               osp.$FSNAME-OST*-osc-MDT0000.create_count $create_count" ||
-               error "failed while setting qos_threshold_rr & creat_count"
+
+       # create_count accepted values:
+       #   [OST_MIN_PRECREATE=32, OST_MAX_PRECREATE=20000]
+       # values outside this range are ignored and -ERANGE is returned.
+       # NOTE: actual maximum value is 16384 (2^14)
+       [[ $create_count -lt 32 ]] && create_count=32
+       [[ $create_count -gt 20000 ]] && create_count=20000
+       local i
+       for i in $(seq $MDSCOUNT); do
+               do_facet mds$i "$LCTL set_param -n \
+                       lod.$FSNAME-MDT0000*.qos_threshold_rr=100 \
+                       osp.$FSNAME-OST*-osc-MDT0000.create_count=$create_count" ||
+                       error "failed while setting qos_threshold_rr & creat_count"
+       done
 
        # Create few temporary files in order to increase the precreated objects
        # to a desired value, before starting 'rr_alloc' app. Due to default