perf(cache): fan out large ranged reads through the remote tier#389
Draft
worstell wants to merge 1 commit into
Draft
perf(cache): fan out large ranged reads through the remote tier#389worstell wants to merge 1 commit into
worstell wants to merge 1 commit into
Conversation
Generalize the S3 object-window adapter into objectWindow, a byte window over any pinned object revision, and use it to apply the large-range policy to Remote ranged reads: ranges of 8 MiB or more pay one Stat to learn the object's size and ETag, then split into parallel 4 MiB sub-range requests pinned with If-Match. Chunks stay below the remote's own S3 fan-out threshold so sub-ranges never fan out twice, and memory is bounded by the reader's reorder window (2*concurrency*chunkSize). Ranges the policy cannot pin or split delegate to a single stream.
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.
Generalizes the S3-only window adapter from the large-range work into
objectWindow, a byte window over any pinned object revision, and uses it to extend the large-range policy to the remote HTTP tier.s3ObjectWindowbecomes the genericobjectWindow(range resolution, header synthesis, and offset translation), parameterized by anopenRangefunction so S3 keeps issuing direct sub-range GETs with no behavior change.newCacheObjectWindowbuilds a window over any Range-capable cache via ETag-pinned conditional Opens.Remote.Opensplits ranged reads of ≥ 8 MiB into parallel 4 MiB sub-range requests (concurrency 8) pinned withIf-Match, mirroring how the S3 backend fans out internally. One preliminaryStatresolves the request's conditionals and range against the object's real size and revision; small explicit ranges skip the Stat entirely, and anything the policy cannot pin or split (no ETag, If-Range miss, sub-threshold after clamping) delegates to the existing single stream.Chunks stay below the remote's own S3 large-range threshold, so a sub-range arriving at a remote cachew backed by S3 maps to a single upstream request rather than fanning out twice. Memory per read is bounded by the reader's reorder window (2 × concurrency × chunk size = 64 MiB).
A tiered cache with a remote tier inherits the fan-out with no changes to
Tiereditself, so disk-tier ranged reads are untouched.