From b2a08efe87794fa4614ad5b419037d8b7bb8b3a7 Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Tue, 22 Dec 2015 10:06:22 -0800 Subject: [PATCH] tasks/*unfound*.py: run rados bench in parallel Signed-off-by: Samuel Just --- tasks/ec_lost_unfound.py | 30 ++++++++++++++++++++++++++++++ tasks/lost_unfound.py | 26 ++++++++++++++++++++++++++ tasks/rep_lost_unfound_delete.py | 28 ++++++++++++++++++++++++++++ 3 files changed, 84 insertions(+) diff --git a/tasks/ec_lost_unfound.py b/tasks/ec_lost_unfound.py index 5a9678d8c275c..d197eb4d92cce 100644 --- a/tasks/ec_lost_unfound.py +++ b/tasks/ec_lost_unfound.py @@ -1,10 +1,12 @@ """ Lost_unfound """ +from teuthology.orchestra import run import logging import ceph_manager from teuthology import misc as teuthology from util.rados import rados +import time log = logging.getLogger(__name__) @@ -97,6 +99,30 @@ def task(ctx, config): log.info("there are %d unfound objects" % unfound) assert unfound + testdir = teuthology.get_testdir(ctx) + procs = [] + if config.get('parallel_bench', True): + procs.append(mon.run( + args=[ + "/bin/sh", "-c", + " ".join(['adjust-ulimits', + 'ceph-coverage', + '{tdir}/archive/coverage', + 'rados', + '--no-log-to-stderr', + '--name', 'client.admin', + '-b', str(4<<10), + '-p' , pool, + '-t', '20', + 'bench', '240', 'write', + ]).format(tdir=testdir), + ], + logger=log.getChild('radosbench.{id}'.format(id='client.admin')), + stdin=run.PIPE, + wait=False + )) + time.sleep(10) + # mark stuff lost pgs = manager.get_pg_stats() for pg in pgs: @@ -122,6 +148,9 @@ def task(ctx, config): manager.raw_cluster_cmd('tell', 'osd.3', 'flush_pg_stats') manager.wait_for_recovery() + if not config.get('parallel_bench', True): + time.sleep(20) + # verify result for f in range(1, 10): err = rados(ctx, mon, ['-p', pool, 'get', 'new_%d' % f, '-']) @@ -135,3 +164,4 @@ def task(ctx, config): manager.revive_osd(1) manager.wait_till_osd_is_up(1) manager.wait_for_clean() + run.wait(procs) diff --git a/tasks/lost_unfound.py b/tasks/lost_unfound.py index af1df4de0cb9c..3fb5c16ed7af1 100644 --- a/tasks/lost_unfound.py +++ b/tasks/lost_unfound.py @@ -5,6 +5,7 @@ import logging import time import ceph_manager from teuthology import misc as teuthology +from teuthology.orchestra import run from util.rados import rados log = logging.getLogger(__name__) @@ -111,6 +112,30 @@ def task(ctx, config): log.info("there are %d unfound objects" % unfound) assert unfound + testdir = teuthology.get_testdir(ctx) + procs = [] + if config.get('parallel_bench', True): + procs.append(mon.run( + args=[ + "/bin/sh", "-c", + " ".join(['adjust-ulimits', + 'ceph-coverage', + '{tdir}/archive/coverage', + 'rados', + '--no-log-to-stderr', + '--name', 'client.admin', + '-b', str(4<<10), + '-p' , POOL, + '-t', '20', + 'bench', '240', 'write', + ]).format(tdir=testdir), + ], + logger=log.getChild('radosbench.{id}'.format(id='client.admin')), + stdin=run.PIPE, + wait=False + )) + time.sleep(10) + # mark stuff lost pgs = manager.get_pg_stats() for pg in pgs: @@ -155,3 +180,4 @@ def task(ctx, config): manager.mark_in_osd(1) manager.wait_till_osd_is_up(1) manager.wait_for_clean() + run.wait(procs) diff --git a/tasks/rep_lost_unfound_delete.py b/tasks/rep_lost_unfound_delete.py index b36d260b12224..be3bc74ed6012 100644 --- a/tasks/rep_lost_unfound_delete.py +++ b/tasks/rep_lost_unfound_delete.py @@ -2,7 +2,9 @@ Lost_unfound """ import logging +from teuthology.orchestra import run import ceph_manager +import time from teuthology import misc as teuthology from util.rados import rados @@ -110,6 +112,30 @@ def task(ctx, config): log.info("there are %d unfound objects" % unfound) assert unfound + testdir = teuthology.get_testdir(ctx) + procs = [] + if config.get('parallel_bench', True): + procs.append(mon.run( + args=[ + "/bin/sh", "-c", + " ".join(['adjust-ulimits', + 'ceph-coverage', + '{tdir}/archive/coverage', + 'rados', + '--no-log-to-stderr', + '--name', 'client.admin', + '-b', str(4<<10), + '-p' , POOL, + '-t', '20', + 'bench', '240', 'write', + ]).format(tdir=testdir), + ], + logger=log.getChild('radosbench.{id}'.format(id='client.admin')), + stdin=run.PIPE, + wait=False + )) + time.sleep(10) + # mark stuff lost pgs = manager.get_pg_stats() for pg in pgs: @@ -154,3 +180,5 @@ def task(ctx, config): manager.mark_in_osd(1) manager.wait_till_osd_is_up(1) manager.wait_for_clean() + run.wait(procs) + -- 2.39.5