-
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
Dump the block validation cache whenever we perform an import #4287
Conversation
This solves a problem with folks resurrecting long-out-of-sync nodes via snapshot imports. The interface switch to Batching is necessary: startup is too long otherwise ( 8 minutes just to clear everything on a relatively old node )
chain/store/store.go
Outdated
func (cs *ChainStore) FlushValidationCache() error { | ||
log.Infof("clearing block validation cache...") | ||
|
||
dsWalk, err := cs.ds.Query(query.Query{KeysOnly: true}) |
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.
dsWalk, err := cs.ds.Query(query.Query{KeysOnly: true}) | |
dsWalk, err := cs.ds.Query(query.Query{KeysOnly: true, Prefix: blockValidationCacheKeyPrefix.String()}) |
Then we should be able to drop the prefix check below
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.
Prefix won't work :(
Prefix is for foo/bar
, it doesn't work for foo:bar
which is how we assemble the validation cache via .Instance
higher up
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.
Tested this PR to see if fixes the importing problem, it does! BTW:
So this cache clearing is very fast. Complete importing is 8 min. Looking forward to see this merged, I'd like to nuke >20 Lotus nodes |
This solves (tested on multiple runs) a problem with folks resurrecting long-out-of-sync nodes via
snapshot imports.
The interface switch to Batching is necessary: startup is too long otherwise
( 8 minutes just to clear everything on a relatively old node )