{
librados::IoCtx index_ctx; // context for new bucket
- /* handle on going bucket resharding */
- BucketIndexLockGuard guard(cct, this, bucket_info.bucket.bucket_id, bucket_info.bucket.oid,
- reshard_pool_ctx);
-
- int r = reshard->block_while_resharding(bucket_info.bucket.oid, guard);
- if (r < 0) {
- return r;
- }
-
string dir_oid = dir_oid_prefix;
- r = open_bucket_index_ctx(bucket_info, index_ctx);
+ int r = open_bucket_index_ctx(bucket_info, index_ctx);
if (r < 0) {
return r;
}
map<int, string> oids;
map<int, struct rgw_cls_check_index_ret> bucket_objs_ret;
- /* handle on going bucket resharding */
- BucketIndexLockGuard guard(cct, this, bucket_info.bucket.bucket_id, bucket_info.bucket.oid,
- reshard_pool_ctx);
- int ret = reshard->block_while_resharding(bucket_info.bucket.oid, guard);
- if (ret < 0) {
- return ret;
- }
-
- ret = open_bucket_index(bucket_info, index_ctx, oids, bucket_objs_ret);
+ int ret = open_bucket_index(bucket_info, index_ctx, oids, bucket_objs_ret);
if (ret < 0) {
return ret;
}
librados::IoCtx index_ctx;
map<int, string> bucket_objs;
- /* handle on going bucket resharding */
- BucketIndexLockGuard guard(cct, this, bucket_info.bucket.bucket_id, bucket_info.bucket.oid,
- reshard_pool_ctx);
- int r = reshard->block_while_resharding(bucket_info.bucket.oid, guard);
- if (r < 0) {
- return r;
- }
-
- r = open_bucket_index(bucket_info, index_ctx, bucket_objs);
+ int r = open_bucket_index(bucket_info, index_ctx, bucket_objs);
if (r < 0) {
return r;
}
RGWRados *store = target->get_store();
BucketShard *bs;
- ret = get_bucket_shard(&bs);
+ int ret = get_bucket_shard(&bs);
if (ret < 0) {
ldout(store->ctx(), 5) << "failed to get BucketShard object: ret=" << ret << dendl;
return ret;
RGWRados *store = target->get_store();
BucketShard *bs;
- /* handle on going bucket resharding */
- BucketIndexLockGuard guard(store->ctx(), store, target->get_bucket().bucket_id, target->get_bucket().oid,
- store->reshard_pool_ctx);
- int ret = store->reshard->block_while_resharding(target->get_bucket().oid, guard);
- if (ret < 0) {
- return ret;
- }
-
- ret = get_bucket_shard(&bs);
+ int ret = get_bucket_shard(&bs);
if (ret < 0) {
ldout(store->ctx(), 5) << "failed to get BucketShard object: ret=" << ret << dendl;
return ret;
RGWRados *store = target->get_store();
BucketShard *bs;
- /* handle on going bucket resharding */
- BucketIndexLockGuard guard(store->ctx(), store, target->get_bucket().bucket_id, target->get_bucket().oid,
- store->reshard_pool_ctx);
- int ret = store->reshard->block_while_resharding(target->get_bucket().oid, guard);
- if (ret < 0) {
- return ret;
- }
-
- ret = get_bucket_shard(&bs);
+ int ret = get_bucket_shard(&bs);
if (ret < 0) {
ldout(store->ctx(), 5) << "failed to get BucketShard object: ret=" << ret << dendl;
return ret;
RGWRados *store = target->get_store();
BucketShard *bs;
- /* handle on going bucket resharding */
- BucketIndexLockGuard guard(store->ctx(), store, target->get_bucket().bucket_id, target->get_bucket().oid,
- store->reshard_pool_ctx);
- int ret = store->reshard->block_while_resharding(target->get_bucket().oid, guard);
- if (ret < 0) {
- return ret;
- }
-
- ret = get_bucket_shard(&bs);
+ int ret = get_bucket_shard(&bs);
if (ret < 0) {
ldout(store->ctx(), 5) << "failed to get BucketShard object: ret=" << ret << dendl;
return ret;
return r;
}
- /* handle on going bucket resharding */
- BucketIndexLockGuard guard(cct, this, bucket_info.bucket.bucket_id, bucket_info.bucket.oid,
- reshard_pool_ctx);
- r = reshard->block_while_resharding(bucket_info.bucket.oid, guard);
- if (r < 0) {
- return r;
- }
-
BucketShard bs(this);
r = bs.init(obj_instance.bucket, obj_instance);
if (r < 0) {
librados::IoCtx index_ctx;
map<int, string> bucket_objs;
- /* handle on going bucket resharding */
- BucketIndexLockGuard guard(cct, this, bucket_info.bucket.bucket_id, bucket_info.bucket.oid,
- reshard_pool_ctx);
- int r = reshard->block_while_resharding(bucket_info.bucket.oid, guard);
- if (r < 0) {
- return r;
- }
-
BucketIndexShardsManager start_marker_mgr;
BucketIndexShardsManager end_marker_mgr;
- r = open_bucket_index(bucket_info, index_ctx, bucket_objs, shard_id);
+ int r = open_bucket_index(bucket_info, index_ctx, bucket_objs, shard_id);
if (r < 0) {
return r;
}
ObjectWriteOperation o;
cls_rgw_obj_key key(obj.key.get_index_key_name(), obj.key.instance);
- cls_rgw_guard_resharding(o, -ERR_BUSY_RESHARDING);
+ cls_rgw_guard_bucket_resharding(o, -ERR_BUSY_RESHARDING);
cls_rgw_bucket_prepare_op(o, op, tag, key, obj.key.get_loc(), get_zone().log_data, bilog_flags, zones_trace);
return bs.index_ctx.operate(bs.bucket_obj, &o);
}
ver.pool = pool;
ver.epoch = epoch;
cls_rgw_obj_key key(ent.key.name, ent.key.instance);
- cls_rgw_guard_resharding(o, -ERR_BUSY_RESHARDING);
+ cls_rgw_guard_bucket_resharding(o, -ERR_BUSY_RESHARDING);
cls_rgw_bucket_complete_op(o, op, tag, ver, key, dir_meta, pro,
get_zone().log_data, bilog_flags, zones_trace);