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>
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
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'],