]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/pg_autoscaler: fix race with pool deletion 29807/head
authorSage Weil <sage@redhat.com>
Wed, 21 Aug 2019 19:56:43 +0000 (14:56 -0500)
committerSage Weil <sage@redhat.com>
Wed, 21 Aug 2019 19:56:43 +0000 (14:56 -0500)
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>
src/pybind/mgr/pg_autoscaler/module.py

index 2c45c9921746a4ab26ca76c92bd34b9c4ba131b4..6c88e4a3a0497cc881126c5d47ad113c9567fe3c 100644 (file)
@@ -256,6 +256,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.