]> git.apps.os.sepia.ceph.com Git - ceph.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>
Wed, 26 Apr 2017 21:03:18 +0000 (14:03 -0700)
Signed-off-by: David Zafman <dzafman@redhat.com>
(cherry picked from commit fcf1e17c645e8fad5216c3e59627c817e5c858c7)

src/os/filestore/DBObjectMap.cc

index 11f1480273c33da517570e1fc6961e543493d3b3..7a4ea28681b11468522b312e328296fd06729578 100644 (file)
@@ -70,6 +70,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();
@@ -77,10 +78,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;