From 04f25b26c5aea5b4cf5cb94e939d6fba74228b27 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 30 Jan 2020 11:40:48 -0600 Subject: [PATCH] mgr/insights: make 'insights prune-health-history 0' zap current state The self._health_slot value needs to be updated too if the current key is removed. Fixes: https://tracker.ceph.com/issues/43886 Signed-off-by: Sage Weil --- src/pybind/mgr/insights/module.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pybind/mgr/insights/module.py b/src/pybind/mgr/insights/module.py index 616fc649d6954..a7a12fb7b258b 100644 --- a/src/pybind/mgr/insights/module.py +++ b/src/pybind/mgr/insights/module.py @@ -130,6 +130,8 @@ class Module(MgrModule): for key in self._health_filter(lambda ts: ts <= cutoff): self.log.info("Removing old health slot key {}".format(key)) self.set_store(key, None) + if not hours: + self._health_slot = health_util.HealthHistorySlot() def _health_report(self, hours): """ -- 2.39.5