From: Greg Farnum Date: Mon, 24 Jan 2011 18:30:07 +0000 (-0800) Subject: MDSMonitor: be more conservative with use of pending_mdsmap. X-Git-Tag: v0.25~251^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1b45088e1c88f455b06e2a072d0fb8f0a29e03df;p=ceph.git MDSMonitor: be more conservative with use of pending_mdsmap. 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 --- diff --git a/src/mon/MDSMonitor.cc b/src/mon/MDSMonitor.cc index b8fa9ca97d5..7d62d9aee95 100644 --- a/src/mon/MDSMonitor.cc +++ b/src/mon/MDSMonitor.cc @@ -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::iterator i = pending_mdsmap.mds_info.begin(); - i != pending_mdsmap.mds_info.end(); + for (map::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)))