Skip to content

Removing persistance of hashtrees in DB#379

Open
sbagalur wants to merge 1 commit into
masterfrom
remove_ht_persistance
Open

Removing persistance of hashtrees in DB#379
sbagalur wants to merge 1 commit into
masterfrom
remove_ht_persistance

Conversation

@sbagalur

Copy link
Copy Markdown
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

@tbachman tbachman left a comment

Copy link
Copy Markdown
Contributor

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).

Comment thread aim/agent/aid/universes/aim_universe.py Outdated
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
Copy Markdown
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?

Comment thread aim/tests/unit/agent/aid_universes/test_aim_db_universe.py
Comment thread aim/tests/unit/agent/aid_universes/test_aim_db_universe.py
Comment thread aim/tree_manager.py Outdated
@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