From: J. Eric Ivancich Date: Tue, 20 Nov 2018 18:32:54 +0000 (-0500) Subject: rgw: perf -- remove bucket shards asynchronously rather than synchronously X-Git-Tag: v14.1.0~701^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=cb0da45c5d6e4dff6514919b3b894df0eea7c1e4;p=ceph.git rgw: perf -- remove bucket shards asynchronously rather than synchronously We can now take advantage of the new asynchronous bucket shard removal code and where we used to remove each shard synchronously now remove them asynchronously. This would be a huge win when we have tens of thousands of shards. Signed-off-by: J. Eric Ivancich --- diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 2f81258d7171..3f74604d151e 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -2909,11 +2909,10 @@ int RGWRados::create_bucket(RGWUserInfo& owner, rgw_bucket& bucket, if (r < 0) return r; - map::const_iterator biter; - for (biter = bucket_objs.begin(); biter != bucket_objs.end(); ++biter) { - // Do best effort removal - index_ctx.remove(biter->second); - } + /* remove bucket index objects asynchronously by best effort */ + (void) CLSRGWIssueBucketIndexClean(index_ctx, + bucket_objs, + cct->_conf->rgw_bucket_index_max_aio)(); } /* ret == -ENOENT here */ } @@ -4969,12 +4968,13 @@ int RGWRados::delete_bucket(RGWBucketInfo& bucket_info, RGWObjVersionTracker& ob if (r < 0) { return r; } - /* remove bucket index objects*/ - map::const_iterator biter; - for (biter = bucket_objs.begin(); biter != bucket_objs.end(); ++biter) { - index_ctx.remove(biter->second); - } + + /* remove bucket index objects asynchronously by best effort */ + (void) CLSRGWIssueBucketIndexClean(index_ctx, + bucket_objs, + cct->_conf->rgw_bucket_index_max_aio)(); } + return 0; }