MCPcopy Create free account
hub / github.com/ceph/ceph / task

Function task

qa/tasks/rep_lost_unfound_delete.py:14–178  ·  view source on GitHub ↗

Test handling of lost objects. A pretty rigid cluster is brought up and tested by this task

(ctx, config)

Source from the content-addressed store, hash-verified

12log = logging.getLogger(__name__)
13
14def task(ctx, config):
15 """
16 Test handling of lost objects.
17
18 A pretty rigid cluster is brought up and tested by this task
19 """
20 POOL = 'unfounddel_pool'
21 if config is None:
22 config = {}
23 assert isinstance(config, dict), \
24 'lost_unfound task only accepts a dict for configuration'
25 first_mon = teuthology.get_first_mon(ctx, config)
26 (mon,) = ctx.cluster.only(first_mon).remotes.keys()
27
28 manager = ceph_manager.CephManager(
29 mon,
30 ctx=ctx,
31 logger=log.getChild('ceph_manager'),
32 )
33
34 while len(manager.get_osd_status()['up']) < 3:
35 time.sleep(10)
36 manager.flush_pg_stats([0, 1, 2])
37 manager.wait_for_clean()
38
39 manager.create_pool(POOL)
40
41 # something that is always there
42 dummyfile = '/etc/fstab'
43
44 # take an osd out until the very end
45 manager.kill_osd(2)
46 manager.mark_down_osd(2)
47 manager.mark_out_osd(2)
48
49 # kludge to make sure they get a map
50 rados(ctx, mon, ['-p', POOL, 'put', 'dummy', dummyfile])
51
52 manager.flush_pg_stats([0, 1])
53 manager.wait_for_recovery()
54
55 # create old objects
56 for f in range(1, 10):
57 rados(ctx, mon, ['-p', POOL, 'put', 'existing_%d' % f, dummyfile])
58 rados(ctx, mon, ['-p', POOL, 'put', 'existed_%d' % f, dummyfile])
59 rados(ctx, mon, ['-p', POOL, 'rm', 'existed_%d' % f])
60
61 # delay recovery, and make the pg log very long (to prevent backfill)
62 manager.raw_cluster_cmd(
63 'tell', 'osd.1',
64 'injectargs',
65 '--osd-recovery-delay-start 1000 --osd-min-pg-log-entries 100000000'
66 )
67
68 manager.kill_osd(0)
69 manager.mark_down_osd(0)
70
71 for f in range(1, 10):

Callers

nothing calls this directly

Calls 15

get_osd_statusMethod · 0.95
flush_pg_statsMethod · 0.95
wait_for_cleanMethod · 0.95
create_poolMethod · 0.95
kill_osdMethod · 0.95
mark_down_osdMethod · 0.95
mark_out_osdMethod · 0.95
wait_for_recoveryMethod · 0.95
raw_cluster_cmdMethod · 0.95
revive_osdMethod · 0.95
mark_in_osdMethod · 0.95
wait_till_osd_is_upMethod · 0.95

Tested by

no test coverage detected