]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Update last_epoch_(over|under) in MDBalaner if mds0 has failed
authorJianyu Li <joannyli@foxmail.com>
Wed, 21 Jun 2017 19:16:48 +0000 (03:16 +0800)
committerJianyu Li <joannyli@foxmail.com>
Thu, 22 Jun 2017 03:02:59 +0000 (11:02 +0800)
Signed-off-by: Jianyu Li<joannyli@tencent.com>
src/mds/MDBalancer.cc
src/mds/MDBalancer.h
src/mds/MDCache.cc

index 26f14e5194b350721cc827298dcaa092f8f2ba94..0b871fdbfbeca93c0190e1ce5a5f9fe513abf04f 100644 (file)
@@ -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;
+  }
+}
index 1f8d0dd1e607ecadd2e2f384985021ae94e9457c..d5071af12fb5c14215937b3b4dc5e4f3a04c3276 100644 (file)
@@ -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<mds_rank_t, double> targets;
index 25e64f3f833664aa53a16951a76247b4e6adf286..a403ef4edb8698d03dabbfe880d0bd143d524a64 100644 (file)
@@ -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<MDRequestRef> finish;
   for (ceph::unordered_map<metareqid_t, MDRequestRef>::iterator p = active_requests.begin();