Repository navigation
Conversation
55f5b76 ("fix conditional Delete and MultiDelete") replaced the delete's call to prepare_atomic_modification(removal_op=true), which added a cmpxattr on the ID tag, with check_preconditions, which adds nothing to the op. A delete that races an overwrite now 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. Guard the removal with append_atomic_test again. DeleteObject already answers the -ECANCELED of a lost race with success; answer it the same way in multi-object delete, which reported it as an error before 55f5b76 as well. Fixes: https://tracker.ceph.com/issues/80898 Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Kyle Bader <[email protected]>
With the removal guarded on the ID tag it read, a delete can now lose the race to a write that replaced the head, and gets -ECANCELED. DeleteObject answers that with success, and so does multi-object delete since the previous commit. That is right for an unconditional delete, which counts as ordered before the write. A conditional one (If-Match, If-Match-Size, If-Match-Last-Modified-Time, If-Unmodified-Since) cannot claim its condition held: ordered before the write, its condition was checked against a head that is gone, and ordered after it, the condition was never checked against the new head. Answer a conditional delete's lost race with 409 ConditionalRequestConflict, as S3 does for a conditional request that loses to a concurrent operation, and add that error. Fixes: https://tracker.ceph.com/issues/80906 Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Kyle Bader <[email protected]>
In a bucket whose versioning is suspended, a DeleteObject of the null version unlinks it, which logs the removal of the null instance on the olh, and removes its head when the log is applied. The null version's head is the key's olh head object, which a PutObject of a new null version writes too. When that PutObject wrote the head and linked its version after the removal was logged, but before the log was applied, whoever applied the log, the PutObject itself or the delete, still removed the null instance's head. The new version stayed current and lost its data. The ID-tag guard on the removal does not help, as the removal reads the head afresh. apply_olh_log already cancels an instance's removal when the instance is linked again after an unlink of the olh. Cancel it whenever a later entry links the same instance as a version, as a new null version does. The unlink logs the null instance as "null", the write as the empty instance: treat them as the same. A null delete marker linked afterwards still leaves the removal in place. Tested on vstart: a DeleteObject of the null version held after its unlink, and a PutObject that writes and links meanwhile. Without this change the PutObject's version is current but its head has no object; with it the object reads back whole. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Kyle Bader <[email protected]>
|
the handling for non-versioned buckets looks fine, although I am not sure about the version suspended part. Someone with experience in this part of code can help here @adamemerson |
where is this commit? edit: i now see commit "rgw: keep the head of a null version linked after its removal" for this |
soumyakoduri
left a comment
There was a problem hiding this comment.
Since apply_olh_log() is called separately for each batch read from OLH log, this change seems to be addressing this race only when remove and subsequent relink are read in the same batch.
But in case the ops are split across different OLH log batches, it can still cause this data loss.
| // delete counts as ordered before that write; a conditional one cannot | ||
| // claim its condition held, and answers a conflict for the client to | ||
| // retry | ||
| const bool conditional = if_match || size_match || |
There was a problem hiding this comment.
As mentioned in #71588 (review) , this error should be returned in ConditionalPut and ConditionalCopy cases too.
Is any of the other PRs handling this case for ConditionalPut? ConditionalCopy case probably can be handled as part of #71588 itself (if not done).
| // again, whether or not it becomes current: keep its head. a null | ||
| // version written after a DeleteObject of the null version logged | ||
| // its removal shares the key's head object, and would lose it to | ||
| // that removal. a null delete marker linked after it does not |
There was a problem hiding this comment.
nit: This applies to all delete_markers .. not just null right? Comment needs to be updated.
| ldpp_dout(dpp, 20) << "apply_olh_log applying key=" << entry.key << " epoch=" << iter->first << " delete_marker=" << entry.delete_marker | ||
| << " over current=" << key << " epoch=" << link_epoch << " delete_marker=" << delete_marker << dendl; | ||
|
|
||
| if (need_to_remove) { |
There was a problem hiding this comment.
This block seems redundant now. Needs to be cleaned up.
[Also there seems to be bug here too.. As per this remove was getting cancelled for all entries including delete_marker (provided above if conditions are met). But as per new logic, delete_marker shouldn't be cancelling remove]
|
Hi — while scanning the open-PR backlog with the pr-triage read-only assistant, this pair stood out:
If #72945 is now the canonical branch, consider closing #72100 or marking it superseded to save review queue time. Happy to be wrong if both are intentionally kept open for different reasons. pr-triage note — automated candidate for human review only, not a maintainer decision. Snapshot 2026-11-10 against open PR bases. pr-triage is a personal read-only assistant by @RaminNietzsche; not affiliated with or endorsed by the Ceph project. Please verify (rebase, git cherry, tracker) before acting. |
55f5b762c67("fix conditional Delete and MultiDelete") replaced the delete's call toprepare_atomic_modification(removal_op=true), which added acmpxattron the ID tag, withcheck_preconditions, which adds nothing to the op. A delete that races an overwrite now 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.Guard the removal with
append_atomic_testagain. DeleteObject already answers the lost race's-ECANCELEDwith success; answer it the same way in multi-object delete, which reported it as an error before55f5b762c67as well.The workunit case
test_delete_racing_putin #72096 fails on main (the PutObject's tail remains after GC) and passes with this change on a vstart cluster.Fixes: https://tracker.ceph.com/issues/80898
With the removal guarded, a delete can lose the race to a write that replaced the head. DeleteObject answers that with success, which is right for an unconditional delete. A conditional one (If-Match, If-Match-Size, If-Match-Last-Modified-Time, If-Unmodified-Since) cannot claim its condition held, so the second commit answers its lost race with 409 ConditionalRequestConflict, in DeleteObject and in multi-object delete, and adds that error (https://tracker.ceph.com/issues/80906). The guard also closes a conditional delete deleting an object that fails its If-Match; the workunit case
test_cond_delete_racing_putin #72096 fails on main and passes with this change.Versioned buckets
In a bucket whose versioning is suspended, a DeleteObject of the null version logs the removal of the null instance, and whoever applies the olh log removes its head. If a PutObject wrote the key's head and linked a new null version in between, that removal took the new version's head: the version stayed current and lost its data. A new commit makes
apply_olh_logcancel a pending removal when a later entry links the same instance as a version, with "null" and the empty instance treated as the same key.Validated on vstart with the injection points of #72096: the workunit case
test_suspended_delete_null_racing_putfails without the new commit and passes with it.Not covered here:
apply_olh_logloses a race, the error is treated as a race with another applier, and the rewritten head stays until the log is applied again;versionId=nullchecks its condition apart from the unlink, which needs a cls condition onunlink_instance, like the one rgw: link a conditional write's version only over the version it checked #72118 adds tolink_olh.Checklist