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

Function task

qa/tasks/lost_unfound.py:13–180  ·  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

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

Callers

nothing calls this directly

Calls 15

get_osd_statusMethod · 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
flush_pg_statsMethod · 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