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
Conversation
e4af7e5
to
c202f99
Compare
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.
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
@@ -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) { |
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.
should we add similar unique-checks in uploadSlab, I was expecting changes to both the download and upload code
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 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.
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.