Repository navigation
Delete a shard file that fails its checksum so the retry downloads it again - #56
Merged
Merged
Conversation
…try downloads it again.
Documentation build overview
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a downloaded shard file fails its checksum,
StreamraisesChecksum failurebut leaves the file in the cache. Since #54 a failed download returns the shard toREMOTE, so the nextprepare_shardcall retries; that retry finds the raw file present, skips both the download and the check, and marks the shardLOCALwith the corrupt data. A plain read of a sample in that shard used the file the same way.This deletes the file that failed (the raw file in
_prepare_shard_part, the zip in_decompress_shard_part) before raising, so the next attempt downloads it again. The deletion is skipped when the local directory is the dataset itself (remoteisNoneor equalslocal), using the same check assafe_keep_zip, so a local-only dataset never loses its only copy.Tests:
test_checksum_failure_downloads_shard_againcorrupts the first download of shard 0, uncompressed and zstd, and asserts the first call raises, the file is gone, and the retry downloads it again and reads back correctly. Both cases fail without the change.This was meant for #54 but missed its merge.