Repository navigation
rgw: send Content-Range with 416 InvalidRange responses - #73200
RaminNietzsche wants to merge 1 commit into
Conversation
A GetObject whose range cannot be satisfied is answered 416 with no Content-Range. RFC 9110 sections 14.4 and 15.5.17 say a server that answers 416 to a byte-range request should send the complete length as "Content-Range: bytes */<length>", and AWS S3 does; clients that resume downloads read the object size from it. The S3 and Swift send_response_data() return on error before they dump the range. When the range parsed and the object turned out too short or empty, send the unsatisfied-range form with the object size. A range that did not parse also ends in -ERANGE, but the object has not been read then, so no size is sent. Fixes: https://tracker.ceph.com/issues/82229 Signed-off-by: ramin.najarbashi <[email protected]>
|
The probe script used for the before/after checks is here: https://gist.github.com/RaminNietzsche/818ad8dd6b8d8093560183cd09d2b169 It runs against a vstart RGW ( |
RFC 9110 RGW audit — series contextThis PR is one focused change from an RFC 9110 conformance review of RGW (S3, Swift, Admin, STS). Each PR is meant to review and merge on its own; there is no batch dependency unless called out below.
Same audit, already tracked on other PRs (not part of this series authorship):
Follow-ups from the audit not opened yet: T4d Shared repro script and sample output: https://gist.github.com/RaminNietzsche/818ad8dd6b8d8093560183cd09d2b169 ( This PR (T1): RFC 9110 §14.4 — unsatisfiable range responses should include |
|
jenkins test make check arm64 |
|
This PR has been added to wip-anrao6-testing-2026-11-13-0833-main. |
A GetObject whose
Rangecannot be satisfied is answered 416 with noContent-Range. RFC 9110 14.4 and 15.5.17 say a server answering 416 to a byte-range request should send the complete length asContent-Range: bytes */<length>, and AWS S3 does; clients that resume downloads read the object size from it.The S3 and Swift
send_response_data()return on error before they dump the range. When the range parsed and the object turned out too short or empty, this sends the unsatisfied-range form with the object size. A range that did not parse also ends in-ERANGE(withrgw_ignore_get_invalid_range=false), but the object has not been read at that point, so no size is sent for it.Fixes: https://tracker.ceph.com/issues/82229
Testing
On a single-host vstart cluster built from this branch (on main, the 416 answers carry no
Content-Range; see the tracker):Range: bytes=100-200Content-Range: bytes */10Range: bytes=0-1Content-Range: bytes */0Range: bytes=5-9Content-Range: bytes 5-9/10Range: bytes=9-3(does not parse)Content-RangeRange: bytes=100-200Content-Range: bytes */10Range: bytes=2-3Content-Range: bytes 2-3/10s3-tests:
test_ranged_request_invalid_rangeandtest_ranged_request_empty_objectnow assert the header;-k test_ranged_requestpasses (5 tests).Contribution Guidelines
To sign and title your commits, please refer to Submitting Patches to Ceph.
If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an
xbetween the brackets:[x]. Spaces and capitalization matter when checking off items this way.Checklist
Show available Jenkins commands
jenkins test classic perfJenkins Job | Jenkins Job Definitionjenkins test crimson perfJenkins Job | Jenkins Job Definitionjenkins test signedJenkins Job | Jenkins Job Definitionjenkins test make checkJenkins Job | Jenkins Job Definitionjenkins test make check arm64Jenkins Job | Jenkins Job Definitionjenkins test submodulesJenkins Job | Jenkins Job Definitionjenkins test dashboardJenkins Job | Jenkins Job Definitionjenkins test dashboard cephadmJenkins Job | Jenkins Job Definitionjenkins test apiJenkins Job | Jenkins Job Definitionjenkins test docsReadTheDocs | Github Workflow Definitionjenkins test ceph-volume allJenkins Jobs | Jenkins Jobs Definitionjenkins test windowsJenkins Job | Jenkins Job Definitionjenkins test rook e2eJenkins Job | Jenkins Job DefinitionYou must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.