Repository navigation
Conversation
…write RadosMultipartUpload::complete checks the parts in order, and sends each part's past prefixes to GC (cleanup_part_history) before it checks the next part and before the head write. The completion may still be refused after that: InvalidPart or EntityTooSmall for a later part, or a precondition or lost race in write_meta. The upload then stays, and its meta object still lists those prefixes as the part's history. Once GC has deleted them, the part's base prefix is free again. The next upload of that part number writes its head there, since process_first_chunk falls back to a random prefix only when the exclusive create fails, and cls_rgw_mp_upload_part_info_update refuses it with -EEXIST, because the prefix is in the history. That is answered 409 BucketAlreadyExists, and every retry takes the same prefix, so the part cannot be uploaded again for the life of the upload. Collect the history while checking the parts, and send it to GC only once the head is written. A completion refused before that leaves the history in place, for a later completion or an abort to collect. If rgw dies between the head write and the GC send, the meta object is still there, and a retry or an abort collects the history the same way. This is the historyAfterHead fix checked in the P model of RGW overwrites (src/test/formal/p/rgw_overwrite). Fixes: https://tracker.ceph.com/issues/80923 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.
RadosMultipartUpload::complete sends each part's past prefixes to GC (cleanup_part_history) while it checks the parts, before the head write. A completion refused after that - InvalidPart or EntityTooSmall for a later part, or a precondition or lost race in write_meta - leaves the upload, and its meta object still lists those prefixes as the part's history. Once GC has deleted them, the next upload of that part number writes its head at the base prefix again (process_first_chunk falls back to a random prefix only when the exclusive create fails), and cls_rgw_mp_upload_part_info_update refuses it with -EEXIST, answered 409 BucketAlreadyExists. Every retry takes the same prefix, so the part cannot be uploaded again for the life of the upload.
This collects the history while checking the parts and sends it to GC only once the head is written. A completion refused before that leaves the history for a later completion or an abort to collect; if rgw dies between the head write and the GC send, the meta object is still there, and a retry or an abort collects the history the same way. cleanup_part_history keeps its behaviour for its other callers.
The P model of RGW overwrites (#72110) checks this change (historyAfterHead, finding 16), alone and with the other proposed fixes for RGW overwrites.
Fixes: https://tracker.ceph.com/issues/80923
Validated on a single-host vstart cluster with short GC timers: test_multipart_upload_part_after_refused_complete (ceph/s3-tests#763) fails on main and passes with this change, and test_s3.py as the rgw suite runs it shows no new failures.
Versioned buckets
The part history is the same in every bucket kind, and no head manifest names a past prefix, so moving the history after the head write is correct with versioning enabled and suspended. With #72103 applied, a completion that replays an earlier one returns before it sends the history to GC; whichever of the two merges second needs to send it on that path.
Checklist