]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: discover mon addrs, names during election state too
authorSage Weil <sage@inktank.com>
Wed, 28 Aug 2013 16:50:11 +0000 (09:50 -0700)
committerSage Weil <sage@inktank.com>
Fri, 30 Aug 2013 16:42:25 +0000 (09:42 -0700)
Currently we only detect new mon addrs and names during the probing phase.
For non-trivial clusters, this means we can get into a sticky spot when
we discover enough peers to form an quorum, but not all of them, and the
undiscovered ones are enough to break the mon ranks and prevent an
election.

One way to work around this is to continue addr and name discovery during
the election.  We should also consider making the ranks less sensitive to
the undefined addrs; that is a separate change.

Fixes: #4924
Backport: dumpling
Signed-off-by: Sage Weil <sage@inktank.com>
Tested-by: Bernhard Glomm <bernhard.glomm@ecologic.eu>
(cherry picked from commit c24028570015cacf1d9e154ffad80bec06a61e7c)

src/mon/Monitor.cc

index 601cdbab47b06f9c4c1162ee88834187afae3476..74330d11e3c77d7793d07d81b388c6fad79396f8 100644 (file)
@@ -1292,7 +1292,8 @@ void Monitor::handle_probe_reply(MMonProbe *m)
   dout(10) << "handle_probe_reply " << m->get_source_inst() << *m << dendl;
   dout(10) << " monmap is " << *monmap << dendl;
 
-  if (!is_probing()) {
+  // discover name and addrs during probing or electing states.
+  if (!is_probing() && !is_electing()) {
     m->put();
     return;
   }
@@ -1326,6 +1327,12 @@ void Monitor::handle_probe_reply(MMonProbe *m)
             << peer_name << " -> " << m->name << " in my monmap"
             << dendl;
     monmap->rename(peer_name, m->name);
+
+    if (is_electing()) {
+      m->put();
+      bootstrap();
+      return;
+    }
   } else {
     dout(10) << " peer name is " << peer_name << dendl;
   }
@@ -1342,6 +1349,12 @@ void Monitor::handle_probe_reply(MMonProbe *m)
     }
   }
 
+  // end discover phase
+  if (!is_probing()) {
+    m->put();
+    return;
+  }
+
   assert(paxos != NULL);
 
   if (is_synchronizing()) {