]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/tasks: do not cancel pending pg num changes on mimic 34579/head
authorKefu Chai <kchai@redhat.com>
Thu, 16 Apr 2020 03:33:18 +0000 (11:33 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 29 Apr 2020 15:56:19 +0000 (23:56 +0800)
mimic does not support auto split/merge, but we do test mimic-x on
nautilus, which ends up with failures like:

ceback (most recent call last):
  File "/home/teuthworker/src/git.ceph.com_git_teuthology_py2/teuthology/contextutil.py", line 34, in nested
    yield vars
  File "/home/teuthworker/src/git.ceph.com_ceph_nautilus/qa/tasks/ceph.py", line 1928, in task
    ctx.managers[config['cluster']].stop_pg_num_changes()
  File "/home/teuthworker/src/git.ceph.com_ceph_nautilus/qa/tasks/ceph_manager.py", line 1806, in stop_pg_num_changes
    if pool['pg_num'] != pool['pg_num_target']:
KeyError: 'pg_num_target'

so we need to skip this if 'pg_num_target' is not in pg_pool_t::dump().

this change is not cherry-picked from master, as we don't test
mimic-x on master.

Signed-off-by: Kefu Chai <kchai@redhat.com>
qa/tasks/ceph.py
qa/tasks/ceph_manager.py

index aa4c9620fdc52dd75f54eee158bde0b20caeaabb..3b4b054c84deccc0b9c534b8c79bbf51673437f7 100644 (file)
@@ -1211,9 +1211,18 @@ def osd_scrub_pgs(ctx, config):
     for _ in range(0, retries):
         stats = manager.get_pg_stats()
         unclean = [stat['pgid'] for stat in stats if 'active+clean' not in stat['state']]
-        split_merge = []
         osd_dump = manager.get_osd_dump_json()
-        split_merge = [i['pool_name'] for i in osd_dump['pools'] if i['pg_num'] != i['pg_num_target']]
+        for pool in osd_dump['pools']:
+            pg_num_target = pool.get('pg_num_target')
+            if pg_num_target is None:
+                # mimic does not adjust pg num automatically
+                split_merge = False
+                break
+            elif pg_num_target != pool['pg_num']:
+                split_merge = True
+                break
+        else:
+            split_merge = False
         if not unclean and not split_merge:
             all_clean = True
             break
index 2d9a1c95369cf268e9f38f1d5dfc341feda5ae5e..a1aec64426b652cd5971e6a433ecd253b86d5dce 100644 (file)
@@ -1803,6 +1803,9 @@ class CephManager:
         self.log('Canceling any pending splits or merges...')
         osd_dump = self.get_osd_dump_json()
         for pool in osd_dump['pools']:
+            if 'pg_num_target' not in pool:
+                # mimic does not adjust pg num automatically
+                continue
             if pool['pg_num'] != pool['pg_num_target']:
                 self.log('Setting pool %s (%d) pg_num %d -> %d' %
                          (pool['pool_name'], pool['pool'],