]> git.apps.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)
committerAbhishek Lekshmanan <abhishek@suse.com>
Wed, 6 Mar 2019 15:54:50 +0000 (16:54 +0100)
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>
(cherry picked from commit cb0da45c5d6e4dff6514919b3b894df0eea7c1e4)

 Conflicts:
src/rgw/rgw_rados.cc
conflicts with placement set and rgw rados refactor

src/rgw/rgw_rados.cc

index 0f6692bf3659066839fb7e6741e4239d4ca94e62..02a47660c3f52acca99771cddba5e326d1fe8f71 100644 (file)
@@ -6094,11 +6094,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 */
     }
@@ -8744,12 +8743,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;
 }