New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rgw: fix error code of inexistence of versions location in swift api #13350
Conversation
all commits in this PR are signed |
Build finished. |
jekins test this please |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to be more selective when it comes to overwriting errors.
src/rgw/rgw_rados.cc
Outdated
@@ -6129,7 +6129,7 @@ int RGWRados::swift_versioning_copy(RGWObjectCtx& obj_ctx, | |||
r = get_bucket_info(obj_ctx, bucket_info.bucket.tenant, bucket_info.swift_ver_location, dest_bucket_info, NULL, NULL); | |||
if (r < 0) { | |||
ldout(cct, 10) << "failed to read dest bucket info: r=" << r << dendl; | |||
return r; | |||
return -ERR_PRECONDITION_FAILED; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should be more selective here. This translates to overwriting only those errors we expect like ENOENT
.
when the versions location of container does not exist and uploading the same object two more times to the container, it will return 412 rather than 404 in openstack swift. Meanwhile, if the dest bucket owner is not consistent with src bucket owner, it will return 412. http://tracker.ceph.com/issues/18880 Signed-off-by: Jing Wenjun <jingwenjun@cmss.chinamobile.com>
e3c7f1b
to
e94e267
Compare
@rzarzynski thanks for the suggestion! i aslo found that if the dest bucket owner is not consistent with the owner of src bucket will return 412. so i fixed it in this commit. please check it. thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Also Tempest is fine with the change. Thanks, @Jing-Scott !
when the versions location of container does not exist and uploading the same object two more times to the container, it will return 412 rather than 404 in openstack swift.
http://tracker.ceph.com/issues/18880
Signed-off-by: Jing Wenjun jingwenjun@cmss.chinamobile.com