Removing persistance of hashtrees in DB#379
Open
sbagalur wants to merge 1 commit into
Open
Conversation
christides11
previously approved these changes
Feb 25, 2023
12c6497 to
b29e61f
Compare
1d39175 to
bfbb54e
Compare
tbachman
requested changes
Jun 26, 2023
tbachman
left a comment
Contributor
There was a problem hiding this comment.
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).
| self._served_tenants = set(tenants) | ||
| for tenant in self._served_tenants: | ||
| new_state.setdefault(tenant, self._state.get(tenant)) | ||
| if tenant in new_state: |
Contributor
There was a problem hiding this comment.
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?
95a9f2a to
cdb7fd2
Compare
d787bd7 to
43e3d78
Compare
43e3d78 to
9a75f92
Compare
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.
9a75f92 to
7b98757
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.