1
0
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:
Sage Weil 2012-05-21 13:07:16 -07:00
parent ee138678d0
commit e1564aff2c
2 changed files with 8 additions and 7 deletions

View File

@ -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) {

View File

@ -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();
}