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

storage, factory: fix bootstrap from storage after import #3531

Merged
merged 6 commits into from
Oct 22, 2021

Conversation

AdoAdoAdo
Copy link
Contributor

@AdoAdoAdo AdoAdoAdo commented Oct 22, 2021

When startInEpoch is disabled, instead of failing immediately the bootstrap from storage if the last epoch db does not have the bootstrap data, try to use the previous epoch DB and go from there.

@codecov
Copy link

codecov bot commented Oct 22, 2021

Codecov Report

Merging #3531 (96ecf31) into master (057598a) will increase coverage by 0.00%.
The diff coverage is 56.00%.

❗ Current head 96ecf31 differs from pull request most recent head e614101. Consider uploading reports for the commit e614101 to get more accurate results
Impacted file tree graph

@@           Coverage Diff           @@
##           master    #3531   +/-   ##
=======================================
  Coverage   73.87%   73.88%           
=======================================
  Files         582      581    -1     
  Lines       74618    74583   -35     
=======================================
- Hits        55122    55102   -20     
+ Misses      15086    15077    -9     
+ Partials     4410     4404    -6     
Impacted Files Coverage Δ
factory/bootstrapComponents.go 81.33% <ø> (+0.94%) ⬆️
storage/latestData/latestDataProvider.go 76.25% <56.00%> (-3.62%) ⬇️
p2p/libp2p/netMessenger.go 75.00% <0.00%> (+0.27%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 057598a...e614101. Read the comment docs.

@@ -61,29 +61,54 @@ func NewLatestDataProvider(args ArgsLatestDataProvider) (*latestDataProvider, er
}, nil
}

// Get will return a struct containing the latest data in storage
// Get will return a struct containing the latest usable data for the full archive node in storage
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not necessary for the full archive right now

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

}

// GetParentDirAndLastEpoch returns the parent directory and last epoch
// GetParentDirAndLastEpoch returns the parent directory and last usable epoch for the full archive node
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not necessary for the full archive

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

raduchis
raduchis previously approved these changes Oct 22, 2021
lastEpoch, err := ldp.GetLastEpochFromDirNames(epochDirs, 0)
if err != nil {
return "", 0, err
for index := range epochDirs {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a lot of duplicated code with L71. Can be one function that returns the parentDir, lastEpoch, latestDataFromStorage, err

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

return parentDir, lastEpoch, err
}

func (ldp *latestDataProvider) getLastData() (storage.LatestDataFromStorage, string, uint32, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@LucianMincu LucianMincu merged commit 565479c into master Oct 22, 2021
@LucianMincu LucianMincu deleted the fix-boot-from-storage-after-import branch October 22, 2021 18:43
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

5 participants