]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/pg_autoscaler: fix race with pool deletion 30008/head
authorSage Weil <sage@redhat.com>
Wed, 21 Aug 2019 19:56:43 +0000 (14:56 -0500)
committerNathan Cutler <ncutler@suse.com>
Thu, 29 Aug 2019 13:44:20 +0000 (15:44 +0200)
The pool_stats map comes from a get('df') that may not include a pool
because it was just deleted.

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

src/pybind/mgr/pg_autoscaler/module.py

index 99530b3ba67c4877589a0d75a7db3813896f3dc3..7f84f580cdbfc2c71c47a2da583037960ff49b16 100644 (file)
@@ -254,6 +254,9 @@ class PgAutoscaler(MgrModule):
         # iterate over all pools to determine how they should be sized
         for pool_name, p in iteritems(pools):
             pool_id = p['pool']
+            if pool_id not in pool_stats:
+                # race with pool deletion; skip
+                continue
 
             # FIXME: we assume there is only one take per pool, but that
             # may not be true.