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]>
This was referenced Sep 26, 2026
mmgaggle
marked this pull request as ready for review
September 26, 2026 21:44
This was referenced Sep 27, 2026
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]>
done_cancel answers a write that lost the race for the head as its condition dictates. For If-Match: * it answers -ECANCELED with success, though the write never happened: racing a PutObject with If-Match on the old ETag, both are answered 200 while the head holds the other write, and no order of the two explains both answers. For If-Match with an ETag, -ECANCELED has no S3 error and is answered 500 UnknownError. If-None-Match: * answers -ENOENT with success in the same way. Answer each of these with 409 ConditionalRequestConflict, as S3 does for a conditional request that loses to a concurrent operation. The answers that already say what happened, 412 and 404, stay. Fixes: https://tracker.ceph.com/issues/80906 Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Kyle Bader <[email protected]>
When a write loses the race for the head, done_cancel cancels its index op, and the cancel applies remove_objs, then decides how to answer. A completion with If-None-Match: * that loses the race to create the key is refused with 412, and its upload stays: it can be completed again or aborted. But the cancel has already removed its parts' index entries, and the bucket stats undercount the parts until the upload is gone. Decide the answer first, and cancel without remove_objs when the write is answered with an error: its request stays, and so do the entries it would have replaced. A lost race answered as success still removes them. Fixes: https://tracker.ceph.com/issues/80907 Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Kyle Bader <[email protected]>
mmgaggle
force-pushed
the
wip-rgw-cond-lost-race
branch
from
October 1, 2026 19:27
10014b1 to
2cb87ab
Compare
5 of 14 tasks
4 of 14 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depends on #72100; the first two commits are #72100's.
A conditional request that loses the race for the head is answered as
done_cancelmaps the error, and the mapping is wrong both ways (https://tracker.ceph.com/issues/80906):If-Match: *,-ECANCELEDbecomes success, though the write never happened. Racing a PutObject with If-Match on the old ETag, both are answered 200 while the head holds the other write, and no order of the two explains both answers.If-None-Match: *answers-ENOENTthe same way.-ECANCELEDhas no S3 error and is answered 500 UnknownError.Answer each of these with 409 ConditionalRequestConflict, as S3 does for a conditional request that loses to a concurrent operation; the error is added in #72100, which answers a conditional delete's lost race the same way. The answers that already say what happened, 412 and 404, stay.
A completion with
If-None-Match: *that loses the race to create the key is refused, and its upload stays, but the cancel of its index op has already removed its parts' index entries (https://tracker.ceph.com/issues/80907). Decide the answer first, and cancel withoutremove_objswhen the write is answered with an error.The workunit cases
test_conditional_puts_race,test_if_match_losing_raceandtest_refused_complete_keeps_partsin #72096 fail on main and pass with this change on a vstart cluster. The fixes were checked in a formal model of these paths before they were written.Versioned buckets
This branch now contains the new commit on #72100, which keeps a null version's head when it is linked after a DeleteObject of the null version logged its removal. The answer this PR gives a conditional request that loses a race, 409 ConditionalRequestConflict, is the one S3's API model gives a conflicting operation during a conditional write. #72118 now answers a conditional write refused at its olh link the same way.
Checklist