]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
os/bluestore: flush_cache on umount, fsck finish, etc.
authorSage Weil <sage@redhat.com>
Thu, 16 Mar 2017 15:30:37 +0000 (11:30 -0400)
committerSage Weil <sage@redhat.com>
Tue, 21 Mar 2017 18:56:30 +0000 (13:56 -0500)
Otherwise cache items survive beyond umount into the next mount cycle!

Also, ensure that we flush_cache *before* clearing coll_map, as some cache
items have references back to the Collection.

Signed-off-by: Sage Weil <sage@redhat.com>
src/os/bluestore/BlueStore.cc

index 77558f017e22712b68411594543a41763cd5f31b..bf435cf97fd6055b32bc244f526c601b95536fa1 100644 (file)
@@ -4762,6 +4762,7 @@ int BlueStore::mount()
     f->stop();
   }
  out_coll:
+  flush_cache();
   coll_map.clear();
  out_alloc:
   _close_alloc();
@@ -4798,6 +4799,7 @@ int BlueStore::umount()
     f->stop();
   }
   _reap_collections();
+  flush_cache();
   coll_map.clear();
   dout(20) << __func__ << " closing" << dendl;
 
@@ -4960,6 +4962,7 @@ int BlueStore::fsck(bool deep)
     }
     r = bluefs->fsck();
     if (r < 0) {
+      flush_cache();
       coll_map.clear();
       goto out_alloc;
     }
@@ -5341,6 +5344,7 @@ int BlueStore::fsck(bool deep)
   }
 
  out_scan:
+  flush_cache();
   coll_map.clear();
  out_alloc:
   _close_alloc();
@@ -10250,6 +10254,7 @@ void BlueStore::generate_db_histogram(Formatter *f)
 
 void BlueStore::flush_cache()
 {
+  dout(10) << __func__ << dendl;
   for (auto i : cache_shards) {
     i->trim_all();
   }