Repository navigation
rgw: fix data corruption caused by repeated uploadPart requests when race condition - #55042
thenamehasbeentake wants to merge 1 commit into
Conversation
…race condition We should delete the object in the "shadow" namespace first and then in the "multipart" namespace to avoid race condition referenced from ceph#11749 Fixes: https://tracker.ceph.com/issues/63642 Signed-off-by: xiaobaowen <[email protected]>
| for (const auto& obj : written) { | ||
| if (raw_head && obj == *raw_head) { | ||
| ldpp_dout(dpp, 5) << "NOTE: we should not process the head object (" << obj << ") here" << dendl; | ||
| for (auto obj = written.rbegin(); obj != written.rend(); obj++) { | ||
| if (raw_head && *obj == *raw_head) { | ||
| ldpp_dout(dpp, 5) << "NOTE: we should not process the head object (" << *obj << ") here" << dendl; |
There was a problem hiding this comment.
thanks @thenamehasbeentake
i'm having trouble understanding why this needs to loop in reverse. for multipart uploads, it's the raw_head object that we want delete last. we already skip that object in the loop and handle it below
There was a problem hiding this comment.
ok, i think i understand this now
for multipart uploads, raw_head points at the final multipart object name rather than the current part's head object, so this logic doesn't guarantee that the part head object gets deleted last
i uploaded a multipart object testbucket/128m.iso with some extra debug logging, and the part uploads show:
req 14841384554456452370 0.075002573s s3:put_obj raw_head default.rgw.buckets.data:1cf80de1-4e97-4a8f-89d2-747f9b8c432f.4143.1_128m.iso
i pushed a fix in #55582 and there i see the correct part head:
req 17160862790303507845 0.070002414s s3:put_obj raw_head default.rgw.buckets.data:8ec2917b-cefa-45a9-b342-3d285fc73685.4143.1__multipart_128m.iso.2~6HwU84cYMDBfu7p-hOWb4ReeAhCMHRz.2
because of this bug, reversing the order of deletion does help 👍 but i'd rather fix that head_obj detection to stay consistent with the comment history just above
mkogan1
left a comment
There was a problem hiding this comment.
in my testing of cherry-picking this PR commit over main prevents the reproduction of the issue as outlined in https://tracker.ceph.com/issues/63642#note-2 --> https://github.com/thenamehasbeentake/s3_multipart_example reproducer
|
Thank you, @thenamehasbeentake . The reproducer in the tracker and this PR really helped us zero in on the ultimate problem and was instrumental in creating and testing the alternate PR. This is great work! |
|
@thenamehasbeentake thanks for the contribution! |
Thank you for fixing the issue! |
rgw: fix data corruption caused by repeated uploadPart requests when race condition
We should delete the object in the "shadow" namespace first and then in the "multipart" namespace at the end to avoid race condition referenced from #11749
The bug was once fixed here and reintroduced now
Fixes: https://tracker.ceph.com/issues/63642
Checklist
Show available Jenkins commands
jenkins retest this pleasejenkins test classic perfjenkins test crimson perfjenkins test signedjenkins test make checkjenkins test make check arm64jenkins test submodulesjenkins test dashboardjenkins test dashboard cephadmjenkins test apijenkins test docsjenkins render docsjenkins test ceph-volume alljenkins test ceph-volume toxjenkins test windowsjenkins test rook e2e