delays = 20
cluster_name = config['cluster']
manager = ctx.managers[cluster_name]
- all_clean = False
- for _ in range(0, retries):
+ for _ in range(retries):
stats = manager.get_pg_stats()
unclean = [stat['pgid'] for stat in stats if 'active+clean' not in stat['state']]
split_merge = []
# we don't support pg_num_target before nautilus
pass
if not unclean and not split_merge:
- all_clean = True
break
- log.info(
- "Waiting for all PGs to be active+clean and split+merged, waiting on %s to go clean and/or %s to split/merge" % (unclean, split_merge))
+ waiting_on = []
+ if unclean:
+ waiting_on.append(f'{unclean} to go clean')
+ if split_merge:
+ waiting_on.append(f'{split_merge} to split/merge')
+ waiting_on = ' and '.join(waiting_on)
+ log.info('Waiting for all PGs to be active+clean and split+merged, waiting on %s', waiting_on)
time.sleep(delays)
- if not all_clean:
+ else:
raise RuntimeError("Scrubbing terminated -- not all pgs were active and clean.")
check_time_now = time.localtime()
time.sleep(1)