-
Notifications
You must be signed in to change notification settings - Fork 14
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
base: master
Are you sure you want to change the base?
Conversation
12c6497
to
b29e61f
Compare
1d39175
to
bfbb54e
Compare
There was a problem hiding this 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: |
There was a problem hiding this comment.
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?
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 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.