From ac88b5d9e6bc3c8b59c500bf79a0e3daa923a47c Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Tue, 27 Sep 2016 14:35:31 -0700 Subject: [PATCH] rgw_admin: better bucket reshard logging Signed-off-by: Yehuda Sadeh --- src/rgw/rgw_admin.cc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/rgw/rgw_admin.cc b/src/rgw/rgw_admin.cc index 6eead05f25b..58600a791b2 100644 --- a/src/rgw/rgw_admin.cc +++ b/src/rgw/rgw_admin.cc @@ -4918,6 +4918,8 @@ next: formatter->open_array_section("entries"); + uint64_t total_entries = 0; + for (int i = 0; i < num_source_shards; ++i) { bool is_truncated = true; marker.clear(); @@ -4931,6 +4933,12 @@ next: list::iterator iter; for (iter = entries.begin(); iter != entries.end(); ++iter) { + formatter->open_object_section("entry"); + + encode_json("shard_id", i, formatter); + encode_json("num_entry", total_entries, formatter); + total_entries++; + rgw_cls_bi_entry& entry = *iter; encode_json("entry", entry, formatter); marker = entry.idx; @@ -4954,9 +4962,9 @@ next: if (ret < 0) { return ret; } + formatter->close_section(); + formatter->flush(cout); } - - formatter->flush(cout); } } formatter->close_section(); -- 2.47.3