Bug #80922
openrgw: a conditional DeleteObject that finds no object is answered 204
0%
Description
Found with the S3Answers spec of the P model of RGW overwrites. It checks RGW's answers against AWS's Smithy model of S3 and the S3 User Guide. Reproduced on main at 7ed73efc1be on a single-host vstart cluster. By code review, tentacle has the same code.
If-Match that finds no object is answered 204 No Content, on two paths:
delete_objanswers a key with no object-ENOENTbefore it checks any condition (rgw_rados.cc:7203-7206).- A removal that finds the head already gone ends in
complete_del, whose return replaces the-ENOENT(rgw_rados.cc:7266).
RGWDeleteObj_ObjStore_S3::send_response answers both 204 (rgw_rest_s3.cc:3897-3900).
For general purpose buckets, S3 answers a conditional delete that finds no object 404 Not Found. That includes one that a concurrent delete beat (S3 User Guide, "How to perform conditional deletes"). Only the directory-bucket headers x-amz-if-match-size and x-amz-if-match-last-modified-time answer 204 for a missing object.
With If-Match used to release a lease (DELETE on the lease's ETag), two clients that release the same lease are both told they released it.
Reproducer: test_delete_object_if_match_no_object in s3-tests. The existing test_delete_object_if_match asserts the 204. It dates from when AWS offered conditional deletes only on directory buckets, and would change with a fix.
A fix could answer the -ENOENT of a delete that carries If-Match as 404 NoSuchKey, in both paths. The P model holds with this change (tcAnsNoKeyCondDels).
MH Updated by Matthew Heler 2 months ago
- Assignee set to Kyle Bader
- Backport changed from tentacle to tentacle, umbrella
- Pull request ID set to 72115
MH Updated by Matthew Heler 2 months ago
- Status changed from New to Fix Under Review