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

Function task

qa/tasks/thrashosds.py:13–224  ·  view source on GitHub ↗

"Thrash" the OSDs by randomly marking them out/down (and then back in) until the task is ended. This loops, and every op_delay seconds it randomly chooses to add or remove an OSD (even odds) unless there are fewer than min_out OSDs out of the cluster, or more than min_in OSDs in

(ctx, config)

Source from the content-addressed store, hash-verified

11
12@contextlib.contextmanager
13def task(ctx, config):
14 """
15 "Thrash" the OSDs by randomly marking them out/down (and then back
16 in) until the task is ended. This loops, and every op_delay
17 seconds it randomly chooses to add or remove an OSD (even odds)
18 unless there are fewer than min_out OSDs out of the cluster, or
19 more than min_in OSDs in the cluster.
20
21 All commands are run on mon0 and it stops when __exit__ is called.
22
23 The config is optional, and is a dict containing some or all of:
24
25 cluster: (default 'ceph') the name of the cluster to thrash
26
27 min_in: (default 4) the minimum number of OSDs to keep in the
28 cluster
29
30 min_out: (default 0) the minimum number of OSDs to keep out of the
31 cluster
32
33 op_delay: (5) the length of time to sleep between changing an
34 OSD's status
35
36 min_dead: (0) minimum number of osds to leave down/dead.
37
38 max_dead: (0) maximum number of osds to leave down/dead before waiting
39 for clean. This should probably be num_replicas - 1.
40
41 clean_interval: (60) the approximate length of time to loop before
42 waiting until the cluster goes clean. (In reality this is used
43 to probabilistically choose when to wait, and the method used
44 makes it closer to -- but not identical to -- the half-life.)
45
46 scrub_interval: (-1) the approximate length of time to loop before
47 waiting until a scrub is performed while cleaning. (In reality
48 this is used to probabilistically choose when to wait, and it
49 only applies to the cases where cleaning is being performed).
50 -1 is used to indicate that no scrubbing will be done.
51
52 chance_down: (0.4) the probability that the thrasher will mark an
53 OSD down rather than marking it out. (The thrasher will not
54 consider that OSD out of the cluster, since presently an OSD
55 wrongly marked down will mark itself back up again.) This value
56 can be either an integer (eg, 75) or a float probability (eg
57 0.75).
58
59 chance_test_min_size: (0) chance to run test_pool_min_size,
60 which:
61 - kills all but one osd
62 - waits
63 - kills that osd
64 - revives all other osds
65 - verifies that the osds fully recover
66
67 test_min_size_duration: (1800) the number of seconds for
68 test_pool_min_size to last.
69
70 timeout: (360) the number of seconds to wait for the cluster

Callers

nothing calls this directly

Calls 15

stop_and_joinMethod · 0.95
onlyMethod · 0.80
raw_cluster_cmdMethod · 0.80
wait_for_all_osds_upMethod · 0.80
flush_all_pg_statsMethod · 0.80
getMethod · 0.45
infoMethod · 0.45
formatMethod · 0.45
runMethod · 0.45
keysMethod · 0.45
debugMethod · 0.45
check_statusMethod · 0.45

Tested by

no test coverage detected