From 55e3e7742b22fd0f015f7439e7aeabdce1845caa 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 Conflicts: src/rgw/rgw_admin.cc --- 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 1fa9dbe4f807a..1eef84c2ab777 100644 --- a/src/rgw/rgw_admin.cc +++ b/src/rgw/rgw_admin.cc @@ -2730,6 +2730,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(); @@ -2743,6 +2745,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; @@ -2767,9 +2775,9 @@ next: cerr << "ERROR: target_shards.add_entry(" << key << ") returned error: " << cpp_strerror(-ret) << std::endl; return ret; } + formatter->close_section(); + formatter->flush(cout); } - - formatter->flush(cout); } } formatter->close_section(); -- 2.39.5