From: Josh Durgin Date: Sun, 2 Feb 2020 21:22:04 +0000 (-0500) Subject: qa: use ratios >1 in pg_autoscaler test X-Git-Tag: v15.1.1~489^2~9 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1ea8ce3480e96aa87b4d4f570022f9844bc54c17;p=ceph.git qa: use ratios >1 in pg_autoscaler test Also check for pg_num_target being set correctly, rather than pg_num, so the test doesn't depend on merging/splitting speed. Signed-off-by: Josh Durgin --- diff --git a/qa/workunits/mon/pg_autoscaler.sh b/qa/workunits/mon/pg_autoscaler.sh index e5bcb0b2d8a4..c4c4810bea86 100755 --- a/qa/workunits/mon/pg_autoscaler.sh +++ b/qa/workunits/mon/pg_autoscaler.sh @@ -44,20 +44,22 @@ wait_for 120 "ceph osd pool get a pg_num | grep 4" wait_for 120 "ceph osd pool get b pg_num | grep 2" # target ratio -ceph osd pool set a target_size_ratio .5 -ceph osd pool set b target_size_ratio .1 -sleep 30 -APGS=$(ceph osd dump -f json-pretty | jq '.pools[0].pg_num') -BPGS=$(ceph osd dump -f json-pretty | jq '.pools[1].pg_num') +ceph osd pool set a target_size_ratio 5 +ceph osd pool set b target_size_ratio 1 +sleep 10 +APGS=$(ceph osd dump -f json-pretty | jq '.pools[0].pg_num_target') +BPGS=$(ceph osd dump -f json-pretty | jq '.pools[1].pg_num_target') test $APGS -gt 100 test $BPGS -gt 10 # small ratio change does not change pg_num -ceph osd pool set a target_size_ratio .7 -ceph osd pool set b target_size_ratio .2 +ceph osd pool set a target_size_ratio 7 +ceph osd pool set b target_size_ratio 2 sleep 10 -ceph osd pool get a pg_num | grep $APGS -ceph osd pool get b pg_num | grep $BPGS +APGS2=$(ceph osd dump -f json-pretty | jq '.pools[0].pg_num_target') +BPGS2=$(ceph osd dump -f json-pretty | jq '.pools[1].pg_num_target') +test $APGS -eq $APGS2 +test $BPGS -eq $BPGS2 # too much ratio ceph osd pool set a target_size_ratio .9