]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw: add option to specify shard-id for "bi list" admin command
authorMark Kogan <mkogan@redhat.com>
Tue, 30 Jul 2019 11:02:44 +0000 (07:02 -0400)
committerMark Kogan <mkogan@redhat.com>
Tue, 30 Jul 2019 12:55:07 +0000 (08:55 -0400)
related to: https://tracker.ceph.com/issues/40700
Signed-off-by: Mark Kogan <mkogan@redhat.com>
doc/man/8/radosgw-admin.rst
src/rgw/rgw_admin.cc

index 136c8a96b355730bbde2203ee2c2aeb43c8023c8..efd2b482be38dc7ee46433204290a9e2450081d0 100644 (file)
@@ -548,7 +548,7 @@ Options
 
 .. option:: --shard-id=<shard-id>
 
-       Optional for mdlog list, data sync status. Required for ``mdlog trim``.
+       Optional for mdlog list, bi list, data sync status. Required for ``mdlog trim``.
 
 .. option:: --max-entries=<entries>
 
index fd38b4af4e90b95a2d0cd55cc9434bc84508326d..6bc08a99fb9e5e7fbe5535c6969d3ecaee04d1f3 100644 (file)
@@ -5943,7 +5943,8 @@ next:
 
     formatter->open_array_section("entries");
 
-    for (int i = 0; i < max_shards; i++) {
+    int i = (specified_shard_id ? shard_id : 0);
+    for (; i < max_shards; i++) {
       RGWRados::BucketShard bs(store);
       int shard_id = (bucket_info.num_shards > 0  ? i : -1);
       int ret = bs.init(bucket, shard_id, nullptr /* no RGWBucketInfo */);
@@ -5971,6 +5972,9 @@ next:
         formatter->flush(cout);
       } while (is_truncated);
       formatter->flush(cout);
+
+      if (specified_shard_id)
+        break;
     }
     formatter->close_section();
     formatter->flush(cout);