Skip to content
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

feat(node): more rewind params #2270

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tmpolaczyk
Copy link
Contributor

Add some flags to the rewind JSON-RPC method to allow manually fixing storage with missing items, issue #2102

Command to process all the blocks again to fix missing entries in storage:

{"jsonrpc":"2.0","id":"1","method":"rewind","params":{"mode":{"write_items_to_storage": true}}}

The original use case of trying to recover a forked node still works with the same syntax:

{"jsonrpc":"2.0","id":"1","method":"rewind","params":[10000]}

The main blocker is that if there is actually a missing block, the rewind process stops and the node enters the normal synchronization process which is much slower than a rewind. But eventually it fixes the issue, it is just very slow.

Marking as a draft while I check if I can implement some "resume" functionality to avoid the slow synchronization.

@tmpolaczyk
Copy link
Contributor Author

So this does not work as nicely as expected, because it turns out that writing every item to the storage again does increase the total size used by rocksdb, even if the written data is exactly the same as the existing data. This resulted in my machine running out of disk space during the rewind, and that caused a fatal error leaving the storage in an invalid state, with error "OutputNotFound" when trying to synchronize. And after that the only way to recover is to do another rewind...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant