Project

General

Profile

Actions

Bug #80922

open
KB KB

rgw: a conditional DeleteObject that finds no object is answered 204

Bug #80922: rgw: a conditional DeleteObject that finds no object is answered 204

Added by Kyle Bader 2 months ago. Updated 2 months ago.

Status:
Fix Under Review
Priority:
Normal
Assignee:
Target version:
-
Due date:
% Done:

0%

Source:
Backport:
tentacle, umbrella
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Tags (freeform):
Merge Commit:
Fixed In:
Released In:
Upkeep Timestamp:

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.

A DeleteObject with If-Match that finds no object is answered 204 No Content, on two paths:
  • delete_obj answers a key with no object -ENOENT before 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 Actions #1

  • 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 Actions #2

  • Status changed from New to Fix Under Review
Actions

Also available in: PDF Atom