From b0f6946a85bab0b2758e0386b1b85149c1bac4b9 Mon Sep 17 00:00:00 2001 From: Mark Kogan Date: Tue, 30 Jul 2019 07:02:44 -0400 Subject: [PATCH] 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 --- doc/man/8/radosgw-admin.rst | 2 +- src/rgw/rgw_admin.cc | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/doc/man/8/radosgw-admin.rst b/doc/man/8/radosgw-admin.rst index 136c8a96b35..efd2b482be3 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 fd38b4af4e9..6bc08a99fb9 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); -- 2.47.3