]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw_admin: better bucket reshard logging
authorYehuda Sadeh <yehuda@redhat.com>
Tue, 27 Sep 2016 21:35:31 +0000 (14:35 -0700)
committerRobin H. Johnson <robin.johnson@dreamhost.com>
Thu, 9 Feb 2017 22:36:59 +0000 (14:36 -0800)
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
(cherry picked from commit ac88b5d9e6bc3c8b59c500bf79a0e3daa923a47c)
See: http://tracker.ceph.com/issues/17556
See: https://github.com/ceph/ceph/pull/11368
Signed-off-by: Robin H. Johnson <robin.johnson@dreamhost.com>
src/rgw/rgw_admin.cc

index 755a822b3d396cde22f39709c3391fe1ec809a13..9fd5988c214493428c1739275056e075e8ab0896 100644 (file)
@@ -5089,6 +5089,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();
@@ -5102,6 +5104,12 @@ next:
 
         list<rgw_cls_bi_entry>::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;
@@ -5125,9 +5133,9 @@ next:
           if (ret < 0) {
             return ret;
           }
+          formatter->close_section();
+          formatter->flush(cout);
         }
-
-        formatter->flush(cout);
       }
     }
     formatter->close_section();