diff options
author | liangmingyuan <liangmingyuan@baidu.com> | 2024-03-22 02:14:35 +0100 |
---|---|---|
committer | liangmingyuan <liangmingyuan@baidu.com> | 2024-07-22 03:19:25 +0200 |
commit | 8f68b3fdaec504ab476b6391062ce5c15747fdf8 (patch) | |
tree | fe6ed6d28f7ca5e7fe55d8bbbf9e07b80f6862bd /src/cls | |
parent | rgw/reshard: Backward Compatibility (diff) | |
download | ceph-8f68b3fdaec504ab476b6391062ce5c15747fdf8.tar.xz ceph-8f68b3fdaec504ab476b6391062ce5c15747fdf8.zip |
reshard: small fix and cleanup
At the end of each stage, finish() will be called once to guarantee
all entries can be flushed to dst shards. This may costs long time
if the counts of dst shards is vast, especially in second stage,
so renew reshard_lock is needed.
Signed-off-by: Mingyuan Liang <liangmingyuan@baidu.com>
Diffstat (limited to 'src/cls')
-rw-r--r-- | src/cls/rgw/cls_rgw.cc | 1 | ||||
-rw-r--r-- | src/cls/rgw/cls_rgw_client.cc | 7 | ||||
-rw-r--r-- | src/cls/rgw/cls_rgw_client.h | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/src/cls/rgw/cls_rgw.cc b/src/cls/rgw/cls_rgw.cc index af520b6bb0e..8f0190d4218 100644 --- a/src/cls/rgw/cls_rgw.cc +++ b/src/cls/rgw/cls_rgw.cc @@ -2914,7 +2914,6 @@ static int rgw_bi_put_op(cls_method_context_t hctx, bufferlist *in, bufferlist * } rgw_cls_bi_entry& entry = op.entry; - if (entry.type == BIIndexType::ReshardDeleted) { int r = cls_cxx_map_remove_key(hctx, entry.idx); if (r < 0) { diff --git a/src/cls/rgw/cls_rgw_client.cc b/src/cls/rgw/cls_rgw_client.cc index a9b1a5bdb1c..c5ac99eada0 100644 --- a/src/cls/rgw/cls_rgw_client.cc +++ b/src/cls/rgw/cls_rgw_client.cc @@ -471,12 +471,12 @@ int cls_rgw_bi_get(librados::IoCtx& io_ctx, const string oid, } int cls_rgw_bi_get_vals(librados::IoCtx& io_ctx, const std::string oid, - std::set<std::string> log_entries_wanted, + std::set<std::string>& log_entries_wanted, std::list<rgw_cls_bi_entry> *entries) { bufferlist in, out; struct rgw_cls_bi_get_vals_op call; - call.log_entries_wanted = log_entries_wanted; + call.log_entries_wanted = std::move(log_entries_wanted); encode(call, in); int r = io_ctx.exec(oid, RGW_CLASS, RGW_BI_GET_VALS, in, out); if (r < 0) @@ -490,7 +490,8 @@ int cls_rgw_bi_get_vals(librados::IoCtx& io_ctx, const std::string oid, return -EIO; } - entries->swap(op_ret.entries); + if (entries) + entries->swap(op_ret.entries); return 0; } diff --git a/src/cls/rgw/cls_rgw_client.h b/src/cls/rgw/cls_rgw_client.h index c5336030c07..86c40dc9278 100644 --- a/src/cls/rgw/cls_rgw_client.h +++ b/src/cls/rgw/cls_rgw_client.h @@ -384,7 +384,7 @@ int cls_rgw_bi_get(librados::IoCtx& io_ctx, const std::string oid, BIIndexType index_type, const cls_rgw_obj_key& key, rgw_cls_bi_entry *entry); int cls_rgw_bi_get_vals(librados::IoCtx& io_ctx, const std::string oid, - std::set<std::string> log_entries_wanted, + std::set<std::string>& log_entries_wanted, std::list<rgw_cls_bi_entry> *entries); int cls_rgw_bi_put(librados::IoCtx& io_ctx, const std::string oid, const rgw_cls_bi_entry& entry); void cls_rgw_bi_put(librados::ObjectWriteOperation& op, const std::string oid, const rgw_cls_bi_entry& entry); |