From 1134fdfe788d756c0389026fa50ab8f81766c691 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 11 Nov 2011 12:02:52 -0800 Subject: [PATCH] mon: properly process monmaps even when i have the latest 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 --- src/mon/MonmapMonitor.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mon/MonmapMonitor.cc b/src/mon/MonmapMonitor.cc index e525c34063510..f1bc368103121 100644 --- a/src/mon/MonmapMonitor.cc +++ b/src/mon/MonmapMonitor.cc @@ -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) { -- 2.39.5