]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: fix standby replay in multimds setup
authorYan, Zheng <zyan@redhat.com>
Thu, 19 Apr 2018 02:15:23 +0000 (10:15 +0800)
committerYan, Zheng <zyan@redhat.com>
Thu, 19 Apr 2018 13:26:31 +0000 (21:26 +0800)
The code should break loops for two level. otherwise, in multimds setup,
a standby mds may get assigned to standby replay multiple times. This
bug may cause monitor to crash.

Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
Fixes: http://tracker.ceph.com/issues/23658
src/mon/MDSMonitor.cc

index 7c213e022d17e0db4baf6301f12cfd37fece94f8..81989c2d76d7fe61915194ae93c884ee18bbc4bc 100644 (file)
@@ -1970,6 +1970,7 @@ bool MDSMonitor::maybe_promote_standby(std::shared_ptr<Filesystem> &fs)
 
       // check everyone
       for (const auto &p : pending.filesystems) {
+       bool assigned = false;
         const auto &fs = p.second;
         const MDSMap &mds_map = fs->mds_map;
         for (const auto &mds_i : mds_map.mds_info) {
@@ -1981,12 +1982,15 @@ bool MDSMonitor::maybe_promote_standby(std::shared_ptr<Filesystem> &fs)
             }
 
             if (try_standby_replay(info, *fs, cand_info)) {
-              do_propose = true;
+             assigned = true;
               break;
             }
-            continue;
           }
         }
+       if (assigned) {
+         do_propose = true;
+         break;
+       }
       }
     }
   }