Skip to content

rgw: send a multipart completion's part history to GC after its head write - #72116

Open
mmgaggle wants to merge 1 commit into
ceph:mainfrom
mmgaggle:wip-rgw-mp-history-after-head
Open

mmgaggle wants to merge 1 commit into
ceph:mainfrom
mmgaggle:wip-rgw-mp-history-after-head

Conversation

@mmgaggle

@mmgaggle mmgaggle commented Sep 27, 2026 •

Copy link
Copy Markdown
Member

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

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)

…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]>
@github-actions github-actions Bot added the rgw label Sep 27, 2026
@mmgaggle
mmgaggle marked this pull request as ready for review September 27, 2026 09:39
@mmgaggle
mmgaggle requested a review from a team as a code owner September 27, 2026 09:39
@adamemerson adamemerson self-assigned this Sep 30, 2026
@adamemerson adamemerson removed their assignment Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants