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 X-Object-Meta-Static-Large-Object in SLO download #15045

Merged
merged 1 commit into from May 19, 2017

Conversation

Projects
None yet
3 participants
@shashalu
Contributor

shashalu commented May 11, 2017

when download SLO objects, the response header "X-Object-Meta-Static-Large-Object" doesn't decode. Expect value is "True", but there is four bytes gibberish before it.

Fixes: http://tracker.ceph.com/issues/19951

Signed-off-by: Shasha Lu lu.shasha@eisoo.com

@shashalu

This comment has been minimized.

Contributor

shashalu commented May 16, 2017

@cbodley Hi, casey. Could you review this for me? Thanks

@cbodley

This comment has been minimized.

Contributor

cbodley commented May 16, 2017

thanks @shashalu, it looks like those 4 extra bytes are a length prefix from calling ::encode("True", slo_userindicator_bl) in RGWPutObj::execute(). other attributes use bufferlist::append() instead. i wish we could fix this on encode, but dump_object_metadata() would still need a special case to see whether or not it was encoded with a length prefix

for dump_object_metadata(), i think we can avoid trying to ::decode() by relying on the fact that if this RGW_ATTR_SLO_UINDICATOR is present, it's value will always be True. how does this look?

     if (aiter != std::end(rgw_to_http_attrs)) {
       response_attrs[aiter->second] = kv.second.c_str();
+    } else if (strcmp(name, RGW_ATTR_SLO_UINDICATOR) == 0) {
+      // this attr has an extra length prefix from ::encode()
+      dump_header(s, "X-Object-Meta-Static-Large-Object", "True");
     } else if (strncmp(name, RGW_ATTR_META_PREFIX,
                        sizeof(RGW_ATTR_META_PREFIX)-1) == 0) {
       name += sizeof(RGW_ATTR_META_PREFIX) - 1;
       dump_header_prefixed(s, "X-Object-Meta-",
                            camelcase_dash_http_attr(name), kv.second);
     }

edit: and with this change in place, we could also fix the encode without breaking anything

@cbodley

This comment has been minimized.

Contributor

cbodley commented May 16, 2017

p.s. could you please open a tracker ticket for this so we can get it backported?

rgw: fix X-Object-Meta-Static-Large-Object in SLO download
when download SLO objects, the response header "X-Object-Meta-Static-Large-Object" doesn't decode. Expect value is "True", but there is four bytes gibberish before it.

Fixes: http://tracker.ceph.com/issues/19951

Signed-off-by: Shasha Lu <lu.shasha@eisoo.com>
@shashalu

This comment has been minimized.

Contributor

shashalu commented May 17, 2017

@cbodley oh, it's a good idea. S3 download should fix this too.

@cbodley

This comment has been minimized.

@cbodley cbodley merged commit f030041 into ceph:master May 19, 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

@shashalu shashalu deleted the shashalu:fix-slo branch May 22, 2017

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