Repository navigation
Conversation
A bucket listing drops a pending index op that is older than rgw_pending_bucket_index_op_expiration, and repairs the entry from the head it reads. If a write stalled past the expiry before its head write, the listing repairs the entry from the old head, or removes it for a new key. The write then writes its head, and its index completion fails with -EINVAL because its tag is gone. The completion is asynchronous and the error is dropped, so the index keeps listing the old object, or nothing. When a completion comes back -EINVAL, run a fresh index transaction for the key in the completion manager's thread: prepare a new pending op, read the head, and complete from the head as it is now, with its epoch; a delete whose head is still gone completes with its own epoch, and anything else cancels. remove_objs go along either way. A racing write or delete either sees the new pending op or is ordered by epoch, as for any write. Applying the late completion in cls_rgw when its epoch is newer would not do: an entry a delete has removed keeps no epoch, so it would bring the deleted object back. Factor the head-to-entry conversion out of check_disk_state into head_dir_meta() for the re-link to share. Fixes: https://tracker.ceph.com/issues/80903 Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Kyle Bader <[email protected]>
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.
A bucket listing drops a pending index op older than
rgw_pending_bucket_index_op_expirationand repairs the entry from the head it reads. If a write stalled past the expiry before its head write, the listing repairs the entry from the old head, or removes it for a new key. The write then writes its head, and its index completion fails with-EINVALbecause its tag is gone; the completion is asynchronous and the error is dropped, so the index keeps listing the old object, or nothing.When a completion comes back
-EINVAL, run a fresh index transaction for the key in the completion manager's thread: prepare a new pending op, read the head, and complete from the head as it is now, with its epoch. A delete whose head is still gone completes with its own epoch, and anything else cancels;remove_objsgo along either way. A racing write or delete either sees the new pending op or is ordered by epoch, as for any write. Applying the late completion incls_rgwwhen its epoch is newer would not do: an entry a delete has removed keeps no epoch, so it would bring the deleted object back.Also factor the head-to-entry conversion out of
check_disk_stateintohead_dir_meta()for the re-link to share.The s3-test
test_listing_during_stalled_put(https://github.com/mmgaggle/s3-tests/tree/wip-rgw-overwrite-races), which holds a PutObject past a short pending-op expiry with the injection points in #72096, fails on main and passes with this change on a vstart cluster. The design was checked with a formal model (https://github.com/mmgaggle/ceph/tree/cdbbbb09245535782e91503ad45b0cc7a423e10d/src/test/formal/p/rgw_overwrite) in listing scenarios with writers that stall, including a new key's first write and a racing delete.Fixes: https://tracker.ceph.com/issues/80903
Versioned buckets
A versioned write's pending op sits on the version's instance entry, or for a null version over a key with an olh, on the null instance entry behind the key's version marker. Neither ListObjects nor ListObjectVersions repairs those entries, so the loss this PR fixes does not occur there, and the re-link does not run for them. Validated on vstart with workunit cases that list a bucket during a stalled PutObject, with versioning enabled and suspended.
Checklist