Skip to content
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

Merged
merged 1 commit into from Feb 16, 2017

Conversation

Jing-Scott
Copy link
Contributor

@Jing-Scott Jing-Scott commented Feb 10, 2017

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

@ceph-jenkins
Copy link
Collaborator

all commits in this PR are signed

@ceph-jenkins
Copy link
Collaborator

Build finished.

@Jing-Scott
Copy link
Contributor Author

jekins test this please

@rzarzynski rzarzynski self-assigned this Feb 13, 2017
Copy link
Contributor

@rzarzynski rzarzynski left a 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.

@@ -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;
Copy link
Contributor

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>
@Jing-Scott
Copy link
Contributor Author

@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!

Copy link
Contributor

@rzarzynski rzarzynski left a 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 !

@rzarzynski rzarzynski merged commit a785b00 into ceph:master Feb 16, 2017
@Jing-Scott Jing-Scott deleted the fix-swift-ver-error-code branch February 17, 2017 00:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants