-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Merge range #4749
Merge range #4749
Conversation
eth/stagedsync/stage_headers.go
Outdated
@@ -1336,7 +1336,7 @@ func WaitForDownloader(ctx context.Context, cfg HeadersCfg, tx kv.RwTx) error { | |||
if !dbEmpty { | |||
_, missingSnapshots, err = snapshotsync.Segments(cfg.snapshots.Dir()) | |||
if err != nil { | |||
return err | |||
log.Warn("[Snapshots] missing segments coudln't be downloaded", "err", err) |
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.
This method may return various error: for example "permission denied to read directory". can't skip all of them.
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.
I think this method must return "missed snapshot" as parameter, not as error. and use err for real errors
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.
Okay! the method already doesn't return any error if we are missing snapshots, but instead a []MergeRange
of the missing snapshots, so we can just warn that we are missing snapshots if len(missingSnapshots) > 0
Using
MergeRange
struct instead offrom, to uint64
which is the same as theMergeRange
struct.Got rid of missing snapshot errors and added warning if we couldn't get missing snapshots
Made
RequestSnapshotDownload
more reusable