]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/HitSet: make subclasses dump deterministically
authorSage Weil <sage@redhat.com>
Sat, 8 Aug 2015 11:40:21 +0000 (07:40 -0400)
committerSage Weil <sage@redhat.com>
Sat, 8 Aug 2015 11:45:52 +0000 (07:45 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/HitSet.h

index 2b981a3eaacf4af96549c087d7a4cfecd2630b30..51a396a32611a14ffdadf97682fdebb1bec5e343 100644 (file)
@@ -237,7 +237,10 @@ public:
   void dump(Formatter *f) const {
     f->dump_unsigned("insert_count", count);
     f->open_array_section("hash_set");
-    for (ceph::unordered_set<uint32_t>::const_iterator p = hits.begin(); p != hits.end(); ++p)
+    // dump deterministically
+    std::set<uint32_t> tmp;
+    tmp.insert(hits.begin(), hits.end());
+    for (std::set<uint32_t>::iterator p = tmp.begin(); p != tmp.end(); ++p)
       f->dump_unsigned("hash", *p);
     f->close_section();
   }
@@ -314,7 +317,10 @@ public:
   void dump(Formatter *f) const {
     f->dump_unsigned("insert_count", count);
     f->open_array_section("set");
-    for (ceph::unordered_set<hobject_t>::const_iterator p = hits.begin(); p != hits.end(); ++p) {
+    // dump deterministically
+    std::set<hobject_t> tmp;
+    tmp.insert(hits.begin(), hits.end());
+    for (std::set<hobject_t>::iterator p = tmp.begin(); p != tmp.end(); ++p) {
       f->open_object_section("object");
       p->dump(f);
       f->close_section();