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 disabling Swift's object versioning through empty X-Versions-Location #13303

Merged
merged 1 commit into from Feb 13, 2017

Conversation

Projects
None yet
3 participants
@Jing-Scott
Contributor

Jing-Scott commented Feb 8, 2017

we should be able to disable object verioning by removing its X-Versions-Location metadata header by sending an empty key value. this description can be found at No.8 in http://docs.openstack.org/user-guide/cli-swift-set-object-versions.html.

Fixes: http://tracker.ceph.com/issues/18852
Signed-off-by: Jing Wenjun jingwenjun@cmss.chinamobile.com

@Jing-Scott

This comment has been minimized.

Contributor

Jing-Scott commented Feb 8, 2017

@rzarzynski : could you help to take a look?
CC: @cbodley
Thanks a lot :)

@rzarzynski rzarzynski self-assigned this Feb 8, 2017

rgw: fix swift cannot disable object versioning
we should be able to disable object verioning by removing its X-Versions-Location
metadata header by sending an empty key value. this description can be found at
No.8 in http://docs.openstack.org/user-guide/cli-swift-set-object-versions.html.

Fixes: http://tracker.ceph.com/issues/18852
Signed-off-by: Jing Wenjun <jingwenjun@cmss.chinamobile.com>
@rzarzynski

Generally OK. One minor only.

/* If the Swift's versioning is globally disabled but someone wants to
* enable it for a given container, new version of Swift will generate
* the precondition failed error. */
if (! s->cct->_conf->rgw_swift_versioning_enabled) {
return -ERR_PRECONDITION_FAILED;
}
swift_ver_location = std::move(vloc);
swift_ver_location = std::move(s->info.env->get("HTTP_X_VERSIONS_LOCATION", ""));

This comment has been minimized.

@rzarzynski

rzarzynski Feb 13, 2017

Contributor

Hmm, I would say that std::move isn't necessary anymore. The method already returns a temporary.

This comment has been minimized.

@Jing-Scott

Jing-Scott Feb 13, 2017

Contributor

yup, you're right! I've updated it. Thanks!

@mattbenjamin

lgtm (+yehuda)

@mattbenjamin

This comment has been minimized.

Contributor

mattbenjamin commented Feb 13, 2017

@Jing-Scott the thing Yehuda noted was that this change consults the headers map twice, and it could be done once; we'll update after merging

@mattbenjamin mattbenjamin merged commit 24f43e9 into ceph:master Feb 13, 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

@rzarzynski rzarzynski changed the title from rgw: fix swift cannot disable object versioning to rgw: fix disabling Swift's object versioning through empty X-Versions-Location Mar 6, 2017

@rzarzynski

This comment has been minimized.

Contributor

rzarzynski commented Mar 6, 2017

Changed the pull request's name as it was confusing. We did support disabling the Swift's object versioning by sending X-Remove-Versions-Location from the very beginning. The fix implements the second way for doing that -- by supplying an empty X-Versions-Location header.

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