-
Notifications
You must be signed in to change notification settings - Fork 10
rgw/sfs: recognize delete-marker on DeleteObj #241
base: s3gw
Are you sure you want to change the base?
rgw/sfs: recognize delete-marker on DeleteObj #241
Conversation
RGWDeleteObj::execute() relies on the return code from rgw::sal::Object::get_obj_state() to ascert the object being deleted is a regular object rather than a delete-marker. The rule is to return -ENOENT to signal a delete-marker. get_obj_state() in rgw/sfs was returning always 0 for any object, therefore also a delete-marker fell into a regular object in RGWDeleteObj::execute(). This is wrong because, when dealing with object lock checks, a delete-marker is always allowed to be deleted regardless of the object's retention mode. Returing 0 was incorrectly preventing a delete-marker to be deleted for object-lock protected objects. Fixes: https://github.com/aquarist-labs/s3gw/issues/690 Signed-off-by: Giuseppe Baccini <giuseppe.baccini@suse.com>
Unfortunately, this patch even if it seems correct, breaks some tests:
Reasons to say this is correct are:
pay especially attention to the comment:
The rados implementation is less straightforward but the @jecluis @0xavi0 @tserong @irq0 |
What causes these tests to fail? |
The problem seems to be that all the occurrences like this:
Are not adequate when dealing with a delete-marker. |
opened upstream issue https://tracker.ceph.com/issues/63542 asking for clarifications |
RGWDeleteObj::execute()
relies on the return code fromrgw::sal::Object::get_obj_state()
to ascertain the object being deleted is a regular object rather than a delete-marker.The rule is to return
-ENOENT
to signal a delete-marker.get_obj_state()
in rgw/sfs was returning always 0 for any object, therefore also a delete-marker fell into a regular object inRGWDeleteObj::execute()
.This is wrong because, when dealing with object lock checks, a delete-marker is always allowed to be deleted regardless of the object's retention mode. Returing 0 was incorrectly preventing a delete-marker to be deleted for object-lock protected objects.
Fixes: https://github.com/aquarist-labs/s3gw/issues/690
Contribution Guidelines
Checklist