From 9b4e8cb03b76cb113e3e07836de380d1c7d2dfcd Mon Sep 17 00:00:00 2001 From: "Yan, Zheng" Date: Thu, 2 Aug 2018 10:05:12 +0800 Subject: [PATCH] mds: update MDSRank::cluster_degraded before handling mds failure Migrator checks MDSRank::is_cluster_degraded() to decide if it needs to send message to other mds. MDSRank::cluster_degraded should get updated before calling Migrator::handle_mds_failure_or_stop(). Introduced by commit 7de9da4a "mds: handle discontinuous mdsmap" Signed-off-by: "Yan, Zheng" (cherry picked from commit 93458c7306c3822175ed3c048f0937af8f02c341) --- src/mds/MDSRank.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mds/MDSRank.cc b/src/mds/MDSRank.cc index da67e93b9337..bdebfed5bf99 100644 --- a/src/mds/MDSRank.cc +++ b/src/mds/MDSRank.cc @@ -1650,6 +1650,8 @@ void MDSRankDispatcher::handle_mds_map( if (g_conf->mds_dump_cache_on_map) mdcache->dump_cache(); + cluster_degraded = mdsmap->is_degraded(); + // mdsmap and oldmap can be discontinuous. failover might happen in the missing mdsmap. // the 'restart' set tracks ranks that have restarted since the old mdsmap set restart; @@ -1786,7 +1788,6 @@ void MDSRankDispatcher::handle_mds_map( } } - cluster_degraded = mdsmap->is_degraded(); if (oldmap->is_degraded() && !cluster_degraded && state >= MDSMap::STATE_ACTIVE) { dout(1) << "cluster recovered." << dendl; auto it = waiting_for_active_peer.find(MDS_RANK_NONE); -- 2.47.3