]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/pg_autoscaler: only generate target_* health warnings if targets set 32067/head
authorSage Weil <sage@redhat.com>
Thu, 14 Nov 2019 15:48:24 +0000 (09:48 -0600)
committerNathan Cutler <ncutler@suse.com>
Fri, 6 Dec 2019 13:07:30 +0000 (14:07 +0100)
We may get into a situation where the pool stats appear to exceed the
cluster capacity.  If that happens, don't generate confusing health
messages about the target_{ratio,bytes} pool settings when they aren't
actually set at all.

Fixes: https://tracker.ceph.com/issues/42301
Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit 4e5c4cdeb4e88d034e2fed7d6de97a4322a57adc)

src/pybind/mgr/pg_autoscaler/module.py

index 72fd6b31ef93dd854486cdec41d30e150e3eec5a..2e6dec9d8bee830a894e35ac27e9e5f871f8dd54 100644 (file)
@@ -418,7 +418,7 @@ class PgAutoscaler(MgrModule):
         too_much_target_ratio = []
         for root_id, total in iteritems(total_ratio):
             total_target = total_target_ratio[root_id]
-            if total > 1.0:
+            if total_target > 0 and total > 1.0:
                 too_much_target_ratio.append(
                     'Pools %s overcommit available storage by %.03fx due to '
                     'target_size_ratio %.03f on pools %s' % (
@@ -445,7 +445,7 @@ class PgAutoscaler(MgrModule):
         too_much_target_bytes = []
         for root_id, total in iteritems(total_bytes):
             total_target = total_target_bytes[root_id]
-            if total > root_map[root_id].capacity:
+            if total_target > 0 and total > root_map[root_id].capacity:
                 too_much_target_bytes.append(
                     'Pools %s overcommit available storage by %.03fx due to '
                     'target_size_bytes %s on pools %s' % (