From b24608daa222f6888e91bedbe6d3b266a1a2e891 Mon Sep 17 00:00:00 2001 From: Patrick Donnelly Date: Fri, 11 Jun 2021 20:04:53 -0700 Subject: qa: choose victim pg from rbd pool Right now scrub_test picks any pg in ceph. Unfortunately, it picked the .mgr pool's only pg in [1]: 2021-05-16T11:36:35.035 DEBUG:teuthology.orchestra.run.smithi049:> adjust-ulimits ceph-coverage /home/ubuntu/cephtest/archive/coverage rados --cluster ceph --pool rbd setomapval main.db-journal.0000000000000000 key val Instead, only pick a pg in the rbd pool. [1] /ceph/teuthology-archive/kchai-2021-05-16_11:19:39-rados-wip-kefu-testing-2021-05-16-1043-distro-basic-smithi/6117396/teuthology.log Signed-off-by: Patrick Donnelly --- qa/tasks/scrub_test.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'qa/tasks/scrub_test.py') diff --git a/qa/tasks/scrub_test.py b/qa/tasks/scrub_test.py index 3d629e9d746..edf1069529b 100644 --- a/qa/tasks/scrub_test.py +++ b/qa/tasks/scrub_test.py @@ -13,13 +13,17 @@ from teuthology import misc as teuthology log = logging.getLogger(__name__) -def wait_for_victim_pg(manager): +def wait_for_victim_pg(manager, poolid): """Return a PG with some data and its acting set""" # wait for some PG to have data that we can mess with victim = None while victim is None: stats = manager.get_pg_stats() for pg in stats: + pgid = str(pg['pgid']) + pgpool = int(pgid.split('.')[0]) + if poolid != pgpool: + continue size = pg['stat_sum']['num_bytes'] if size > 0: victim = pg['pgid'] @@ -368,12 +372,20 @@ def task(ctx, config): manager.flush_pg_stats(range(num_osds)) manager.wait_for_clean() + osd_dump = manager.get_osd_dump_json() + poolid = -1 + for p in osd_dump['pools']: + if p['pool_name'] == 'rbd': + poolid = p['pool'] + break + assert poolid != -1 + # write some data p = manager.do_rados(['bench', '--no-cleanup', '1', 'write', '-b', '4096'], pool='rbd') log.info('err is %d' % p.exitstatus) # wait for some PG to have data that we can mess with - pg, acting = wait_for_victim_pg(manager) + pg, acting = wait_for_victim_pg(manager, poolid) osd = acting[0] osd_remote, obj_path, obj_name = find_victim_object(ctx, pg, osd) -- cgit v1.2.3