]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: cls_bucket_list_unordered lists a single shard 28350/head
authorCasey Bodley <cbodley@redhat.com>
Fri, 19 Apr 2019 22:38:47 +0000 (18:38 -0400)
committerNathan Cutler <ncutler@suse.com>
Fri, 31 May 2019 12:52:22 +0000 (14:52 +0200)
CLSRGWIssueBucketList sends the request to every shard, but this loop
intended to list only the current_shard

Fixes: http://tracker.ceph.com/issues/39393
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit d37d0339ff61a293f2f9fd6dff3fbd630efce2a0)

Conflicts:
src/rgw/rgw_rados.cc: remove unnessary "struct"s

src/rgw/rgw_rados.cc

index 4fcd15c1544e23b0f28ebfe14f04d86131955df5..21092268337645f99ec076f1cc0703a73dce264b 100644 (file)
@@ -13476,19 +13476,16 @@ int RGWRados::cls_bucket_list_unordered(RGWBucketInfo& bucket_info,
   while (count <= num_entries &&
         ((shard_id >= 0 && current_shard == uint32_t(shard_id)) ||
          current_shard < num_shards)) {
-    // key   - oid (for different shards if there is any)
-    // value - list result for the corresponding oid (shard), it is filled by
-    //         the AIO callback
-    map<int, struct rgw_cls_list_ret> list_results;
-    r = CLSRGWIssueBucketList(index_ctx, my_start, prefix, num_entries,
-                             list_versions, oids, list_results,
-                             cct->_conf->rgw_bucket_index_max_aio)();
+    const std::string& oid = oids[current_shard];
+    rgw_cls_list_ret result;
+
+    librados::ObjectReadOperation op;
+    cls_rgw_bucket_list_op(op, my_start, prefix, num_entries,
+                           list_versions, &result);
+    r = index_ctx.operate(oid, &op, nullptr);
     if (r < 0)
       return r;
 
-    const std::string& oid = oids[current_shard];
-    assert(list_results.find(current_shard) != list_results.end());
-    auto& result = list_results[current_shard];
     for (auto& entry : result.dir.m) {
       rgw_bucket_dir_entry& dirent = entry.second;