]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/progress: Skip pg_summary update if _events dict is empty. 35973/head
authorManuel Lausch <manuel.lausch@1und1.de>
Wed, 8 Jul 2020 09:42:37 +0000 (11:42 +0200)
committerManuel Lausch <manuel.lausch@1und1.de>
Thu, 9 Jul 2020 06:53:07 +0000 (08:53 +0200)
The get call of pg_stats and pg_ready are expensive and are not necessary in this case. This avoids blocking other modules like the prometheus module

Fixes: https://tracker.ceph.com/issues/46416
Signed-off-by: Manuel Lausch <manuel.lausch@1und1.de>
src/pybind/mgr/progress/module.py

index 1198c04d83ab3d6109457562b424f6768b07baaa..78aa278d8f950143b59b077ea11f3cadb09dd058 100644 (file)
@@ -530,6 +530,10 @@ class Module(MgrModule):
             ))
             self._osdmap_changed(old_osdmap, self._latest_osdmap)
         elif notify_type == "pg_summary":
+            # if there are no events we will skip this here to avoid 
+            # expensive get calls
+            if len(self._events) == 0:
+                return
             data = self.get("pg_stats")
             ready = self.get("pg_ready")
             for ev_id in list(self._events):