Skip to content

Removing persistance of hashtrees in DB #379

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sbagalur
Copy link
Collaborator

This commit removes persisting the hashtrees in DB. Instead the hashtrees are saved in memory. This helps reduce the space issues when there are is a large set of config on the device. We still save empty hashtrees in the DB. This is done to make the impact minimal and not to affect the current workflow of AIM.

christides11
christides11 previously approved these changes Feb 25, 2023
@sbagalur sbagalur force-pushed the remove_ht_persistance branch from 12c6497 to b29e61f Compare April 20, 2023 21:02
@sbagalur sbagalur force-pushed the remove_ht_persistance branch 4 times, most recently from 1d39175 to bfbb54e Compare June 23, 2023 21:41
Copy link
Contributor

@tbachman tbachman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, nicely done! One general comment - it would be helpful to have a comment message that explains what's being done at a high level (e.g. introduction of the in-memory hash tree, but still using the DB for the hash tree roots), along with an explanation for why we're moving away from persisting hash trees (e.g. hash tree BLOBs in the DB were getting too big, and interested in reducing DB load).

@@ -79,7 +80,10 @@ def serve(self, context, tenants):
LOG.debug('%s serving tenants: %s' % (self.name, tenants))
self._served_tenants = set(tenants)
for tenant in self._served_tenants:
new_state.setdefault(tenant, self._state.get(tenant))
if tenant in new_state:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this needed? new_state starts as an empty dictionary, and the iteration is over a list of tenants, which should be unique. Is there a case where tenant would be in new_state?

@sbagalur sbagalur force-pushed the remove_ht_persistance branch 3 times, most recently from 95a9f2a to cdb7fd2 Compare June 29, 2023 17:52
@sbagalur sbagalur force-pushed the remove_ht_persistance branch from d787bd7 to 43e3d78 Compare September 10, 2024 17:58
@sbagalur sbagalur force-pushed the remove_ht_persistance branch from 43e3d78 to 9a75f92 Compare October 16, 2024 21:37
This removes persisting the hashtrees in DB. Instead, the hashtrees are saved
in-memory. We do still use the DB for the hash tree roots. This is done to make
the impact minimal and not to affect the current workflow of AIM. This helps
reduce the  size of hash tree BLOBs in the DB, as they were getting too big. It
also reduces the DB load.
@sbagalur sbagalur force-pushed the remove_ht_persistance branch from 9a75f92 to 7b98757 Compare November 26, 2024 06:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants