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

Projects
None yet
4 participants
@Jing-Scott
Contributor

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

This comment has been minimized.

Collaborator

ceph-jenkins commented Feb 10, 2017

all commits in this PR are signed

@ceph-jenkins

This comment has been minimized.

Collaborator

ceph-jenkins commented Feb 10, 2017

Build finished.

@Jing-Scott

This comment has been minimized.

Contributor

Jing-Scott commented Feb 12, 2017

jekins test this please

@rzarzynski rzarzynski self-assigned this Feb 13, 2017

@rzarzynski

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;

This comment has been minimized.

@rzarzynski

rzarzynski Feb 13, 2017

Contributor

I think we should be more selective here. This translates to overwriting only those errors we expect like ENOENT.

rgw: fix error code of inexistence of versions location in swift api
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

This comment has been minimized.

Contributor

Jing-Scott commented Feb 15, 2017

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

@rzarzynski

LGTM. Also Tempest is fine with the change. Thanks, @Jing-Scott !

@rzarzynski rzarzynski merged commit a785b00 into ceph:master Feb 16, 2017

3 checks passed

Signed-off-by all commits in this PR are signed
Details
Unmodifed Submodules submodules for project are unmodified
Details
default Build finished.
Details

@Jing-Scott Jing-Scott deleted the Jing-Scott:fix-swift-ver-error-code branch Feb 17, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment