mon: only re bootstrap if monmap actually changes

If we go thru here just to update latest, that's fine; no need to restart
the bootstrap process.

Signed-off-by: Sage Weil <sage@newdream.net>
This commit is contained in:
Sage Weil 2011-11-11 12:22:09 -08:00
parent 622fbadd66
commit 2633d71dbd

View File

@ -55,6 +55,8 @@ bool MonmapMonitor::update_from_paxos()
dout(10) << "update_from_paxos paxosv " << paxosv
<< ", my v " << mon->monmap->epoch << dendl;
bool need_restart = paxosv != mon->monmap->get_epoch();
if (paxosv > 0 && (mon->monmap->get_epoch() == 0 ||
paxos->get_latest_version() != paxosv)) {
bufferlist latest;
@ -93,7 +95,8 @@ bool MonmapMonitor::update_from_paxos()
mon->rank = rank;
}
mon->bootstrap();
if (need_restart)
mon->bootstrap();
return true;
}