Project

General

Profile

Actions

Bug #80923

open
KB KB

rgw: a multipart completion refused after it checks a part leaves the part impossible to upload again

Bug #80923: rgw: a multipart completion refused after it checks a part leaves the part impossible to upload again

Added by Kyle Bader 2 months ago. Updated 2 months ago.

Status:
Fix Under Review
Priority:
Normal
Assignee:
Target version:
-
Due date:
% Done:

0%

Source:
Backport:
tentacle, umbrella
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Tags (freeform):
Merge Commit:
Fixed In:
Released In:
Upkeep Timestamp:

Description

Found with the S3Answers spec of the P model of RGW overwrites. Reproduced on main at 7ed73efc1be on a single-host vstart cluster. By code review, tentacle has the same code.

RadosMultipartUpload::complete checks the parts in order. It sends each part's past prefixes to GC (cleanup_part_history, rgw_sal_rados.cc:4645) 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 (rgw_sal_rados.cc:4546-4613), 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:
  • process_first_chunk falls back to a random prefix only when the exclusive create of the head fails. So the next upload of that part number writes its head at the base prefix.
  • cls_rgw_mp_upload_part_info_update then refuses it with -EEXIST, because the prefix is in the part's history (cls_rgw.cc:5119).
  • rgw_http_s3_errors answers that 409 BucketAlreadyExists.

Every retry takes the same prefix, so that part number cannot be uploaded again for the life of the upload. It takes three things: a part uploaded twice (an SDK retry does this), a refused completion, and GC, which waits rgw_gc_obj_min_wait (2 hours by default).

Reproducer: test_multipart_upload_part_after_refused_complete in s3-tests. It needs rgw_gc_obj_min_wait and rgw_gc_processor_period set short on the gateway, and the same values in [s3 main]. It uploads part 1 twice and completes with a wrong ETag for part 2 (400 InvalidPart). After GC, uploading part 1 again is answered 409 BucketAlreadyExists.

A fix could send the history to GC only once the head is written. The P model holds with that change (tcAnsHistoryInvalidThenReupload), and with the other proposed fixes for RGW overwrites (tcAnsFixed*).

MH Updated by Matthew Heler 2 months ago Actions #1

  • Status changed from New to Fix Under Review
  • Assignee set to Kyle Bader
  • Backport changed from tentacle to tentacle, umbrella
  • Pull request ID set to 72116
Actions

Also available in: PDF Atom