-
Notifications
You must be signed in to change notification settings - Fork 4
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
Setting & getting data for the Fast Cache #1
Comments
Also need to rerun/ potentially update the benchmarks to see if we actually sped up reads and how much we slowed down writes |
Notes from call:
|
Is it safe to assume that the index in |
Yeah, we can assume that. Let me know if theres some test failures its causing, if so we then may just have to add new functions and do some updates to the SDK. But I believe they're unused |
Just double checked, merkle proof code doesn't use this, I have no idea why the index param exists. We should file an issue to delete it later as well |
No failures from the incorrect index. However, there are problems with the tests that delete a version and then try to get that deleted version. Since there is no functionality for deleting FastNodes, their values get returned when they should not be. I believe I should also implement the functionality of deleting old versions of the I'll be prototyping that in the next little while |
On more investigation, I think it might be better to delete all |
Shouldn't the fast node get deleted when calling Set with a value thats nil? |
It'd get added to the list of unsaved FastNodes update in mutable tree, and then get persisted when calling SaveVersion? |
At the moment, |
Yes, that's correct. However, we need to delete old versions of fast nodes somewhere when there are updates to the tree. There are use cases where we may do the following:
Therefore, I'm trying to remove the persisted fast nodes from the db when we call |
UPDATE: the incorrect index did cause some test failures. I will go with Dev's suggestion of introducing new Get methods and filing an issue to remove the old methods later |
We are conceptualizing the fast cache as this direct key value store for latest state. For simplicity of deployment / migration logic, our plan is to make this a secondary copy of latest state in the database. (We do more egregious space overheads with the cosmos pruning strategy, so this is not that bad)
IAVL is divided into two trees,
mutable_tree
andimmutable_tree
. Sets only happen on the mutable tree.Things that need to change and be investigated for getting and setting, and the fast node:
MutableTree
forunsavedFastNodeChanges
, and make that a hash map. Then we have every Set update that. Then in SaveVersion we call SaveFastNode on everything in that map. Preferrably, we iterate over this map in deterministic order. (So by sorting the map keys first)t.root.get(t, key)
returns on a non-existent key.testRandomOperations
, intree_random_test.go
Things needed for migration and iteration are relegated to new issues.
The text was updated successfully, but these errors were encountered: