]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/pg_autoscaler: calculate pool_pg_target using pool size 33170/head
authorDan van der Ster <daniel.vanderster@cern.ch>
Fri, 10 Jan 2020 10:36:20 +0000 (11:36 +0100)
committerKonstantin Shalygin <k0ste@k0ste.ru>
Mon, 10 Feb 2020 07:45:51 +0000 (14:45 +0700)
Using raw_used_rate to calculate the pool_pg_target results in too
many PGs for erasure coded pools (e.g. EC 4+2 has raw_used_rate=1.5
but size is 6, so there will be 4x too many PGs). Calculate using
p['size'] instead.

Signed-off-by: Dan van der Ster <daniel.vanderster@cern.ch>
Fixes: https://tracker.ceph.com/issues/43546
(cherry picked from commit b766d5f4086f9b7e2b98a991d979c1865a06051d)

src/pybind/mgr/pg_autoscaler/module.py

index 0868aa2847ef6bc73fed3aafcd7c26ab2190a06d..c3fc1571c03317166eaa03f373cb9274ba82e90a 100644 (file)
@@ -292,7 +292,7 @@ class PgAutoscaler(MgrModule):
             final_ratio = max(capacity_ratio, target_ratio)
 
             # So what proportion of pg allowance should we be using?
-            pool_pg_target = (final_ratio * root_map[root_id].pg_target) / raw_used_rate * bias
+            pool_pg_target = (final_ratio * root_map[root_id].pg_target) / p['size'] * bias
 
             final_pg_target = max(p['options'].get('pg_num_min', PG_NUM_MIN),
                                   nearest_power_of_two(pool_pg_target))