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: can't download object with range when compression enabled #20226
Conversation
@aclamk @cbodley please have a look, thanks. out_bl may be empty if break from:
And q_len may be 0 if bytes were all sent in:
|
src/rgw/rgw_compression.cc
Outdated
if (out_bl.length() && q_len) { | ||
//first slice or last slice with bytes < cct->_conf->rgw_max_chunk_size | ||
off_t ch_len = std::min<off_t>(out_bl.length() - q_ofs, q_len); | ||
r = next->handle_data(out_bl, q_ofs, ch_len); |
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.
@fangyuxiangGL As I understand, the problem is when we try to next->handle_data on 0 sized data. Maybe check ch_len>0 will be more natural?
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.
@aclamk
yeah, root cause is that no bytes need to be handled, so ch_len > 0 may be more comprehensive and concise. But I just think out_bl.length() && q_len
is more intuitive, even more relevant to codes above.
Fixes: http://tracker.ceph.com/issues/22852 Signed-off-by: fang yuxiang <fang.yuxiang@eisoo.com>
thanks @fangyuxiangGL, looks good. could you please look into s3test coverage for this? i do see a lot of Range headers in our tests, so i'm surprised we haven't hit this yet (the teuthology suite runs with compression=random) |
@fangyuxiangGL that sounds great. if you can add range requests that cover both the default 4MB and your 512k case, all the better 👍 |
@cbodley
I think we should add such a case:
But, I am also worried that even such a case might not expose the issue, because head object size is 512KB in our private codes and is different from the master(has a 4MB size head object), but I think we also have great probability to expose the issue. |
@cbodley |
test case at ceph/s3-tests#209 can merge once this does |
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.
Look good.
This is an omission in ceph#20226 Signed-off-by: fang yuxiang <fang.yuxiang@eisoo.com>
This is an omission in ceph#20226 Fixes: http://tracker.ceph.com/issues/23146 Signed-off-by: fang yuxiang <fang.yuxiang@eisoo.com>
This is an omission in ceph#20226 Fixes: http://tracker.ceph.com/issues/23146 Signed-off-by: fang yuxiang <fang.yuxiang@eisoo.com>
This is an omission in ceph#20226 Fixes: http://tracker.ceph.com/issues/23146 Signed-off-by: fang yuxiang <fang.yuxiang@eisoo.com> (cherry picked from commit f5d2a66)
This is an omission in ceph#20226 Fixes: http://tracker.ceph.com/issues/23146 Signed-off-by: fang yuxiang <fang.yuxiang@eisoo.com> (cherry picked from commit f5d2a66)
Fixes: http://tracker.ceph.com/issues/22852
Signed-off-by: fang yuxiang fang.yuxiang@eisoo.com