-
Notifications
You must be signed in to change notification settings - Fork 265
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
Add BatchWithFlusher to iavl tree #771
Conversation
still needs profiling on live osmosis node to compare the results |
will this be able to be part of the next release or should we wait for the next release (unclear when that will be) |
This won't be state breaking so if it's ready we can add this to the next release. But I get errors backporting this to v0.19.x |
gentle ping |
I figure out the deadlock issue is due to the mem db iterator being channel based, the iterator will lock the db during iteration which inturn cause the deadlock. There're already issue on cosmos-db related to this cosmos/cosmos-db#56, cosmos/cosmos-db#47 |
The sdk doesn't use memdb anymore. Maybe we have our own memdb here |
So I have run benchmark on a live osmosis node. Comparing normal iavl batch vs batch with flusher (flush to state at 100KB), the result is almost the same for the case of normal blocks ( blocks that don't cause heavy commit to state ) but for epoch blocks that cause heavy commit, the commit time is reduced by 25%. |
the benchmark also proves that iavl with batch is not state breaking. I've run 10000 blocks with no app hash error so far |
amazing this is super useful!! |
gentle ping on this pr, if you are running this on mainnets then it should be good to merge? |
yes, we can have this on mainnets. Do we want the flush thresh hold to be configurable. If so then we have to change |
here is the commit time of a osmosis epoch block :
Seems like we got the same performance in the range from 25 KB to 750KB. I think we should choose 100KB to be the flush threshold. |
gentle ping, need help completing this? |
thanks for pinging, I will finish this by tomorow |
I've made a new PR for this |
Closes #619
nodeDB
struct andNewMutableTreeWithOpts
to replace uses ofdbm.Batch
toBatchWithFlusher