summaryrefslogtreecommitdiffstats
path: root/qa
diff options
context:
space:
mode:
authorPatrick Donnelly <pdonnell@redhat.com>2021-06-12 05:04:53 +0200
committerPatrick Donnelly <pdonnell@redhat.com>2021-06-12 05:07:22 +0200
commitb24608daa222f6888e91bedbe6d3b266a1a2e891 (patch)
tree2be6c12eae7bb495f73b85b7029295eae6e82c16 /qa
parentqa,pybind/mgr: allow disabling .mgr pool (diff)
downloadceph-b24608daa222f6888e91bedbe6d3b266a1a2e891.tar.xz
ceph-b24608daa222f6888e91bedbe6d3b266a1a2e891.zip
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 <pdonnell@redhat.com>
Diffstat (limited to 'qa')
-rw-r--r--qa/tasks/scrub_test.py16
1 files changed, 14 insertions, 2 deletions
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)