]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa: use ratios >1 in pg_autoscaler test
authorJosh Durgin <jdurgin@redhat.com>
Sun, 2 Feb 2020 21:22:04 +0000 (16:22 -0500)
committerKefu Chai <kchai@redhat.com>
Mon, 10 Feb 2020 02:08:36 +0000 (10:08 +0800)
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 <jdurgin@redhat.com>
qa/workunits/mon/pg_autoscaler.sh

index e5bcb0b2d8a4de8edda6ed7e837970cb6e77e04d..c4c4810bea86a2b94db0036363d7403585bc5521 100755 (executable)
@@ -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