]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: trim cache after journal flush 26083/head
authorPatrick Donnelly <pdonnell@redhat.com>
Tue, 22 Jan 2019 20:12:55 +0000 (12:12 -0800)
committerPatrick Donnelly <pdonnell@redhat.com>
Fri, 25 Jan 2019 05:49:48 +0000 (21:49 -0800)
Dropping cache should trim the cache only after journal flush otherwise dirty
inodes will remain pinned in cache.

Fixes: http://tracker.ceph.com/issues/38010
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
src/mds/MDSRank.cc

index 82eb2feafbb7bfcfb0b1325fb361f2d7a41ddf45..5e80b27607a961bc70c4d751c6ed851208649541 100644 (file)
@@ -344,18 +344,6 @@ private:
     f->close_section();
 
     // we can still continue after recall timeout
-    trim_cache();
-  }
-
-  void trim_cache() {
-    dout(20) << __func__ << dendl;
-
-    if (!mdcache->trim(UINT64_MAX)) {
-      cmd_err(f, "failed to trim cache");
-      complete(-EINVAL);
-      return;
-    }
-
     flush_journal();
   }
 
@@ -385,6 +373,18 @@ private:
     f->dump_string("message", ss.str());
     f->close_section();
 
+    trim_cache();
+  }
+
+  void trim_cache() {
+    dout(20) << __func__ << dendl;
+
+    if (!mdcache->trim(UINT64_MAX)) {
+      cmd_err(f, "failed to trim cache");
+      complete(-EINVAL);
+      return;
+    }
+
     cache_status();
   }