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

Merge range #4749

Merged
merged 6 commits into from
Jul 19, 2022
Merged

Merge range #4749

merged 6 commits into from
Jul 19, 2022

Conversation

enriavil1
Copy link
Contributor

Using MergeRange struct instead of from, to uint64 which is the same as the MergeRange struct.
Got rid of missing snapshot errors and added warning if we couldn't get missing snapshots
Made RequestSnapshotDownload more reusable

@@ -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)
Copy link
Collaborator

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.

Copy link
Collaborator

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

Copy link
Contributor Author

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

@AskAlexSharov AskAlexSharov merged commit e768227 into devel Jul 19, 2022
@AskAlexSharov AskAlexSharov deleted the merge-range branch July 19, 2022 12:27
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.

None yet

2 participants