Repository navigation
rgw: answer 412 when a CopyObject source precondition fails - #73201
RaminNietzsche wants to merge 1 commit into
Conversation
|
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 (T4b): CopyObject source |
|
@adamemerson Could you take a look when you have a cycle? You approved the sibling RFC 9110 changes (#73200, #73205). All checks are green on the current tip |
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
7223086 to
464eee5
Compare
|
Rebased onto current jenkins test make check |
A CopyObject whose x-amz-copy-source-if-none-match matches the source, or whose x-amz-copy-source-if-modified-since finds it unmodified, is answered 304 Not Modified. The driver evaluates the copy-source conditions with the read prepare used by GET, where these failures are -ERR_NOT_MODIFIED, and RGWCopyObj returns it as is. AWS answers 412 PreconditionFailed, and RFC 9110 13.1.2 and 13.1.3 define 304 only for GET and HEAD. Map -ERR_NOT_MODIFIED to -ERR_PRECONDITION_FAILED in RGWCopyObj, so every SAL driver and both the S3 and Swift copy paths answer 412. A system request with copy-if-newer still gets 304, which tells it the destination is already current. The D4N filter remapped this case itself, but assigned ERR_PRECONDITION_FAILED without the minus sign, so its copy returned a positive value. Drop that remap. Remove fails_on_rgw from test_copy_object_ifnonematch_good, which now passes, and from test_copy_object_ifmatch_failed, which already did, and add cases for If-None-Match: * and If-Modified-Since. Fixes: https://tracker.ceph.com/issues/82230 Signed-off-by: ramin.najarbashi <[email protected]>
464eee5 to
23263a8
Compare
|
This PR has been added to wip-anrao2-testing-2026-11-26-0630-main. |
|
Hi @anrao19 — dev-pipeline #11296 failed only on jammy x86_64 default: Thanks for queuing this. |
Hi @RaminNietzsche typically the component leads will review the QA runs, and make a decision on passing, dropping or rejecting a change. Let's please wait for the review feedback. Thank you. |
@mheler Thanks — understood. I was not asking for a queue change; my note to @anrao19 was only context (Shaman jammy looked like an apt/mirror infra issue, not #73201). I will wait for the component lead’s QA review feedback and follow their pass / drop / reject decision. Thank you. |
A CopyObject whose
x-amz-copy-source-if-none-matchmatches the source, or whosex-amz-copy-source-if-modified-sincefinds it unmodified, is answered 304 Not Modified. AWS answers 412 PreconditionFailed, and RFC 9110 13.1.2 and 13.1.3 define 304 only for GET and HEAD.-ERR_NOT_MODIFIED.RGWCopyObjnow maps that to-ERR_PRECONDITION_FAILED, so every SAL driver and both the S3 and Swift copy paths answer 412. A system request withcopy-if-newerstill gets 304, which tells it the destination is already current.ERR_PRECONDITION_FAILEDwithout the minus sign, so its copy returned a positive value. That remap is dropped.fails_on_rgwis removed fromtest_copy_object_ifnonematch_good(now passes) andtest_copy_object_ifmatch_failed(already passed on main); new cases coverIf-None-Match: *andIf-Modified-Since.Fixes: https://tracker.ceph.com/issues/82230
Testing
On a single-host vstart cluster:
CopySourceIfNoneMatch=<etag of src>CopySourceIfNoneMatch=*CopySourceIfModifiedSince=2100-01-01CopySourceIfModifiedSince=2000-01-01CopySourceIfUnmodifiedSince=2000-01-01CopySourceIfMatch="bad"CopySourceIfNoneMatch="other"s3-tests on this branch:
-k test_copy_object: 7 passed (on main,test_copy_object_ifnonematch_goodfails with 304).-m "not fails_on_rgw" -k "(copy or ifmatch or ifnonematch or ifmodified or ifunmodified) and not enc": 59 passed.test_copy_enc/test_copy_part_encwere not run meaningfully: the test cluster has no SSE-S3/KMS backend, so they fail withInvalidArgumentbefore any precondition is evaluated.The test build has D4N disabled, so the D4N change (removing three lines) was not compiled there.
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.