Fix some bugs when testing opensds ansible
[stor4nfv.git] / src / ceph / doc / dev / osd_internals / erasure_coding.rst
1 ==============================
2 Erasure Coded Placement Groups
3 ==============================
4
5 Glossary
6 --------
7
8 *chunk* 
9    when the encoding function is called, it returns chunks of the same
10    size. Data chunks which can be concatenated to reconstruct the original
11    object and coding chunks which can be used to rebuild a lost chunk.
12
13 *chunk rank*
14    the index of a chunk when returned by the encoding function. The
15    rank of the first chunk is 0, the rank of the second chunk is 1
16    etc.
17
18 *stripe* 
19    when an object is too large to be encoded with a single call,
20    each set of chunks created by a call to the encoding function is
21    called a stripe.
22
23 *shard|strip*
24    an ordered sequence of chunks of the same rank from the same
25    object.  For a given placement group, each OSD contains shards of
26    the same rank. When dealing with objects that are encoded with a
27    single operation, *chunk* is sometime used instead of *shard*
28    because the shard is made of a single chunk. The *chunks* in a
29    *shard* are ordered according to the rank of the stripe they belong
30    to.
31
32 *K*
33    the number of data *chunks*, i.e. the number of *chunks* in which the
34    original object is divided. For instance if *K* = 2 a 10KB object
35    will be divided into *K* objects of 5KB each.
36
37 *M* 
38    the number of coding *chunks*, i.e. the number of additional *chunks*
39    computed by the encoding functions. If there are 2 coding *chunks*, 
40    it means 2 OSDs can be out without losing data.
41
42 *N*
43    the number of data *chunks* plus the number of coding *chunks*, 
44    i.e. *K+M*.
45
46 *rate*
47    the proportion of the *chunks* that contains useful information, i.e. *K/N*.
48    For instance, for *K* = 9 and *M* = 3 (i.e. *K+M* = *N* = 12) the rate is 
49    *K* = 9 / *N* = 12 = 0.75, i.e. 75% of the chunks contain useful information.
50
51 The definitions are illustrated as follows (PG stands for placement group):
52 ::
53  
54                  OSD 40                       OSD 33
55        +-------------------------+ +-------------------------+
56        |      shard 0 - PG 10    | |      shard 1 - PG 10    |
57        |+------ object O -------+| |+------ object O -------+|
58        ||+---------------------+|| ||+---------------------+||
59  stripe|||    chunk  0         ||| |||    chunk  1         ||| ...
60    0   |||    stripe 0         ||| |||    stripe 0         ||| 
61        ||+---------------------+|| ||+---------------------+||
62        ||+---------------------+|| ||+---------------------+||
63  stripe|||    chunk  0         ||| |||    chunk  1         ||| ...
64    1   |||    stripe 1         ||| |||    stripe 1         |||
65        ||+---------------------+|| ||+---------------------+||
66        ||+---------------------+|| ||+---------------------+||
67  stripe|||    chunk  0         ||| |||    chunk  1         ||| ...
68    2   |||    stripe 2         ||| |||    stripe 2         |||
69        ||+---------------------+|| ||+---------------------+||
70        |+-----------------------+| |+-----------------------+|
71        |         ...             | |         ...             |
72        +-------------------------+ +-------------------------+
73
74 Table of content
75 ----------------
76
77 .. toctree::
78    :maxdepth: 1
79
80    Developer notes <erasure_coding/developer_notes>
81    Jerasure plugin <erasure_coding/jerasure>
82    High level design document <erasure_coding/ecbackend>