]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: perf -- remove bucket shards asynchronously rather than synchronously
authorJ. Eric Ivancich <ivancich@redhat.com>
Tue, 20 Nov 2018 18:32:54 +0000 (13:32 -0500)
committerJ. Eric Ivancich <ivancich@redhat.com>
Tue, 20 Nov 2018 18:34:37 +0000 (13:34 -0500)
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 <ivancich@redhat.com>
src/rgw/rgw_rados.cc

index 2f81258d7171a1f1cd03bb584c4fb1d0a173baf8..3f74604d151ee66eb68e64b6f128977577a28714 100644 (file)
@@ -2909,11 +2909,10 @@ int RGWRados::create_bucket(RGWUserInfo& owner, rgw_bucket& bucket,
         if (r < 0)
           return r;
 
-        map<int, string>::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<int, string>::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;
 }