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: v13.2.5~2^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=15517ce2f601c58d976cb62ee250c8001f03fe11;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 (cherry picked from commit cb0da45c5d6e4dff6514919b3b894df0eea7c1e4) Conflicts: src/rgw/rgw_rados.cc conflicts with placement set and rgw rados refactor --- diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 0f6692bf365..02a47660c3f 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -6094,11 +6094,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 */ } @@ -8744,12 +8743,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; }