]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind/mgr/insights: Don't persist report data
authorBrad Hubbard <bhubbard@redhat.com>
Thu, 22 Apr 2021 04:56:37 +0000 (14:56 +1000)
committerLaura Paduano <lpaduano@suse.com>
Thu, 5 Aug 2021 09:54:40 +0000 (11:54 +0200)
Don't store health reports in rocksdb.

Fixes: https://tracker.ceph.com/issues/48269
Signed-off-by: Brad Hubbard <bhubbard@redhat.com>
(cherry picked from commit de66522517edd6f7baf19cc0660478502d3c25e8)

src/pybind/mgr/insights/module.py

index a640d85b7469195a15f1d43ed2e3fd490fcca307..af2a51309d4d87078a9f0ba8b62029e478aa86f0 100644 (file)
@@ -42,6 +42,26 @@ class Module(MgrModule):
         # health history tracking
         self._pending_health = []
         self._health_slot = None
+        self._store = {}
+
+    # The following three functions, get_store, set_store, and get_store_prefix
+    # mask the functions defined in the parent to avoid storing large keys
+    # persistently to disk as that was proving problematic. Long term we may
+    # implement a different mechanism to make these persistent. When that day
+    # comes it should just be a matter of deleting these three functions.
+    def get_store(self, key):
+        return self._store.get(key)
+
+    def set_store(self, key, value):
+        if value is None:
+            if key in self._store:
+                del self._store[key]
+        else:
+            self._store[key] = value
+
+    def get_store_prefix(self, prefix):
+        return { k: v for k, v in self._store.items() if k.startswith(prefix) }
+
 
     def notify(self, ttype, ident):
         """Queue updates for processing"""