From 28a10164f300d1481c903947278c17e49dad9e47 Mon Sep 17 00:00:00 2001 From: John Spray Date: Mon, 16 Feb 2015 17:01:43 +0000 Subject: [PATCH] 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 --- src/mds/MDCache.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index 915e700fbd0e7..85e0634d11364 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); -- 2.39.5