]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: Elector: bootstrap on new monmap from elector
authorJoao Eduardo Luis <joao.luis@inktank.com>
Thu, 4 Oct 2012 16:29:22 +0000 (17:29 +0100)
committerJoao Eduardo Luis <joao.luis@inktank.com>
Thu, 4 Oct 2012 16:36:03 +0000 (17:36 +0100)
Whenever we update the monmap we should bootstrap, in order to reset the
monitor's on-going activities and re-probe.

Not doing so contributed to bug #3252, during which we entered an infinite
election cycle. This may only happen though when we rely on 'mon initial
peers'. Specifying a monmap during the monitor's mkfs should not trigger
this bug.

Fixes: #3252
Backport: argonaut

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
Signed-off-by: Sage Weil <sage@inktank.com>
src/mon/Elector.cc

index 26190ee2aeb15ad0b83ce847448ecf9ff5c05ef8..970b8e44384dbad095892fb97c13fc719723e4e9 100644 (file)
@@ -334,7 +334,11 @@ void Elector::dispatch(Message *m)
        mon->monmap->decode(em->monmap_bl);
        mon->store->put_bl_sn(em->monmap_bl, "monmap", mon->monmap->epoch);
        mon->monmon()->paxos->stash_latest(mon->monmap->epoch, em->monmap_bl);
-      } else if (peermap->epoch < mon->monmap->epoch) {
+       mon->bootstrap();
+       m->put();
+       return;
+      }
+      if (peermap->epoch < mon->monmap->epoch) {
        dout(0) << m->get_source_inst() << " has older monmap epoch " << peermap->epoch
                << " < my epoch " << mon->monmap->epoch 
                << dendl;