From 9d45bd9cc96b4f15c13b94113219c76d7af732cc Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 21 Aug 2019 14:56:43 -0500 Subject: [PATCH] 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 --- src/pybind/mgr/pg_autoscaler/module.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pybind/mgr/pg_autoscaler/module.py b/src/pybind/mgr/pg_autoscaler/module.py index 2c45c992174..6c88e4a3a04 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. -- 2.39.5