From: Mark Kogan Date: Tue, 30 Jul 2019 11:02:44 +0000 (-0400) Subject: rgw: add option to specify shard-id for "bi list" admin command X-Git-Tag: v15.1.0~2019^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F29394%2Fhead;p=ceph.git rgw: add option to specify shard-id for "bi list" admin command related to: https://tracker.ceph.com/issues/40700 Signed-off-by: Mark Kogan --- diff --git a/doc/man/8/radosgw-admin.rst b/doc/man/8/radosgw-admin.rst index 136c8a96b355..efd2b482be38 100644 --- a/doc/man/8/radosgw-admin.rst +++ b/doc/man/8/radosgw-admin.rst @@ -548,7 +548,7 @@ Options .. option:: --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= diff --git a/src/rgw/rgw_admin.cc b/src/rgw/rgw_admin.cc index fd38b4af4e90..6bc08a99fb9e 100644 --- a/src/rgw/rgw_admin.cc +++ b/src/rgw/rgw_admin.cc @@ -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);