From: Sage Weil Date: Wed, 21 Aug 2019 19:56:43 +0000 (-0500) Subject: mgr/pg_autoscaler: fix race with pool deletion X-Git-Tag: v15.1.0~1810^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F29807%2Fhead;p=ceph.git mgr/pg_autoscaler: fix race with pool deletion 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 --- diff --git a/src/pybind/mgr/pg_autoscaler/module.py b/src/pybind/mgr/pg_autoscaler/module.py index 2c45c9921746..6c88e4a3a049 100644 --- a/src/pybind/mgr/pg_autoscaler/module.py +++ b/src/pybind/mgr/pg_autoscaler/module.py @@ -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.