From 694827bc0c063ed6968c8619c051ae102193e4dc Mon Sep 17 00:00:00 2001 From: Warren Usui Date: Tue, 22 Apr 2014 10:59:53 -0700 Subject: [PATCH] Allow scrubbing while thrashing Added ability to implement scrubbing while thrashing (scrub_interval in config can be set to an interval similar to how clean_interval is set). Defaults to 0, which indicates that no scrubbing will take place. Add scrub_interval description to thrashosds docstring. Fixes: 7199 Signed-off-by: Warren Usui --- teuthology/task/ceph_manager.py | 6 ++++++ teuthology/task/thrashosds.py | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/teuthology/task/ceph_manager.py b/teuthology/task/ceph_manager.py index 481c2173c96bd..2778358e5fb72 100644 --- a/teuthology/task/ceph_manager.py +++ b/teuthology/task/ceph_manager.py @@ -9,6 +9,7 @@ import json import threading from teuthology import misc as teuthology from teuthology.task import ceph as ceph_task +from teuthology.task.scrub import Scrubber class Thrasher: """ @@ -350,6 +351,7 @@ class Thrasher: Loop to select random actions to thrash ceph manager with. """ cleanint = self.config.get("clean_interval", 60) + scrubint = self.config.get("scrub_interval", -1) maxdead = self.config.get("max_dead", 0) delay = self.config.get("op_delay", 5) self.log("starting do_thrash") @@ -368,6 +370,10 @@ class Thrasher: timeout=self.config.get('timeout') ) time.sleep(self.clean_wait) + if scrubint > 0: + if random.uniform(0, 1) < (float(delay) / scrubint): + self.log('Scrubbing while thrashing being performed') + Scrubber(self.ceph_manager, self.config) self.choose_action()() time.sleep(delay) self.all_up() diff --git a/teuthology/task/thrashosds.py b/teuthology/task/thrashosds.py index c5f26dcb740c8..ba166ed8e396c 100644 --- a/teuthology/task/thrashosds.py +++ b/teuthology/task/thrashosds.py @@ -41,6 +41,12 @@ def task(ctx, config): to probabilistically choose when to wait, and the method used makes it closer to -- but not identical to -- the half-life.) + scrub_interval: (-1) the approximate length of time to loop before + waiting until a scrub is performed while cleaning. (In reality + this is used to probabilistically choose when to wait, and it + only applies to the cases where cleaning is being performed). + -1 is used to indicate that no scrubbing will be done. + chance_down: (0.4) the probability that the thrasher will mark an OSD down rather than marking it out. (The thrasher will not consider that OSD out of the cluster, since presently an OSD -- 2.39.5