From: Greg Farnum Date: Mon, 9 Dec 2013 23:30:57 +0000 (-0800) Subject: Elector: keep a list of classic mons instead of each mon's commands X-Git-Tag: v0.75~125^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a6f4d71c6518b044c401798f1c10791999b2c17a;p=ceph.git Elector: keep a list of classic mons instead of each mon's commands We aren't actually using the sets, so don't bother keeping them. Signed-off-by: Greg Farnum --- diff --git a/src/mon/Elector.cc b/src/mon/Elector.cc index 43b478e99ff..6518822adb2 100644 --- a/src/mon/Elector.cc +++ b/src/mon/Elector.cc @@ -61,7 +61,7 @@ void Elector::bump_epoch(epoch_t e) // clear up some state electing_me = false; acked_me.clear(); - acker_commands.clear(); + classic_mons.clear(); } @@ -74,7 +74,7 @@ void Elector::start() dout(5) << "start -- can i be leader?" << dendl; acked_me.clear(); - acker_commands.clear(); + classic_mons.clear(); init(); // start by trying to elect me @@ -102,7 +102,7 @@ void Elector::defer(int who) if (electing_me) { // drop out acked_me.clear(); - acker_commands.clear(); + classic_mons.clear(); electing_me = false; } @@ -173,15 +173,7 @@ void Elector::victory() } // decide what command set we're supporting - bool use_classic_commands = false; - for (list::iterator i = acker_commands.begin(); - i != acker_commands.end(); - ++i) { - if (i->length() == 0) { - use_classic_commands = true; - break; - } - } + bool use_classic_commands = !classic_mons.empty(); cancel_timer(); @@ -292,7 +284,8 @@ void Elector::handle_ack(MMonElection *m) if (electing_me) { // thanks acked_me[from] = m->get_connection()->get_features(); - acker_commands.push_back(m->commands); + if (!m->commands.length()) + classic_mons.insert(from); dout(5) << " so far i have " << acked_me << dendl; // is that _everyone_? diff --git a/src/mon/Elector.h b/src/mon/Elector.h index 2b3ce5481e8..e59fbf07c6b 100644 --- a/src/mon/Elector.h +++ b/src/mon/Elector.h @@ -114,7 +114,7 @@ class Elector { * victory. Also note each peer's feature set. */ map acked_me; - list acker_commands; + set classic_mons; bufferlist my_supported_commands; bufferlist classic_commands; /**