]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Allow scrubbing while thrashing
authorWarren Usui <warren.usui@inktank.com>
Tue, 22 Apr 2014 17:59:53 +0000 (10:59 -0700)
committerWarren Usui <warren.usui@inktank.com>
Mon, 28 Apr 2014 18:00:38 +0000 (11:00 -0700)
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 <warren.usui@inktank.com>
teuthology/task/ceph_manager.py
teuthology/task/thrashosds.py

index 481c2173c96bd1a3dae6f313ec63a52a205c7754..2778358e5fb72997c887f191878b9fd5a1ae4451 100644 (file)
@@ -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()
index c5f26dcb740c81af586eae80432fe0bfe639db63..ba166ed8e396cfc423c80779f176f1c00b8c3bc3 100644 (file)
@@ -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