diff options
author | Yehuda Sadeh <yehuda@redhat.com> | 2014-12-20 00:29:27 +0100 |
---|---|---|
committer | Yehuda Sadeh <yehuda@redhat.com> | 2015-01-20 00:57:58 +0100 |
commit | b664903f930b4adeecd9fbd89926519648837f3a (patch) | |
tree | 2a24b7cc65489d62aac0863071dac8886d2a4b4b /src/cls/rgw/cls_rgw_client.cc | |
parent | rgw: dump versioned epoch on system user bucket listing (diff) | |
download | ceph-b664903f930b4adeecd9fbd89926519648837f3a.tar.xz ceph-b664903f930b4adeecd9fbd89926519648837f3a.zip |
rgw, cls_rgw: clean up olh artifacts when dropping last version
This is still missing one piece, however, it works like this:
1. bucket index log reflects last version was removed (already did that)
2. olh entry is marked as 'pending removal'
- any new versions coming in now to the olh entry will clear pending
state
3. rgw conditionally removes olh object (still missing condition check)
- condition checks should verify olh tag & version, and no pending
modifications
4. if (2) is successful, rgw sends 'clear olh' request to bucket index
5. bucket index, if still 'pending removal' clears olh and plain entry
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
Diffstat (limited to 'src/cls/rgw/cls_rgw_client.cc')
-rw-r--r-- | src/cls/rgw/cls_rgw_client.cc | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/cls/rgw/cls_rgw_client.cc b/src/cls/rgw/cls_rgw_client.cc index e78d77a192b..ab8b9a2981e 100644 --- a/src/cls/rgw/cls_rgw_client.cc +++ b/src/cls/rgw/cls_rgw_client.cc @@ -258,6 +258,23 @@ void cls_rgw_trim_olh_log(librados::ObjectWriteOperation& op, string& oid, const op.exec("rgw", "bucket_trim_olh_log", in); } +int cls_rgw_clear_olh(IoCtx& io_ctx, string& oid, const cls_rgw_obj_key& olh, const string& olh_tag) +{ + bufferlist in, out; + struct rgw_cls_bucket_clear_olh_op call; + call.key = olh; + call.olh_tag = olh_tag; + ::encode(call, in); + librados::ObjectWriteOperation op; + int op_ret; + op.exec("rgw", "bucket_clear_olh", in, &out, &op_ret); + int r = io_ctx.operate(oid, &op); + if (r < 0) { + return r; + } + return op_ret; +} + int cls_rgw_bucket_check_index_op(IoCtx& io_ctx, string& oid, rgw_bucket_dir_header *existing_header, rgw_bucket_dir_header *calculated_header) |