qa/tasks/ceph_manager.py: ignore errors in test_pool_min_size

to be specific, ignore errors when querying erasure coded pool's
erasure-code-profile. the pool might be removed after
"test_pool_min_size" lists all pools and before queries the pools'
erasure-code-profile. in that case, we should just continue on with the
next pool.

normally, the pools are created by the "radosbench" tasks. and they
don't delete the ec profiles after removing the ec pools using them, but
i don't want to rely on this fact. so, in this change, the `try` block
guards both `ceph osd pool get <pool_name> erasure_code_profile`
and `ceph osd erasure-code-profile get <profile>` calls.

Fixes: http://tracker.ceph.com/issues/40533
Signed-off-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
Kefu Chai 2019-06-25 12:49:44 +08:00
parent 1a2700f404
commit fbd4836d24

View File

@ -713,8 +713,10 @@ class Thrasher:
pool_type = pool_json['type'] # 1 for rep, 3 for ec pool_type = pool_json['type'] # 1 for rep, 3 for ec
min_size = pool_json['min_size'] min_size = pool_json['min_size']
self.log("pool {pool} min_size is {min_size}".format(pool=pool,min_size=min_size)) self.log("pool {pool} min_size is {min_size}".format(pool=pool,min_size=min_size))
ec_profile = self.ceph_manager.get_pool_property(pool, "erasure_code_profile") try:
if pool_type == 3: ec_profile = self.ceph_manager.get_pool_property(pool, 'erasure_code_profile')
if pool_type != PoolType.ERASURE_CODED:
continue
ec_profile = pool_json['erasure_code_profile'] ec_profile = pool_json['erasure_code_profile']
ec_profile_json = self.ceph_manager.raw_cluster_cmd( ec_profile_json = self.ceph_manager.raw_cluster_cmd(
'osd', 'osd',
@ -726,13 +728,16 @@ class Thrasher:
local_k = int(ec_json['k']) local_k = int(ec_json['k'])
local_m = int(ec_json['m']) local_m = int(ec_json['m'])
self.log("pool {pool} local_k={k} local_m={m}".format(pool=pool, self.log("pool {pool} local_k={k} local_m={m}".format(pool=pool,
k=local_k, m=local_m)) k=local_k, m=local_m))
if local_k > k: if local_k > k:
self.log("setting k={local_k} from previous {k}".format(local_k=local_k, k=k)) self.log("setting k={local_k} from previous {k}".format(local_k=local_k, k=k))
k = local_k k = local_k
if local_m < m: if local_m < m:
self.log("setting m={local_m} from previous {m}".format(local_m=local_m, m=m)) self.log("setting m={local_m} from previous {m}".format(local_m=local_m, m=m))
m = local_m m = local_m
except CommandFailedError:
self.log("failed to read erasure_code_profile. %s was likely removed", pool)
continue
if has_pools : if has_pools :
self.log("using k={k}, m={m}".format(k=k,m=m)) self.log("using k={k}, m={m}".format(k=k,m=m))