]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
Scrub osds when ceph task finishes
authorWarren Usui <warren.usui@inktank.com>
Fri, 31 Jan 2014 23:29:02 +0000 (15:29 -0800)
committerWarren Usui <warren.usui@inktank.com>
Fri, 31 Jan 2014 23:29:02 +0000 (15:29 -0800)
Fixes: 7198
Signed-off-by: Warren Usui <warren.usui@inktank.com>
teuthology/task/ceph.py

index 4bd2b59e835fe96d8aa81c029d50b7040607388f..ac705ccb95d997603dabb5592d43466d5259305f 100644 (file)
@@ -1023,6 +1023,23 @@ def cluster(ctx, config):
                 ),
             )
 
+def osd_scrub_pgs(ctx, config):
+    """
+    Scrub pgs when we exit.
+    """
+    
+    for remotes in ctx.cluster.remotes:
+        site_info = remotes.values()
+        for st_info in site_info:
+            for role in st_info:
+                if role.startswith('osd.'):
+                    log.info("Scrubbing osd {osd}".format(osd=role))
+                    testdir = teuthology.get_testdir(ctx)
+                    remotes.run(args=[
+                        'adjust-ulimits',
+                        'ceph-coverage',
+                        '{tdir}/archive/coverage'.format(tdir=testdir),
+                        'ceph', 'osd', 'scrub', role])
 
 @contextlib.contextmanager
 def run_daemon(ctx, config, type_):
@@ -1103,6 +1120,8 @@ def run_daemon(ctx, config, type_):
     try:
         yield
     finally:
+        if type_ == 'osd':
+            osd_scrub_pgs(ctx, config)
         teuthology.stop_daemons_of_type(ctx, type_)
 
 def healthy(ctx, config):