Skip to content

Commit

Permalink
pybind/mgr/insights: Don't persist report data
Browse files Browse the repository at this point in the history
Don't store health reports in rocksdb.

Fixes: https://tracker.ceph.com/issues/48269

Signed-off-by: Brad Hubbard <[email protected]>
  • Loading branch information
badone committed Jul 22, 2021
1 parent 11268b3 commit de66522
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/pybind/mgr/insights/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,26 @@ def __init__(self, *args, **kwargs):
# 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"""
Expand Down

0 comments on commit de66522

Please sign in to comment.