Repository navigation
fix(downloader): keep the largest object size across 416 replica fallbacks - #154
Closed
detail-app[bot] wants to merge 1 commit into
Closed
detail-app[bot] wants to merge 1 commit into
detail-app[bot] wants to merge 1 commit into
Conversation
|
PR author is not in the allowed authors list. |
Member
|
Superseded by #155, which preserves the largest observed 416 size across responses without a size and intervening backend errors, while retaining existing error precedence. The replacement includes regression coverage through the SDK downloader path. |
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.
Detail bug report: View on Detail
Closes #153
Bug
On a ranged read where every replica returns HTTP 416 for an out-of-range page, the 416 response could report a too-small
object_sizein itsContent-Range: bytes */{size}header.download_replicasfalls back across replicas onRangeNotSatisfied(sincea5321a9), accumulating the error to return viarecord_fallback_error.object_sizewith its own smaller one.on_chunk_error) then emittedContent-Range: bytes */{truncated_size}— wrong for object-size discovery. In-range reads self-correct (206 carries the true size), so the impact is limited to clients relying on the 416 header without a follow-up in-range request.Fix
record_fallback_errornow keeps the largestobject_sizeamong accumulatedRangeNotSatisfiederrors, while preserving the existing latest-wins rule for every other priority-3 error.should_attempt_fallback_bucketis unchanged, so the cross-replica 416 fallback behavior froma5321a9is retained.Testing
cargo nextest run --locked --all-features --lib): 99 passed, 1 skipped (simulation::campaign,#[ignore]by design). Addedrange_not_satisfied_fallbacks_keep_the_largest_object_sizeandrange_not_satisfied_survives_lower_priority_fallback_errors(replicas), andrange_not_satisfied_emits_416_with_object_size_content_range(routes, asserting the 416Content-Rangecontract forSome(N)and theNonecase). The largest-size test fails on the pre-fix latest-wins logic (object_size: Some(4)) and passes on the fix (Some(17)), in both fallback orderings.downloader_integration_test(3/3, incl.unsatisfied_ranges_fall_back_to_other_replicas) andserver_integration_test(10/10, incl. the out-of-range 416 case) pass.-D warnings --allow deprecated) and nightlyfmt --checkclean;cargo build --locked --all-features --all-targetssucceeds.Content-Range: bytes */Non 416 (mimicking AWS S3; the RustFS test backend omits it, confirmedobject_size: None) droveDownloader::downloadwith a full primary (size 17) before a truncated fallback (size 4); it returnsSome(17)on the fix andSome(4)on the reverted buggy logic, in both orderings. Not versioned (one-off verification artifact).docker pulldenied); the scripted-connector check exercises the samedownload_replicas → fetch_piece → map_get_object_error → record_fallback_errorpath a real S3 backend would.Automatic Fixes PRs can be configured here.