mirror of
https://github.com/ceph/ceph
synced 2024-12-22 11:31:55 +00:00
mon: move election msg check into elector
Signed-off-by: Sage Weil <sage@inktank.com>
This commit is contained in:
parent
ee138678d0
commit
e1564aff2c
src/mon
@ -308,6 +308,13 @@ void Elector::dispatch(Message *m)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!mon->monmap->contains(m->get_source_addr())) {
|
||||
dout(1) << "discarding election message: " << m->get_source_addr()
|
||||
<< " not in my monmap " << *mon->monmap << dendl;
|
||||
m->put();
|
||||
return;
|
||||
}
|
||||
|
||||
MonMap *peermap = new MonMap;
|
||||
peermap->decode(em->monmap_bl);
|
||||
if (peermap->epoch > mon->monmap->epoch) {
|
||||
|
@ -1691,13 +1691,7 @@ bool Monitor::_ms_dispatch(Message *m)
|
||||
<< s->caps << dendl;
|
||||
}
|
||||
if (!is_probing() && !is_slurping()) {
|
||||
if (monmap->contains(m->get_source_addr())) {
|
||||
elector.dispatch(m);
|
||||
} else {
|
||||
dout(1) << "discarding election message: " << m->get_source_addr() << " not in my monmap "
|
||||
<< *monmap << dendl;
|
||||
m->put();
|
||||
}
|
||||
elector.dispatch(m);
|
||||
} else {
|
||||
m->put();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user