Bug #80898
openrgw: DeleteObject racing an overwrite leaks the new object's tail
0%
Description
Found with a formal model of RGW overwrites and multipart uploads P model, and reproduced on main at 44d50f6abb9 on a single-host vstart cluster, except where noted. By code review the same code is in tentacle, except where noted. The reproducers need a radosgw built with injection points. The workunit qa workunit sets its own knobs with ceph config set (qa/workunits/rgw/run-overwrite-races.sh <case>), deletes every key, runs radosgw-admin gc process --include-all, and expects no RADOS object of the bucket to remain.
55f5b762c67 ("fix conditional Delete and MultiDelete") replaced the delete's call to prepare_atomic_modification, which added a cmpxattr on the ID tag, with check_preconditions, which adds nothing to the op. A delete that races an overwrite removes the new head, then sends the manifest it read, the old one, to GC. The new object's tail, or a completion's parts, is never collected.
Reproducer: qa workunit case test_delete_racing_put. A DeleteObject is held at delete_obj_before_head_delete while a PutObject replaces the object. The PutObject's tail remains after cleanup and GC.
Proposed fix: restore the ID-tag guard. DeleteObject already answers the lost race's -ECANCELED with success; multi-object delete should do the same.
KB Updated by Kyle Bader 2 months ago
- Pull request ID set to 72100
KB Updated by Kyle Bader 2 months ago
The same missing guard lets a conditional DeleteObject delete an object that
fails its If-Match. The delete checks the ETag against the head it read, then
removes the head without a guard; a PutObject that lands in between is deleted,
and the delete is answered 204. Reproducer: workunit casetest_cond_delete_racing_put (a delete with If-Match held atdelete_obj_before_head_delete while a PutObject replaces the object). It fails
on main and passes with ceph/ceph#72100.
MH Updated by Matthew Heler 2 months ago
- Status changed from New to Fix Under Review
- Assignee set to Kyle Bader
- Backport changed from tentacle to tentacle, umbrella