From: John Spray Date: Mon, 16 Feb 2015 17:01:43 +0000 (+0000) Subject: mds: expire other ranks' mydirs during 'stopping' X-Git-Tag: v9.0.0~115^2~9 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=28a10164f300d1481c903947278c17e49dad9e47;p=ceph.git mds: expire other ranks' mydirs during 'stopping' Avoids the surviving MDSs thinking their base dir is still replicated after a rank has been stopped. Signed-off-by: John Spray --- diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index 915e700fbd0e..85e0634d1136 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -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::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);