Project

General

Profile

Actions

Bug #73348

closed
YE CB

Data corruption when using server-side copy and bypass-gc.

Bug #73348: Data corruption when using server-side copy and bypass-gc.

Added by Youssef El Badaoui about 1 year ago. Updated about 1 month ago.

Status:
Resolved
Priority:
High
Assignee:
Target version:
-
Due date:
% Done:

0%

Source:
Backport:
reef squid tentacle
Regression:
No
Severity:
2 - major
Reviewed:
ceph-qa-suite:
Pull request ID:
Tags (freeform):
dataloss
Fixed In:
v20.3.0-3714-g3e25d8c3d7
Released In:
v21.2.0~1817
Upkeep Timestamp:
2026-10-24T02:04:14+00:00

Description

We observed a bug in Ceph where we corrupted around 60k objects in S3. The objects are still getting listed by S3 clients (the metadata seems to be fine) but when you try download the object you get a NoSuchKey error or the download starts but never finishes (missing parts).

After some research we were able to reproduce it (in v17.2.6, v17.2.8 and v19.2.2).

Steps to reproduce it:
  1. Create 2 buckets with the same credential
  2. Upload a file thats greater than 4MB to the first bucket (I used a 10MB file). This makes sure we get a shadow object in Rados. (I have not tested with multipart uploads)
  3. Use rclone to server-side copy the file to the second bucket:
    rclone copyto -v ceph-remote:test-corruption-source-bucket/myfile_small ceph-remote:test-corruption-destination--bucket/myfile_small
    
  4. When you inspect the rados location of the file in the destination bucket you will see that it refers to the same location on rados as the file in the source bucket.
    sudo radosgw-admin object stat --bucket test-corruption-source-bucket --object myfile_small
    sudo radosgw-admin object stat --bucket test-corruption-destination-bucket --object myfile_small
    
  5. Delete the destination bucket but use flag bypass-gc
    sudo radosgw-admin bucket rm --bucket=test-corruption-destination-bucket --purge-objects --bypass-gc
    
  6. Source file gets corrupted because bypass-gc does not check if the files are still referenced somewhere else.

I tested a normal delete and this does not corrupt the source. I also tested without the bypass-gc flag, this also does not corrupt source. In both cases I could see the shadow objects being scheduled for GC:

sudo radosgw-admin gc list --include-all

But once GC has run, the list is empty and the source file is still intact. So it looks like GC does check the reference in other indexes and the bug only happens if GC is being bypassed.

If you need more information please let me know.


Related issues 4 (0 open — 4 closed)

Related to rgw - Bug #73138: Ceph bucket object corruptionCan't reproduce

Actions
Copied to rgw - Backport #73596: tentacle: Data corruption when using server-side copy and bypass-gc.ResolvedCasey Bodley

Actions
Copied to rgw - Backport #73597: reef: Data corruption when using server-side copy and bypass-gc.ResolvedCasey Bodley

Actions
Copied to rgw - Backport #73598: squid: Data corruption when using server-side copy and bypass-gc.ResolvedCasey Bodley

Actions

CB Updated by Casey Bodley about 1 year ago Actions #1

tracing through the code for --bypass-gc:

RadosBucket::remove_bypass_gc() -> RGWRados::delete_raw_obj_aio() -> cls_rgw_remove_obj()

cls_rgw_remove_obj() is for head objects, not tail objects. we should be calling cls_refcount_put() instead

CB Updated by Casey Bodley about 1 year ago Actions #2

  • Status changed from New to Fix Under Review
  • Assignee set to Casey Bodley
  • Backport set to squid tentacle
  • Pull request ID set to 65772

CB Updated by Casey Bodley about 1 year ago Actions #3

  • Priority changed from Normal to High
  • Backport changed from squid tentacle to reef squid tentacle

JI Updated by J. Eric Ivancich about 1 year ago Actions #4

  • Related to Bug #73138: Ceph bucket object corruption added

CB Updated by Casey Bodley about 1 year ago Actions #5

  • Status changed from Fix Under Review to Pending Backport

UB Updated by Upkeep Bot about 1 year ago Actions #6

  • Merge Commit set to 3e25d8c3d703b138034d1ffa45cf10f9085c2964
  • Fixed In set to v20.3.0-3714-g3e25d8c3d7
  • Upkeep Timestamp set to 2025-10-21T13:04:02+00:00

UB Updated by Upkeep Bot about 1 year ago Actions #7

  • Copied to Backport #73596: tentacle: Data corruption when using server-side copy and bypass-gc. added

UB Updated by Upkeep Bot about 1 year ago Actions #8

  • Copied to Backport #73597: reef: Data corruption when using server-side copy and bypass-gc. added

UB Updated by Upkeep Bot about 1 year ago Actions #9

  • Copied to Backport #73598: squid: Data corruption when using server-side copy and bypass-gc. added

UB Updated by Upkeep Bot about 1 year ago Actions #10

  • Tags (freeform) set to backport_processed

JI Updated by J. Eric Ivancich 10 months ago Actions #11

  • Tags (freeform) changed from backport_processed to backport_processed dataloss

KS Updated by Konstantin Shalygin 10 months ago Actions #12

  • Status changed from Pending Backport to Resolved

UB Updated by Upkeep Bot 3 months ago Actions #13

  • Tags (freeform) changed from backport_processed dataloss to dataloss
  • Upkeep Timestamp changed from 2025-10-21T13:04:02+00:00 to 2026-08-28T01:51:15+00:00

UB Updated by Upkeep Bot about 1 month ago Actions #14

  • Released In set to v21.2.0~1817
  • Upkeep Timestamp changed from 2026-08-28T01:51:15+00:00 to 2026-10-24T02:04:14+00:00
Actions

Also available in: PDF Atom