]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: fix dup mds takeover
authorSage Weil <sage.weil@dreamhost.com>
Wed, 23 Feb 2011 21:34:01 +0000 (13:34 -0800)
committerSage Weil <sage.weil@dreamhost.com>
Wed, 23 Feb 2011 21:34:01 +0000 (13:34 -0800)
Allow a standby to take over for a single MDS only by consistently looking
at the pending_mdsmap and not mdsmap.  Mixing the two leads to all kinds
of confusion.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
src/mon/MDSMonitor.cc

index b599496b97fdb2f7fc1dcb2aa19bf1e00e309269..52310324178030613ab70646abf329ce18e99505 100644 (file)
@@ -935,8 +935,8 @@ void MDSMonitor::tick()
          * See if we can find it somebody to shadow
          */
         int gid = 0;
-        for (map<uint64_t,MDSMap::mds_info_t>::iterator i = mdsmap.mds_info.begin();
-            i != mdsmap.mds_info.end();
+        for (map<uint64_t,MDSMap::mds_info_t>::iterator i = pending_mdsmap.mds_info.begin();
+            i != pending_mdsmap.mds_info.end();
             ++i) {
           if (i->second.rank >= 0) {
             if ((gid = pending_mdsmap.find_standby_for(
@@ -968,7 +968,7 @@ void MDSMonitor::tick()
       uint64_t sgid;
       if (info.rank >= 0 &&
          info.state != CEPH_MDS_STATE_STANDBY &&
-         (sgid = mdsmap.find_replacement_for(info.rank, info.name)) != 0) {
+         (sgid = pending_mdsmap.find_replacement_for(info.rank, info.name)) != 0) {
        MDSMap::mds_info_t& si = pending_mdsmap.mds_info[sgid];
        dout(10) << " replacing " << info.addr << " mds" << info.rank << "." << info.inc
                 << " " << ceph_mds_state_name(info.state)