feat!: Update hash cache to support byte ranges for file chunking support #953
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.



What was the problem/requirement? (What/Why)
The hash cache only supports caching the hashes of whole files. We'd like to make a manifest format update that chunks large files, and it will need a hash cache for the chunks.
What was the solution? (How)
By extending the hash cache to support arbitrary byte ranges, it is ready for any chunking scheme. The update follows the table versioning precedent, creating a new V4 table for the hash cache.
What is the impact of this change?
The existing interface for whole file hash caching is unchanged, and new range start/end parameters are available for byte-range hash caching.
How was this change tested?
Implemented unit tests for the change, confirmed all the existing unit tests pass unchanged.
Was this change documented?
Updated the docstrings.
Does this PR introduce new dependencies?
No
Is this a breaking change?
Yes, it updates the hash cache DB schema from V3 to V4.
Does this change impact security?
No
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.