]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: move election msg check into elector
authorSage Weil <sage@newdream.net>
Mon, 21 May 2012 20:07:16 +0000 (13:07 -0700)
committerSage Weil <sage@newdream.net>
Mon, 21 May 2012 20:07:16 +0000 (13:07 -0700)
Signed-off-by: Sage Weil <sage@inktank.com>
src/mon/Elector.cc
src/mon/Monitor.cc

index 9db0216ac3812a05a0549683de0f40c1aa56688b..6b91f5a8d763830f5d6a825fff4ac26d655dea41 100644 (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) {
index 97df6e28afc1b7ed6a1a17fc1bdd000e1c383ab2..25c4a499b2fc7fb3efdcb5eae1697f76912770f9 100644 (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();
       }