]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/tasks/ceph_manager.py: ignore errors in test_pool_min_size 28731/head
authorKefu Chai <kchai@redhat.com>
Tue, 25 Jun 2019 04:49:44 +0000 (12:49 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 27 Jun 2019 11:00:23 +0000 (19:00 +0800)
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>
qa/tasks/ceph_manager.py

index fff74aeb6bf1c1e4f4bff0fd73877daaf12727f6..a127c2b3fe08a91f6f55f9e0e0b6f47de31cae63 100644 (file)
@@ -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))