From 8fc60869868283a4a67476f9490b74cca501f70a Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 16 Jan 2012 14:40:34 -0800 Subject: [PATCH] thrashosds: make actions less nonsensical Make marking OSD up/down and in/out totally orthogonal. Signed-off-by: Sage Weil --- teuthology/task/ceph_manager.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/teuthology/task/ceph_manager.py b/teuthology/task/ceph_manager.py index 5f7ab25b3..16f79be62 100644 --- a/teuthology/task/ceph_manager.py +++ b/teuthology/task/ceph_manager.py @@ -82,17 +82,19 @@ class Thrasher(gevent.Greenlet): minin = self.config.get("min_in", 2) minout = self.config.get("min_out", 0) minlive = self.config.get("min_live", 2) - mindead = self.config.get("min_dead", 1) + mindead = self.config.get("min_dead", 0) + self.log('choose_action: min_in %d min_out %d min_live %d min_dead %d' % + (minin,minout,minlive,mindead)) actions = [] if len(self.in_osds) > minin: actions.append((self.out_osd, 1.0,)) - if len(self.live_osds) > minlive and chance_down > 0: - actions.append((self.kill_osd, chance_down)) + if len(self.live_osds) > minlive and chance_down > 0: + actions.append((self.kill_osd, chance_down,)) if len(self.out_osds) > minout: actions.append((self.in_osd, 1.0,)) - if len(self.dead_osds) > mindead: - actions.append((self.revive_osd, 1.0)) + if len(self.dead_osds) > mindead: + actions.append((self.revive_osd, 1.0,)) total = sum([y for (x,y) in actions]) rev_cum = reduce(lambda l,(y1,y2): l+[(y1, (l[-1][1]+y2)/total)], actions, [(0, 0)])[1:] -- 2.47.3