Bug #80901
openrgw/dedup: dedup racing writers leaks the source's tail, and can delete data with a copy onto itself
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.
Dedup points the target at the source's tail and keeps the target's ID tag, and it frees the target's old tail at once, not through GC:
- A PutObject, DeleteObject or completion that read the target before dedup still passes its ID-tag guard, and sends the stale manifest to GC. The references dedup took on the source's tail, under the target's tag, are never dropped.
- A copy of the target onto itself that read it before dedup writes the freed tail back into the head.
Reproducers: qa workunit cases test_delete_racing_dedup and test_copy_to_itself_racing_dedup. A DeleteObject, or a copy onto itself, is held across a radosgw-admin dedup exec pass. The first leaves the source's tail and its split-off head object behind after cleanup and GC. In the second, GET stops after 4 MiB with ENOENT on the tail.
Fix: open. Guarding writers on the ID tag cannot catch this, since dedup keeps it, and making writers lose to dedup would drop acknowledged writes.
No data to display