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

osd,librados: add manifest, operations for chunked object #15482

Merged
merged 9 commits into from Nov 30, 2017
9 changes: 9 additions & 0 deletions qa/suites/rados/thrash/workloads/set-chunks.yaml
@@ -0,0 +1,9 @@
tasks:
- rados:
clients: [client.0]
ops: 4000
objects: 300
set_chunk: true
op_weights:
chunk_read: 100
write: 30
2 changes: 2 additions & 0 deletions qa/tasks/rados.py
Expand Up @@ -145,6 +145,8 @@ def task(ctx, config):
args.extend(['--write-fadvise-dontneed'])
if config.get('set_redirect', False):
args.extend(['--set_redirect'])
if config.get('set_chunk', False):
args.extend(['--set_chunk'])
if config.get('pool_snaps', False):
args.extend(['--pool-snaps'])
args.extend([
Expand Down
1 change: 1 addition & 0 deletions src/include/rados.h
Expand Up @@ -310,6 +310,7 @@ extern int ceph_release_from_features(uint64_t features);
\
/* Extensible */ \
f(SET_REDIRECT, __CEPH_OSD_OP(WR, DATA, 39), "set-redirect") \
f(SET_CHUNK, __CEPH_OSD_OP(WR, DATA, 40), "set-chunk") \
\
/** attrs **/ \
/* read */ \
Expand Down
3 changes: 3 additions & 0 deletions src/include/rados/librados.hpp
Expand Up @@ -471,6 +471,9 @@ namespace librados
*/
void set_redirect(const std::string& tgt_obj, const IoCtx& tgt_ioctx,
uint64_t tgt_version);
void set_chunk(uint64_t src_offset, uint64_t src_length, const IoCtx& tgt_ioctx,
std::string tgt_oid, uint64_t tgt_offset);


friend class IoCtx;
};
Expand Down
11 changes: 11 additions & 0 deletions src/librados/librados.cc
Expand Up @@ -614,6 +614,17 @@ void librados::ObjectWriteOperation::set_redirect(const std::string& tgt_obj,
tgt_ioctx.io_ctx_impl->oloc, tgt_version);
}

void librados::ObjectWriteOperation::set_chunk(uint64_t src_offset,
uint64_t src_length,
const IoCtx& tgt_ioctx,
string tgt_oid,
uint64_t tgt_offset)
{
::ObjectOperation *o = &impl->o;
o->set_chunk(src_offset, src_length,
tgt_ioctx.io_ctx_impl->oloc, object_t(tgt_oid), tgt_offset);
}

void librados::ObjectWriteOperation::tmap_put(const bufferlist &bl)
{
::ObjectOperation *o = &impl->o;
Expand Down