Skip to content
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

Error if Remote Ignores HTTP Range Header #4841

Merged
merged 4 commits into from
Sep 20, 2023

Conversation

universalmind303
Copy link
Contributor

@universalmind303 universalmind303 commented Sep 19, 2023

Which issue does this PR close?

Closes #4839

Rationale for this change

What changes are included in this PR?

If a range was requested and the server returned a 200 instead of a 206, we error out as it means that the server didn't fulfill the request.

Are there any user-facing changes?

this could cause some backwards incompatibility with previously working queries no longer working as we are now a bit stricter about what we are expecting.

Some examples that would no longer work

  • a server could satisfy the range request, but due to misconfiguration is still returning a 200.
  • the server never satisfied the range request & we fetched the entire data multiple times.

The latter example is the one this is aiming to prevent. If it can't fulfill the range request, we shouldn't continue on as nothing happened, we should error instead of overfetching data.

@github-actions github-actions bot added the object-store Object Store Interface label Sep 19, 2023
Copy link
Contributor

@tustvold tustvold left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a minor niggle

object_store/src/http/client.rs Outdated Show resolved Hide resolved
@tustvold tustvold changed the title fix: object store http range requests Error if Remote Ignores HTTP Range Header Sep 20, 2023
Co-authored-by: Raphael Taylor-Davies <[email protected]>
@tustvold tustvold merged commit 407e575 into apache:master Sep 20, 2023
13 checks passed
ryanaston pushed a commit to segmentio/arrow-rs that referenced this pull request Nov 6, 2023
* fix: abort http:get on !206 when issuing a range request

* add some comments

* pr feedback

* Update object_store/src/http/client.rs

Co-authored-by: Raphael Taylor-Davies <[email protected]>

---------

Co-authored-by: Raphael Taylor-Davies <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
object-store Object Store Interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

object-store: http shouldn't perform range requests unless accept-ranges: bytes header is present
2 participants