-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
store/rootmulti: On initialization, prune all old versions according to existing settings #10942
Comments
Is this urgent or could we get it in with the work you are doing on IAVL? |
Its not really urgent, just means that you can't change pruning settings to get space savings on a current node. On chains that don't have state sync (all cosmwasm chains), theres not really a good way to lower disk size in the case of bad pruning configuration. |
another possibly simpler approach could be to create an inverted function to I would love to get this sooner rather than later cause of the rate of growth on networks. |
It seems easy enough to implement a cli cmd to prune old states according to current settings? |
Yes, a CLI command should exist to manually prune. Would love to see this work <3 |
With #12742 merged is this issue still relevant? |
I believe with the upcoming iavl changes this should be solved as well. In the new change we prune up to height so if you make it shorter it will prune all things in the past Closing this due to the new api |
Summary
If you update pruning settings, it will never prune old state. Prune heights are tracked by a pruneHeights variable in RAM thats updated after each block, and a separate region of disk being written to track recent blocks that need to be pruned at next pruning interval.
However, at rootmulti store load, it should get all versions from the underlying database (or at least the oldest version to handle removing keep-every), and then prune everything that should be pruned according to the new settings.
Problem Definition
So node operators can change their pruning settings, and actually get space savings.
Proposal
Add a
GetAllVersions
function to IAVL's nodeDB.In RootMultiStore, change the following logic in loadVersion: https://github.com/cosmos/cosmos-sdk/blob/master/store/rootmulti/store.go#L265-L269 to the following (pseudocode):
For Admin Use
The text was updated successfully, but these errors were encountered: