]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: do not force proposal when no osds 1179/head
authorLoic Dachary <loic@dachary.org>
Sun, 2 Feb 2014 00:09:52 +0000 (01:09 +0100)
committerLoic Dachary <loic@dachary.org>
Tue, 4 Feb 2014 00:25:15 +0000 (01:25 +0100)
If there are no OSDs, there is no need to propose to paxos. It does not
hurt on a production cluster but it matters when running tests because
it effectively alway ignores --paxos-propose-interval.

Reviewed-By: Christophe Courtaut <christophe.courtaut@gmail.com>
Signed-off-by: Loic Dachary <loic@dachary.org>
src/mon/OSDMonitor.cc

index 8bf63ccdc5a8bd0b1d7b30fa2cc3415d8216ff42..c85a88c5f2b280a25c79f623df7c7ab62de75895 100644 (file)
@@ -725,7 +725,8 @@ bool OSDMonitor::should_propose(double& delay)
     return true;
 
   // adjust osd weights?
-  if (osd_weight.size() == (unsigned)osdmap.get_max_osd()) {
+  if (osd_weight.size() > 0 &&
+      osd_weight.size() == (unsigned)osdmap.get_max_osd()) {
     dout(0) << " adjusting osd weights based on " << osd_weight << dendl;
     osdmap.adjust_osd_weights(osd_weight, pending_inc);
     delay = 0.0;