]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
mon_thrash: optionally scrub after each iteration (default true)
authorSage Weil <sage@inktank.com>
Fri, 5 Jul 2013 21:23:56 +0000 (14:23 -0700)
committerSage Weil <sage@inktank.com>
Mon, 8 Jul 2013 17:39:24 +0000 (10:39 -0700)
Signed-off-by: Sage Weil <sage@inktank.com>
teuthology/task/mon_thrash.py

index 556757a543f1dbe042b78dd392e056d151dabb4b..122c26d1818e9daa21f156cd5180ff884dac2a18 100644 (file)
@@ -50,6 +50,7 @@ class MonitorThrasher:
                         quorum. Setting it to false however would allow the
                         task to run with as many as just one single monitor.
                         (default: True)
+    scrub               Scrub after each iteration (default: True)
 
     Note: if 'store-thrash' is set to True, then 'maintain-quorum' must also
           be set to True.
@@ -100,6 +101,8 @@ class MonitorThrasher:
     self.thrash_many = self.config.get('thrash_many', False)
     self.maintain_quorum = self.config.get('maintain_quorum', True)
 
+    self.scrub = self.config.get('scrub', True)
+
     assert self.max_killable() > 0, \
         'Unable to kill at least one monitor with the current config.'
 
@@ -204,6 +207,10 @@ class MonitorThrasher:
         assert s['state'] == 'leader' or s['state'] == 'peon'
         assert len(s['quorum']) == len(mons)
 
+      if self.scrub:
+        self.log('triggering scrub')
+        self.manager.raw_cluster_cmd('scrub')
+
       if self.thrash_delay > 0.0:
         self.log('waiting for {delay} secs before continuing thrashing'.format(
           delay=self.thrash_delay))