]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: paranoid checks on onode_map vs lru 9470/head
authorSage Weil <sage@redhat.com>
Fri, 3 Jun 2016 20:42:35 +0000 (16:42 -0400)
committerSage Weil <sage@redhat.com>
Fri, 3 Jun 2016 20:42:35 +0000 (16:42 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
src/os/bluestore/BlueStore.cc

index 6c8b13ba7388c5bb985568dc14798ff0df695f32..043ef7115ccb8d0ac057660b040cb95365a700ef 100644 (file)
@@ -547,6 +547,21 @@ void BlueStore::Cache::_audit_lru(const char *when)
     dout(20) << __func__ << " " << when << " buffer_size " << buffer_size
             << " ok" << dendl;
   }
+  if (false) {
+    uint64_t lc = 0, oc = 0;
+    set<OnodeSpace*> spaces;
+    for (auto i = onode_lru.begin(); i != onode_lru.end(); ++i) {
+      assert(i->space->onode_map.count(i->oid));
+      if (spaces.count(i->space) == 0) {
+       spaces.insert(i->space);
+       oc += i->space->onode_map.size();
+      }
+      ++lc;
+    }
+    if (lc != oc) {
+      derr << " lc " << lc << " oc " << oc << dendl;
+    }
+  }
 }
 #endif
 
@@ -6630,8 +6645,11 @@ int BlueStore::_split_collection(TransContext *txc,
   int r;
   RWLock::WLocker l(c->lock);
   RWLock::WLocker l2(d->lock);
+
+  // blow away the caches.  FIXME.
   c->onode_map.clear();
   d->onode_map.clear();
+
   c->cnode.bits = bits;
   assert(d->cnode.bits == bits);
   r = 0;