From: Jianyu Li Date: Wed, 21 Jun 2017 19:16:48 +0000 (+0800) Subject: Update last_epoch_(over|under) in MDBalaner if mds0 has failed X-Git-Tag: v12.1.1~150^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6cba344164fe87ff518a1df0c385a981288dbe91;p=ceph.git Update last_epoch_(over|under) in MDBalaner if mds0 has failed Signed-off-by: Jianyu Li --- diff --git a/src/mds/MDBalancer.cc b/src/mds/MDBalancer.cc index 26f14e5194b3..0b871fdbfbec 100644 --- a/src/mds/MDBalancer.cc +++ b/src/mds/MDBalancer.cc @@ -1228,3 +1228,10 @@ void MDBalancer::add_import(CDir *dir, utime_t now) } } +void MDBalancer::handle_mds_failure(mds_rank_t who) +{ + if (0 == who) { + last_epoch_over = 0; + last_epoch_under = 0; + } +} diff --git a/src/mds/MDBalancer.h b/src/mds/MDBalancer.h index 1f8d0dd1e607..d5071af12fb5 100644 --- a/src/mds/MDBalancer.h +++ b/src/mds/MDBalancer.h @@ -73,6 +73,8 @@ public: */ void maybe_fragment(CDir *dir, bool hot); + void handle_mds_failure(mds_rank_t who); + private: typedef struct { std::map targets; diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index 25e64f3f8336..a403ef4edb86 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -2892,6 +2892,9 @@ void MDCache::handle_mds_failure(mds_rank_t who) // tell the migrator too. migrator->handle_mds_failure_or_stop(who); + // tell the balancer too. + mds->balancer->handle_mds_failure(who); + // clean up any requests slave to/from this node list finish; for (ceph::unordered_map::iterator p = active_requests.begin();