From: Sage Weil Date: Fri, 14 Feb 2014 19:25:52 +0000 (-0800) Subject: mon: tell MonmapMonitor first about winning an election X-Git-Tag: v0.78~168^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4595c44ba1754a384f41f54606ad6fca47e9c652;p=ceph.git mon: tell MonmapMonitor first about winning an election It is important in the bootstrap case that the very first paxos round also codify the contents of the monmap itself in order to avoid any manner of confusing scenarios where subsequent elections are called and people try to recover and modify paxos without agreeing on who the quorum participants are. Signed-off-by: Sage Weil --- diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc index 68239e808d6d..2dcbc0776eca 100644 --- a/src/mon/Monitor.cc +++ b/src/mon/Monitor.cc @@ -1560,8 +1560,17 @@ void Monitor::win_election(epoch_t epoch, set& active, uint64_t features, classic_mons = *classic_monitors; paxos->leader_init(); - for (vector::iterator p = paxos_service.begin(); p != paxos_service.end(); ++p) - (*p)->election_finished(); + // NOTE: tell monmap monitor first. This is important for the + // bootstrap case to ensure that the very first paxos proposal + // codifies the monmap. Otherwise any manner of chaos can ensue + // when monitors are call elections or participating in a paxos + // round without agreeing on who the participants are. + monmon()->election_finished(); + for (vector::iterator p = paxos_service.begin(); + p != paxos_service.end(); ++p) { + if (*p != monmon()) + (*p)->election_finished(); + } health_monitor->start(epoch); finish_election();