]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
MDSMonitor: be more conservative with use of pending_mdsmap.
authorGreg Farnum <gregory.farnum@dreamhost.com>
Mon, 24 Jan 2011 18:30:07 +0000 (10:30 -0800)
committerGreg Farnum <gregory.farnum@dreamhost.com>
Mon, 24 Jan 2011 18:57:51 +0000 (10:57 -0800)
Use the current mdsmap when looking for MDSes to standby-replay for,
as that way we know the other MDS is already up. Otherwise we could
try and come up together and potentially race.

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
src/mon/MDSMonitor.cc

index b8fa9ca97d5752622d50313bf842dfde76794033..7d62d9aee95df622687e1e500953fcd962806cb9 100644 (file)
@@ -339,9 +339,9 @@ bool MDSMonitor::prepare_beacon(MMDSBeacon *m)
 
 
     if (!info.standby_for_name.empty()) {
-      if (pending_mdsmap.find_by_name(info.standby_for_name))
+      if (mdsmap.find_by_name(info.standby_for_name))
         info.standby_for_rank =
-            pending_mdsmap.find_by_name(info.standby_for_name)->rank;
+            mdsmap.find_by_name(info.standby_for_name)->rank;
     }
     if (info.standby_for_rank >= 0 && !mdsmap.is_dne(info.standby_for_rank)) {
       info.state = MDSMap::STATE_STANDBY_REPLAY;
@@ -853,8 +853,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 = pending_mdsmap.mds_info.begin();
-            i != pending_mdsmap.mds_info.end();
+        for (map<uint64_t,MDSMap::mds_info_t>::iterator i = mdsmap.mds_info.begin();
+            i != mdsmap.mds_info.end();
             ++i) {
           if (i->second.rank >= 0 &&
               (gid = pending_mdsmap.find_standby_for(i->first, i->second.name)))