-
Notifications
You must be signed in to change notification settings - Fork 269
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
Redesign the IAVL tree with pruning in mind #144
Comments
If we do not write values to database every block, that will improve throughput dramatically. But we need to replay all blocks from latest saved state when we restart node. do we have a plan to do this |
yeah this would be need. IF there is a graceful shutdown, we just flush to disk before we shutdown but block replay would be great for recovery in a panic |
See #150 |
Actually, if we do save LastCommit when we do not save IAVL state, then blocks will be replayed automatically for the difference between state height and block height. A graceful shutdown will surely help to save the replay work. So besides the IAVL change you mentioned, we also need to do some changes on cosmos Commit stage. |
Currently working on this by building on top of loom PR (#150). Current designMutableTree has extra fields:
NodeDB has extra fields:
On If version is not going to be persisted to disk, the version is simply saved in When version Orphans:Save orphan to memDB under If there exists snapshot version Can then simply use the old delete algorithm with some minor simplifications/optimizations Open Questions:
from conversation with @jackzampolin |
For recovery, Tendermint store metadata on the Current thinking is that isn't necessarily hard. |
Sounds like you should write up an approach for points 3 and 4 above and we can get some feedback on those. |
This is closed with PR correct @AdityaSripal |
Reopening this as a potential work scope for future iavl work. |
closing this as the goal is referenced in #140 |
When we original designed the IAVL tree, the application state did not prune old state and all versions were kept in memory.
The current default behavior is that we prune we keep the last 100 versions and prune the 101st version. If the application has a the behavior of having "hot" keys that updated on every block, this effective doubles the disk i/o.
At the moment, I think the biggest improvement in IAVL i/o performance is that we introduce awareness of the pruning strategy into the IAVL tree so that generally we don't write values to the database except at snapshot heights.
If pruning is disabled, all values are persisted to the database.
The text was updated successfully, but these errors were encountered: