Bug #80900
openrgw: CopyObject onto itself racing an overwrite can delete the object's data
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.
A metadata-only copy onto itself reads the manifest, then writes it back with keep_tail. The write re-reads the head and guards on whatever ID tag it finds then. An overwrite between the two steps sends the old tail to GC, and the copy writes that tail back into the head. GC then deletes the tail the head names, and the overwrite's own tail leaks.
Reproducer: s3-tests test_object_copy_to_itself_racing_put s3-tests commit. RGW config: rgw_inject_delay_pattern = copy_obj_before_write_meta, rgw_inject_delay_sec = 20, with short GC timers as in U2. After GC, GET returns the first 4 MiB and then stalls; RGW logs op status=-2 from reading the tail.
Proposed fix: guard the copy's write on the ID tag the copy read, and skip the exclusive-create attempt for such a write.
KB Updated by Kyle Bader 2 months ago
- Pull request ID set to 72101
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