From: Kefu Chai Date: Tue, 25 Jun 2019 04:49:44 +0000 (+0800) Subject: qa/tasks/ceph_manager.py: ignore errors in test_pool_min_size X-Git-Tag: v15.1.0~2320^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=fbd4836d246323fa1ed7007abe459e50f785966c;p=ceph.git 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 erasure_code_profile` and `ceph osd erasure-code-profile get ` calls. Fixes: http://tracker.ceph.com/issues/40533 Signed-off-by: Kefu Chai --- diff --git a/qa/tasks/ceph_manager.py b/qa/tasks/ceph_manager.py index fff74aeb6bf..a127c2b3fe0 100644 --- a/qa/tasks/ceph_manager.py +++ b/qa/tasks/ceph_manager.py @@ -713,8 +713,10 @@ class Thrasher: pool_type = pool_json['type'] # 1 for rep, 3 for ec min_size = pool_json['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") - if pool_type == 3: + try: + 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_json = self.ceph_manager.raw_cluster_cmd( 'osd', @@ -726,13 +728,16 @@ class Thrasher: local_k = int(ec_json['k']) local_m = int(ec_json['m']) 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: self.log("setting k={local_k} from previous {k}".format(local_k=local_k, k=k)) k = local_k if local_m < m: self.log("setting m={local_m} from previous {m}".format(local_m=local_m, m=m)) m = local_m + except CommandFailedError: + self.log("failed to read erasure_code_profile. %s was likely removed", pool) + continue if has_pools : self.log("using k={k}, m={m}".format(k=k,m=m))