From 15517ce2f601c58d976cb62ee250c8001f03fe11 Mon Sep 17 00:00:00 2001 From: "J. Eric Ivancich" Date: Tue, 20 Nov 2018 13:32:54 -0500 Subject: [PATCH] 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 --- src/rgw/rgw_rados.cc | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 0f6692bf36590..02a47660c3f52 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; } -- 2.39.5