]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: properly process monmaps even when i have the latest
authorSage Weil <sage@newdream.net>
Fri, 11 Nov 2011 20:02:52 +0000 (12:02 -0800)
committerSage Weil <sage@newdream.net>
Fri, 11 Nov 2011 20:02:52 +0000 (12:02 -0800)
We may get the latest monmap when we are doing our probing, but we still
need to process it in update_from_paxos().  Consider get_latest_version()
in addition to the active map.

Signed-off-by: Sage Weil <sage@newdream.net>
src/mon/MonmapMonitor.cc

index e525c34063510cb2d875bd31006c4e69dee61bf6..f1bc368103121e9a138f46d5ff79b2ebfdc21da5 100644 (file)
@@ -48,13 +48,15 @@ void MonmapMonitor::create_initial()
 bool MonmapMonitor::update_from_paxos()
 {
   version_t paxosv = paxos->get_version();
-  if (paxosv <= mon->monmap->epoch)
+  if (paxosv <= paxos->get_latest_version() &&
+      paxosv <= mon->monmap->get_epoch())
     return true;
 
   dout(10) << "update_from_paxos paxosv " << paxosv
           << ", my v " << mon->monmap->epoch << dendl;
 
-  if (mon->monmap->get_epoch() == 0 && paxosv > 0) {
+  if (paxosv > 0 && (mon->monmap->get_epoch() == 0 ||
+                    paxos->get_latest_version() != paxosv)) {
     bufferlist latest;
     version_t v = paxos->get_latest(latest);
     if (v) {