]> git.proxmox.com Git - ceph.git/blobdiff - ceph/qa/workunits/mon/pg_autoscaler.sh
import 15.2.0 Octopus source
[ceph.git] / ceph / qa / workunits / mon / pg_autoscaler.sh
index 705a66604de15027045503dd2bebfa22f75aa340..706f87d0e1bda8091f2b3dd10fa00529ba59fa9b 100755 (executable)
@@ -44,35 +44,34 @@ 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
-
-# too much ratio
-ceph osd pool set a target_size_ratio .9
-ceph osd pool set b target_size_ratio .9
-wait_for 60 "ceph health detail | grep POOL_TARGET_SIZE_RATIO_OVERCOMMITTED"
-wait_for 60 "ceph health detail | grep 1.8"
-ceph osd pool set a target_size_ratio 0
-ceph osd pool set b target_size_ratio 0
+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
 
 # target_size
 ceph osd pool set a target_size_bytes 1000000000000000
 ceph osd pool set b target_size_bytes 1000000000000000
-wait_for 60 "ceph health detail | grep POOL_TARGET_SIZE_BYTES_OVERCOMMITTED"
-ceph osd pool set a target_size_bytes 0
+ceph osd pool set a target_size_ratio 0
 ceph osd pool set b target_size_ratio 0
+wait_for 60 "ceph health detail | grep POOL_TARGET_SIZE_BYTES_OVERCOMMITTED"
+
+ceph osd pool set a target_size_bytes 1000
+ceph osd pool set b target_size_bytes 1000
+ceph osd pool set a target_size_ratio 1
+wait_for 60 "ceph health detail | grep POOL_HAS_TARGET_SIZE_BYTES_AND_RATIO"
 
 ceph osd pool rm a a --yes-i-really-really-mean-it
 ceph osd pool rm b b --yes-i-really-really-mean-it