Repository navigation
rgw: fix multipart upload object leaks due to re-upload - #49709
Conversation
|
|
||
| r = meta_obj->omap_set_val_by_key(dpp, p, bl, true, null_yield); | ||
| rgw_raw_obj meta_raw_obj; | ||
| dynamic_cast<rgw::sal::RadosObject*>(meta_obj.get())->get_raw_obj(&meta_raw_obj); |
There was a problem hiding this comment.
this line doesn't make sense? 1) seems you want to assign the downcast pointer to a variable? this must warn? also, 2) using dynamic_cast implies that the downcast can fail, if the returned object pointer is of a different descendant type--in that case, the returned pointer will be null, so we don't want to operate on it
There was a problem hiding this comment.
No. The sole purpose is to make the call to get_raw_obj(). Without it, it can only call get_obj(). I learned it from RadosBucket::remove_bucket_bypass_gc().
There was a problem hiding this comment.
oh, I see. however, I think the dynamic cast is still an issue (maybe in both places, I don't know)
There was a problem hiding this comment.
However, a lingering concern is that MultipartObjectProcessor::complete() seems to try to be generic and not Rados specific. However, the first few lines of this function already directly refer to RGWRados. I suspect that it isn't as generic as hoped.
There was a problem hiding this comment.
I think there should at least be error checking from the dynamic_cast
There was a problem hiding this comment.
clearly, I agree with you, but it will be fully generic in due course
There was a problem hiding this comment.
you could leave a comment here or at the other location, maybe, to highlight the issue
There was a problem hiding this comment.
Instead of using dynamic_cast, I changed to call obj_to_raw() in the 2nd commit. The whole purpose is to access more information from the raw obj.
|
@dang what is your take on these rados dependencies in MPU? they can't be blockers for this change, I guess, but we should put them on the list of zipper issues |
|
@cbodley I've tested this change by hand--it seems like the way to automate this would be in ragweed, maybe? My test method was to upload a 5m file containing generated data, with part 1 re-uploaded 45 times, print results from 83e305a9-1e5f-43e5-921a-9111868330ba.4147.2__multipart_mpu_test3.byhsQ9xQIEvIcBfq08kxo3c7vccebYV8.1 |
mattbenjamin
left a comment
There was a problem hiding this comment.
Have tested using my own re-upload test case, seems to work as expected and I noticed nothing out of the ordinary.
@mattbenjamin You may want to test abort as well. If the re-uploads have occurred, aborting the whole upload should leave no orphans, either. |
rgw_putobj_processor.cc is below the line, so it's part of RadosStore, and the casts will always succeed. |
oh, ok--I didnt realize |
yima77
left a comment
There was a problem hiding this comment.
I think I have addressed all requested changes.
yima77
left a comment
There was a problem hiding this comment.
I hope it is now good to merge. :)
|
what's the plan for test coverage?
|
Existing s3tests functional tests pass/fail results are the same with and without this change. I ran s3tests.functional.test_s3 and there are two failures:
Both tests also failed without this change. I have created new test cases in s3tests repo that is maintained internally at linode.com to test this particular change. I also made it to check rados objects but I had to change vstart.sh to speed up gc in order to make the new test pass. |
can you please contribute these tests in a pull request to the s3tests repo? we'd like to include them in our testing |
Yes, would definitely like an s3-tests PR here. Matt |
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
i found some existing coverage in
this isn't a requirement for merge. i'd just like to come up with a plan that someone can work on for reef it'd probably be easiest to add a python script under qa/workunits/rgw. there's a test_rgw_reshard.py (and run-reshard.sh wrapper) that could serve as an example |
@cbodley @mattbenjamin to clarify, verifying the bug requires either RGW Admin Ops API access (to check bucket size accounting) and/or direct RADOS access (to look for orphaned objects); there's no way to do this via S3 API. Is this still something we'd want added to an S3 API compatibility test suite? I assume not. It's true yima77 added a test case to S3, but this was accomplished with an |
@jahschwa agreed 100%. the s3tests suite should work against any s3-compatible service Matt had mentioned our https://github.com/ceph/ragweed/ test suite above, which does 'import rados' and make calls to radosgw /admin APIs. but it's kinda specific to upgrade scenarios, and hasn't been used as a general test suite. it doesn't look like it currently shells out to rados or radosgw-admin commands, either we've added some other one-off test cases under ceph/qa/workunits/rgw/, where we can run arbitrary shell/python scripts, including rados/radosgw-admin commands |
ok, sounds good |
|
thanks @yima77, i'll follow up here with test results |
|
i'm still eager to test this, but i've been unable to get any jobs through teuthology this week. the sepia team is still working through network issues in the lab |
|
teuthology jobs seem to be running again, so i've rescheduled the tests in https://pulpito.ceph.com/cbodley-2023-02-09_16:05:16-rgw-main-distro-default-smithi/ there's a known ragweed failure in the rgw suite, tracked in https://tracker.ceph.com/issues/58643, so i'm using https://github.com/cbodley/ceph/commits/wip-qa-rgw-without-ragweed as a suite-branch to disable those tests for now |
|
still no luck getting any tests to run in teuthology |
|
finally some test results! https://pulpito.ceph.com/cbodley-2023-02-16_14:01:19-rgw-wip-cbodley-testing-distro-default-smithi/ this shows some new s3test failures under rgw/dbstore, rgw/lifecycle, and rgw/crypt. but the same failures show up against other branches like https://pulpito.ceph.com/yuvalif-2023-02-12_19:47:07-rgw-wip-yuval-fix-58167-distro-default-smithi/ so i'm happy to approve this for merge 👍 |
|
thanks @mattbenjamin and @yima77! the question now is whether we can backport this - obviously our users want the fix, but we also try to avoid cls format changes across minor versions. i feel like backports here would need some additional testing outside of the existing rgw and upgrade suites |
|
reef certainly, we should look at at least quincy? |
|
Internally, we patched v17.2.5 for this issue from this commit: yima77@ad260da It doesn't go through cls route and uses sync update on the past prefix list. |
|
I would make a very strong argument that a bug resulting in dark data/inconsistency between operations and resultant data on disk requires back-porting of the fix to any stable release that isn't EOLd for support/updates. |
|
thanks @ormandj. above we discussed strategies for automated test coverage, but it's not clear who's working this. this also hasn't been through any upgrade suites yet; that will happen as part of reef's validation, but it won't test all the combinations of mismatched osd/rgw versions. cls changes like this have been a major source of bugs in the past, so i'd really like to have more test coverage to help mitigate the risk of backports |
ragweed has several existing test cases for multipart uploads, but none for part reupload. it would nice to add at least one test case for this, so we can build real upgrade tests for the mismatched osd/rgw versions
during upgrades, we can't guarantee that we won't orphan any data (cls and rgw both need to coordinate that), so i don't think ragweed should do the scanning for orphans. a workunit is probably the best place for that |
|
i've opened two issues against the rgw-testing project (https://tracker.ceph.com/issues/58780 https://tracker.ceph.com/issues/58782) to track this, and we'll find someone to work on them |
The backport tickets was created by bot, maybe @yima77 can backport this fixes, if this safe. Anyway this is more-less standard workflow for Ceph |
|
i've added a discussion topic for tomorrow's weekly rgw meeting to https://pad.ceph.com/p/rgw-weekly about how to build the test coverage necessary to validate this PR and its backports. cc @ivancich who volunteered for https://tracker.ceph.com/issues/58780 |
|
For now, I used this script to remove this objects. thanks for fixing |
|
this and #50667 are now eligible for backports. who should be assigned to https://tracker.ceph.com/issues/59567 for quincy? |
This commit fixes the object leaks when an mp part object is re-uploaded. Details of the fix are:
assembly, thus preventing the object leak.
Fixes: https://tracker.ceph.com/issues/16767
Signed-off-by: Yixin Jin [email protected]
Contribution Guidelines
To sign and title your commits, please refer to Submitting Patches to Ceph.
If you are submitting a fix for a stable branch (e.g. "pacific"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
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 windows