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

Add automated test to reproduce download corruption #303

Merged
merged 8 commits into from Apr 24, 2023

Conversation

ChrisSchinnerl
Copy link
Member

@ChrisSchinnerl ChrisSchinnerl commented Apr 24, 2023

This PR adds a reproduction test concerning the issue debugged in #298.

It also contains the fix for the issue which was the download code being unable to handle slabs where multiple shards were accidentally uploaded to the same host.

@ChrisSchinnerl ChrisSchinnerl force-pushed the chris/reproduction-test-corruption branch from e4af7e5 to c202f99 Compare April 24, 2023 11:22
@ChrisSchinnerl ChrisSchinnerl marked this pull request as ready for review April 24, 2023 12:04
Copy link
Member

@peterjan peterjan left a comment

Choose a reason for hiding this comment

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

PR looks great, most of my comments are good to resolve if you disagree.

I think in your DRAFT there was a change to TestUploadDownload or whatever where we upload a small and large file, the large file wasn't large enough. That change seems to be gone and I think we should re-add that either here or in your other PR.

worker/transfer.go Outdated Show resolved Hide resolved
worker/transfer.go Outdated Show resolved Hide resolved
worker/transfer.go Show resolved Hide resolved
worker/transfer.go Outdated Show resolved Hide resolved
worker/transfer.go Show resolved Hide resolved
@@ -421,11 +465,11 @@ func parallelDownloadSlab(ctx context.Context, sp storeProvider, ss object.SlabS
return shards, timings, nil
}

func downloadSlab(ctx context.Context, sp storeProvider, out io.Writer, ss object.SlabSlice, contracts []api.ContractMetadata, downloadSectorTimeout time.Duration, logger *zap.SugaredLogger) ([]int64, error) {
func downloadSlab(ctx context.Context, sp storeProvider, out io.Writer, ss object.SlabSlice, hosts []api.ContractMetadata, downloadSectorTimeout time.Duration, logger *zap.SugaredLogger) ([]int64, error) {
Copy link
Member

Choose a reason for hiding this comment

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

should we add similar unique-checks in uploadSlab, I was expecting changes to both the download and upload code

Copy link
Member Author

Choose a reason for hiding this comment

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

I didn't want to force that restriction upon the user yet. So if you created a contract set a certain way you can still use it.

@ChrisSchinnerl ChrisSchinnerl merged commit 8851f05 into master Apr 24, 2023
6 checks passed
@ChrisSchinnerl ChrisSchinnerl deleted the chris/reproduction-test-corruption branch April 24, 2023 13:31
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