]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/filestore: add _merge_collections post-check
authorSage Weil <sage@redhat.com>
Mon, 25 Jun 2018 18:08:21 +0000 (13:08 -0500)
committerSage Weil <sage@redhat.com>
Fri, 7 Sep 2018 17:07:56 +0000 (12:07 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
src/os/filestore/FileStore.cc

index 70ccde6e8f7bd41389e86889cce6a53f08cba656..f7bd3eb3cd0f0496a7eebe68174e7a4a816329b7 100644 (file)
@@ -5784,6 +5784,31 @@ int FileStore::_merge_collection(const coll_t& cid,
   if (_check_replay_guard(cid, spos) > 0)
     r = _destroy_collection(cid);
 
+  if (!r && cct->_conf->filestore_debug_verify_split) {
+    vector<ghobject_t> objects;
+    ghobject_t next;
+    while (1) {
+      collection_list(
+       dest,
+       next, ghobject_t::get_max(),
+       get_ideal_list_max(),
+       &objects,
+       &next);
+      if (objects.empty())
+       break;
+      for (vector<ghobject_t>::iterator i = objects.begin();
+          i != objects.end();
+          ++i) {
+       if (!i->match(bits, pgid.pgid.ps())) {
+         dout(20) << __FUNC__ << ": " << *i << " does not belong in "
+                  << cid << dendl;
+         assert(i->match(bits, pgid.pgid.ps()));
+       }
+      }
+      objects.clear();
+    }
+  }
+
   dout(15) << __FUNC__ << ": " << cid << " " << dest << " bits " << bits
           << " = " << r << dendl;
   return r;