]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: fix Monitor::pick_random_mon()
authorSage Weil <sage@inktank.com>
Fri, 26 Apr 2013 18:12:53 +0000 (11:12 -0700)
committerSage Weil <sage@inktank.com>
Fri, 26 Apr 2013 18:12:53 +0000 (11:12 -0700)
The other arg isn't used, so remove the (broken) handling for that case.
If we re-add it later, model after the MonClient's version.

Fixes: #4821
Signed-off-by: Sage Weil <sage@inktank.com>
src/mon/Monitor.cc
src/mon/Monitor.h

index aabf5f1eb76fefe71400f0c062ba14ad13838e46..27682ffbd96412119259b2593083442f55c6f4e2 100644 (file)
@@ -1034,7 +1034,7 @@ void Monitor::handle_sync_finish(MMonSync *m)
 
 // synchronization provider
 
-string Monitor::_pick_random_mon(int other)
+string Monitor::_pick_random_mon()
 {
   assert(monmap->size() > 0);
   if (monmap->size() == 1)
@@ -1042,8 +1042,6 @@ string Monitor::_pick_random_mon(int other)
 
   int max = monmap->size();
   int n = sync_rng() % max;
-  if (other >= 0 && n >= other)
-    n++;
   return monmap->get_name(n);
 }
 
index 1a19914ba9271bdac6d516b6f1bad21f1a346381..71f3a9b3e12110aaed7288ea16987c743c1c53a9 100644 (file)
@@ -719,7 +719,7 @@ private:
    * @param other Any monitor other than the one with rank @p other
    * @returns The picked monitor's name.
    */
-  string _pick_random_mon(int other = -1);
+  string _pick_random_mon();
   int _pick_random_quorum_mon(int other = -1);
   /**
    * Deal with the consequences of @p entity's sync timing out.