]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd: DBOjectMap::check: Dump complete mapping when inconsistency found
authorDavid Zafman <dzafman@redhat.com>
Thu, 9 Feb 2017 02:55:48 +0000 (18:55 -0800)
committerDavid Zafman <dzafman@redhat.com>
Mon, 27 Mar 2017 15:33:05 +0000 (08:33 -0700)
Signed-off-by: David Zafman <dzafman@redhat.com>
src/os/filestore/DBObjectMap.cc

index ec99addce47129d54df22f5393911bd050ba4443..de71db8926e4277ecd1a703132237cec9d85e2d5 100644 (file)
@@ -71,6 +71,7 @@ int DBObjectMap::check(std::ostream &out)
        parent_to_actual_num_children[header.seq] = header.num_children;
 
       // Check complete table
+      bool complete_error = false;
       boost::optional<string> prev;
       KeyValueDB::Iterator complete_iter = db->get_iterator(USER_PREFIX + header_key(header.seq) + COMPLETE_PREFIX);
       for (complete_iter->seek_to_first(); complete_iter->valid();
@@ -78,10 +79,18 @@ int DBObjectMap::check(std::ostream &out)
          if (prev && prev >= complete_iter->key()) {
              out << "Bad complete for " << header.oid << std::endl;
              errors++;
+             complete_error = true;
              break;
          }
          prev = string(complete_iter->value().c_str(), complete_iter->value().length() - 1);
       }
+      if (complete_error) {
+        out << "Complete mapping:" << std::endl;
+        for (complete_iter->seek_to_first(); complete_iter->valid();
+             complete_iter->next()) {
+          out << complete_iter->key() << " -> " << string(complete_iter->value().c_str(), complete_iter->value().length() - 1) << std::endl;
+        }
+      }
 
       if (header.parent == 0)
        break;