]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds/FSMap.cc: remember stopped mds when resetting filesystem
authorYan, Zheng <zyan@redhat.com>
Fri, 7 Jul 2017 11:15:31 +0000 (19:15 +0800)
committerYan, Zheng <zyan@redhat.com>
Fri, 7 Jul 2017 11:16:56 +0000 (19:16 +0800)
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" <zyan@redhat.com>
src/mds/FSMap.cc

index eb08d02b7dcb007362210a1d6cb9298b79204f00..89dca0e9a82999d60415532edd0dcf34077c5861 100644 (file)
@@ -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;
 }