-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 prune command to lotus-shed (maybe lotus chain?) #2414
Comments
There is a lot of nuance to this. We can't just retain the state referenced from a single tipset, because consensus uses lookbacks. So we'd need to retain at least one lookback (finality) period. We not only need to retain the state trees from the finality range, but also the tipsets, blocks and messages themselves. Most of the development that will ultimately enable us to prune/lighten the blockstore will be done in #5056.
@travisperson just to confirm, you are thinking of a case where an entry is written such that the key is fully represented, but the value is truncated? Therefore it errors permanently when reading it during the chain processing? In this case, the recovery you have in mind would be to truncate the chain up to the tipset before the borked block was first referenced? |
Ya, the assumption in the original issue is that tipsets link to their parents so the entire chain would be preserved by default. The primary motivation for this was to remove all the objects that are not referenced by the chain. This would include all the small reorgs that occurred over the lifetime of the node.
Ya, for example a failure during chain sync resulted in a partially written object that is part of the state.
In this particular case I would set the head back a few tipsets and then prune all non references objects from the datastore. The idea being that all objects created would then be removed, which would hopefully include the partially written object. |
This kind of exists, but doesn't work very well, the recent splitstore work makes this operation obsolete. |
It would be nice to have the ability to prune all non linked keys (that do not exists under a certain tipset) from the data-store . This can be used as a recovery for when partial writes occur (I believe) in badger, or as an general purpose maintenance to reduce data-store size (eg prune everything from HEAD-1000)
Adding the help wanted tag because I'm interested in feedback on the idea.
The text was updated successfully, but these errors were encountered: