]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: expire other ranks' mydirs during 'stopping'
authorJohn Spray <john.spray@redhat.com>
Mon, 16 Feb 2015 17:01:43 +0000 (17:01 +0000)
committerJohn Spray <john.spray@redhat.com>
Fri, 20 Mar 2015 12:32:47 +0000 (12:32 +0000)
Avoids the surviving MDSs thinking their base dir is still
replicated after a rank has been stopped.

Signed-off-by: John Spray <john.spray@redhat.com>
src/mds/MDCache.cc

index 915e700fbd0e7d171f0fca9fc5b3e24d2244b127..85e0634d113647cdf28723d2173dd7c78c4736f8 100644 (file)
@@ -6287,6 +6287,19 @@ bool MDCache::trim(int max, int count)
     }
   }
 
+  // Other rank's base inodes (when I'm stopping)
+  if (max == 0) {
+    for (set<CInode*>::iterator p = base_inodes.begin();
+         p != base_inodes.end(); ++p) {
+      if (MDS_INO_MDSDIR_OWNER((*p)->ino()) != mds->whoami) {
+        dout(20) << __func__ << ": maybe trimming base: " << *(*p) << dendl;
+        if ((*p)->get_num_ref() == 0) {
+          trim_inode(NULL, *p, NULL, expiremap);
+        }
+      }
+    }
+  }
+
   // send any expire messages
   send_expire_messages(expiremap);