From a42416b2690b68ea68d139b27e4d019bdff86713 Mon Sep 17 00:00:00 2001 From: "Yan, Zheng" Date: Fri, 7 Jul 2017 19:15:31 +0800 Subject: [PATCH] mds/FSMap.cc: remember stopped mds when resetting filesystem Remember mds ranks that have ever started. They should load old inotable instead of creating new one if they start again. (suppose cephfs repair tool fixed inotable) Signed-off-by: "Yan, Zheng" --- src/mds/FSMap.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/mds/FSMap.cc b/src/mds/FSMap.cc index eb08d02b7dc..89dca0e9a82 100644 --- a/src/mds/FSMap.cc +++ b/src/mds/FSMap.cc @@ -293,6 +293,12 @@ void FSMap::reset_filesystem(fs_cluster_id_t fscid) new_fs->mds_map.standby_count_wanted = fs->mds_map.standby_count_wanted; new_fs->mds_map.enabled = true; + // Remember mds ranks that have ever started. (They should load old inotable + // instead of creating new one if they start again.) + new_fs->mds_map.stopped.insert(fs->mds_map.in.begin(), fs->mds_map.in.end()); + new_fs->mds_map.stopped.insert(fs->mds_map.stopped.begin(), fs->mds_map.stopped.end()); + new_fs->mds_map.stopped.erase(mds_rank_t(0)); + // Persist the new FSMap filesystems[new_fs->fscid] = new_fs; } -- 2.39.5