]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common: do not omit shard when ghobject NO_GEN is set 3089/head
authorLoic Dachary <ldachary@redhat.com>
Fri, 14 Nov 2014 00:16:10 +0000 (01:16 +0100)
committerLoic Dachary <ldachary@redhat.com>
Fri, 5 Dec 2014 00:00:32 +0000 (01:00 +0100)
Do not silence the display of shard_id when generation is NO_GEN.
Erasure coded objects JSON representation used by ceph_objectstore_tool
need the shard_id to find the file containing the chunk.

Minimal testing is added to ceph_objectstore_tool.py

http://tracker.ceph.com/issues/10063 Fixes: #10063

Signed-off-by: Loic Dachary <ldachary@redhat.com>
(cherry picked from commit dcf09aed121f566221f539106d10283a09f15cf5)

Conflicts:
src/test/ceph_objectstore_tool.py

src/common/hobject.cc

index ecc8cfde4d715170a6df6c3a06657bf6a343729a..28cb86a5c4916f4decbaa8c9bfdb41e74b9d9f0b 100644 (file)
@@ -238,10 +238,10 @@ void ghobject_t::decode(bufferlist::iterator& bl)
 void ghobject_t::dump(Formatter *f) const
 {
   hobj.dump(f);
-  if (generation != NO_GEN) {
+  if (generation != NO_GEN)
     f->dump_int("generation", generation);
+  if (shard_id != ghobject_t::NO_SHARD)
     f->dump_int("shard_id", shard_id);
-  }
 }
 
 void ghobject_t::generate_test_instances(list<ghobject_t*>& o)