Test backfill
(ctx, config)
| 30 | return proc |
| 31 | |
| 32 | def task(ctx, config): |
| 33 | """ |
| 34 | Test backfill |
| 35 | """ |
| 36 | if config is None: |
| 37 | config = {} |
| 38 | assert isinstance(config, dict), \ |
| 39 | 'thrashosds task only accepts a dict for configuration' |
| 40 | first_mon = teuthology.get_first_mon(ctx, config) |
| 41 | (mon,) = ctx.cluster.only(first_mon).remotes.keys() |
| 42 | |
| 43 | num_osds = teuthology.num_instances_of_type(ctx.cluster, 'osd') |
| 44 | log.info('num_osds is %s' % num_osds) |
| 45 | assert num_osds == 3 |
| 46 | |
| 47 | manager = ceph_manager.CephManager( |
| 48 | mon, |
| 49 | ctx=ctx, |
| 50 | logger=log.getChild('ceph_manager'), |
| 51 | ) |
| 52 | |
| 53 | while len(manager.get_osd_status()['up']) < 3: |
| 54 | time.sleep(10) |
| 55 | manager.flush_pg_stats([0, 1, 2]) |
| 56 | manager.wait_for_clean() |
| 57 | |
| 58 | # write some data |
| 59 | p = rados_start(ctx, mon, ['-p', 'rbd', 'bench', '15', 'write', '-b', '4096', |
| 60 | '--no-cleanup']) |
| 61 | err = p.wait() |
| 62 | log.info('err is %d' % err) |
| 63 | |
| 64 | # mark osd.0 out to trigger a rebalance/backfill |
| 65 | manager.mark_out_osd(0) |
| 66 | |
| 67 | # also mark it down to it won't be included in pg_temps |
| 68 | manager.kill_osd(0) |
| 69 | manager.mark_down_osd(0) |
| 70 | |
| 71 | # wait for everything to peer and be happy... |
| 72 | manager.flush_pg_stats([1, 2]) |
| 73 | manager.wait_for_recovery() |
| 74 | |
| 75 | # write some new data |
| 76 | p = rados_start(ctx, mon, ['-p', 'rbd', 'bench', '30', 'write', '-b', '4096', |
| 77 | '--no-cleanup']) |
| 78 | |
| 79 | time.sleep(15) |
| 80 | |
| 81 | # blackhole + restart osd.1 |
| 82 | # this triggers a divergent backfill target |
| 83 | manager.blackhole_kill_osd(1) |
| 84 | time.sleep(2) |
| 85 | manager.revive_osd(1) |
| 86 | |
| 87 | # wait for our writes to complete + succeed |
| 88 | err = p.wait() |
| 89 | log.info('err is %d' % err) |
nothing calls this directly
no test coverage detected