-
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
feat: snapshot: remove existing chain #11032
Conversation
Remove existing chain on a snapshot-import log info instead of print log info instead of print Remove defer lock Remove defer lock, and explicitly close the lockedRepo instead
With regards to this:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good, has it been tested?
It has been tested on a node running with SplitStore, and on a node running without SplitStore and it removed the chain data successfully on both before starting the import of the snapshot. Two question I have for you @ZenGround0 is:
|
Remove unused clearSplitStoreDir function
Extract removeExistingChain to seperate func
Check error
Updated the PR with some changes based on feedback/reviews:
|
Testing on a SplitStore-node:
See that there is data in the chain-folder:
See that there is data in the splitstore-folder:
Run
Check that existing chain data was removed before the import-snapshot started:
And
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for bearing with the late review here
What is the difference between clearSplitstoreDir and deleteSplitstoreKeys
I forget what I was doing, the clear..
function doesn't delete the top level dir, you used the simpler / better one. One thing however: I think we should confirm that if you delete the splitstore data and run the node with splitstore then it correctly recreates the splitstore dir on startup. I think you might have already tested this, just double checking.
Docs (todo):
Since we're not making this the default I think we're good to merge without changing chain management docs.
Related Issues
Closes: #10958
Proposed Changes
Add a flag (
remove-existing-chain
) to remove the existing chain data on import of a snapshot, reducing manual operation needed when node operators want to prune their current chain.Additional Info
Some open questions:
Testing:
Docs (todo):
Checklist
Before you mark the PR ready for review, please make sure that:
<PR type>: <area>: <change being made>
fix: mempool: Introduce a cache for valid signatures
PR type
: fix, feat, build, chore, ci, docs, perf, refactor, revert, style, testarea
, e.g. api, chain, state, market, mempool, multisig, networking, paych, proving, sealing, wallet, deps