From e5ed1b2998de31a769dcfe78682cab92393a5412 Mon Sep 17 00:00:00 2001 From: Loic Dachary Date: Sun, 2 Feb 2014 01:09:52 +0100 Subject: [PATCH] mon: do not force proposal when no osds 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 Signed-off-by: Loic Dachary --- src/mon/OSDMonitor.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 8bf63ccdc5a8..c85a88c5f2b2 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -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; -- 2.47.3