Project

General

Profile

Actions

Bug #80896

open
KB KB

rgw: a multipart completion that leaves its meta object behind lets a retry or abort delete the completed object's data

Bug #80896: rgw: a multipart completion that leaves its meta object behind lets a retry or abort delete the completed object's data

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:
2 - major
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Tags (freeform):
Merge Commit:
Fixed In:
Released In:
Upkeep Timestamp:

Description

Found with a formal model of RGW overwrites and multipart uploads P model, and reproduced on main at 44d50f6abb9 on a single-host vstart cluster, except where noted. By code review the same code is in tentacle, except where noted. The reproducers need a radosgw built with injection points.

A completion answers success once the head is written; the meta object is deleted afterwards. The meta object survives with its full part list if:

  • RGW dies between the two steps;
  • the delete fails, which is only logged, in the delete loop of RGWCompleteMultipart::execute;
  • or the completion lock lapses after the head write, when its renewal fails, and another request takes it before the delete.

Whatever touches the upload next then destroys the completed object:

  • an AbortMultipartUpload, or lifecycle's abort once the rule's age passes, sends the object's parts to GC;
  • a retried CompleteMultipartUpload lists the same parts and writes the head again, and complete_atomic_modification sends the replaced head's manifest, the same parts, to GC. check_previously_completed runs only when the meta object is gone.

A copy of the object taken in between only delays the loss. The symptom is as in #75375: once GC has run, GET returns NoSuchKey while the head and its manifest are intact. The fix for #75375 checks the lock before the head write; this is the window after it.

Reproducers: s3-tests test_multipart_complete_retry_after_meta_delete_error and test_multipart_abort_after_meta_delete_error s3-tests commit, with rgw_debug_inject_mp_meta_delete_err = 5 (a debug option in injection points that makes the delete return -EIO), rgw_gc_obj_min_wait = 10 and rgw_gc_processor_period = 10, with the same keys under [s3 main]. Both fail on main. The crash and lock-lapse paths are found by the model (tcCrashThenRetry, tcCrashThenAbort, tcAssumeLockHeld) and not scripted on a cluster yet.

Fix: a completion needs a durable record that it took effect, which a later abort or completion of the upload checks before acting on the part list. Keeping GC away from the parts the current head references is not enough: the model shows a retry after an intervening overwrite still writes a head over deleted parts (tcSparesHeadCrashPutRetry).

KB Updated by Kyle Bader 2 months ago Actions #1

  • Pull request ID set to 72103

MH Updated by Matthew Heler 2 months ago Actions #2

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

Also available in: PDF Atom