]> git.proxmox.com Git - ceph.git/blob - ceph/doc/dev/osd_internals/erasure_coding.rst
import ceph quincy 17.2.6
[ceph.git] / 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 as each other. There are two kinds of chunks: (1) *data
11 chunks*, which can be concatenated to reconstruct the original
12 object, and (2) *coding chunks*, which can be used to rebuild a
13 lost chunk.
14
15 *chunk rank*
16 The index of a chunk, as determined by the encoding function. The
17 rank of the first chunk is 0, the rank of the second chunk is 1,
18 and so on.
19
20 *K*
21 The number of data chunks into which an object is divided. For
22 example, if *K* = 2, then a 10KB object is divided into two objects
23 of 5KB each.
24
25 *M*
26 The number of coding chunks computed by the encoding function. *M*
27 is equal to the number of OSDs that can be missing from the cluster
28 without the cluster suffering data loss. For example, if there are
29 two coding chunks, then two OSDs can be missing without data loss.
30
31 *N*
32 The number of data chunks plus the number of coding chunks: that
33 is, *K* + *M*.
34
35 *rate*
36 The proportion of the total chunks containing useful information:
37 that is, *K* divided by *N*. For example, suppose that *K* = 9 and
38 *M* = 3. This would mean that *N* = 12 (because *K* + *M* = 9 + 3).
39 Therefore, the *rate* (*K* / *N*) would be 9 / 12 = 0.75. In other
40 words, 75% of the chunks would contain useful information.
41
42 *shard* (also called *strip*)
43 An ordered sequence of chunks of the same rank from the same object. For a
44 given placement group, each OSD contains shards of the same rank. In the
45 special case in which an object is encoded with only one call to the
46 encoding function, the term *chunk* may be used instead of *shard* because
47 the shard is made of a single chunk. The chunks in a shard are ordered
48 according to the rank of the stripe (see *stripe* below) they belong to.
49
50
51 *stripe*
52 If an object is so large that encoding it requires more than one
53 call to the encoding function, each of these calls creates a set of
54 chunks called a *stripe*.
55
56 The definitions are illustrated as follows (PG stands for placement group):
57 ::
58
59 OSD 40 OSD 33
60 +-------------------------+ +-------------------------+
61 | shard 0 - PG 10 | | shard 1 - PG 10 |
62 |+------ object O -------+| |+------ object O -------+|
63 ||+---------------------+|| ||+---------------------+||
64 stripe||| chunk 0 ||| ||| chunk 1 ||| ...
65 0 ||| stripe 0 ||| ||| stripe 0 |||
66 ||+---------------------+|| ||+---------------------+||
67 ||+---------------------+|| ||+---------------------+||
68 stripe||| chunk 0 ||| ||| chunk 1 ||| ...
69 1 ||| stripe 1 ||| ||| stripe 1 |||
70 ||+---------------------+|| ||+---------------------+||
71 ||+---------------------+|| ||+---------------------+||
72 stripe||| chunk 0 ||| ||| chunk 1 ||| ...
73 2 ||| stripe 2 ||| ||| stripe 2 |||
74 ||+---------------------+|| ||+---------------------+||
75 |+-----------------------+| |+-----------------------+|
76 | ... | | ... |
77 +-------------------------+ +-------------------------+
78
79 Table of contents
80 -----------------
81
82 .. toctree::
83 :maxdepth: 1
84
85 Developer notes <erasure_coding/developer_notes>
86 Jerasure plugin <erasure_coding/jerasure>
87 High level design document <erasure_coding/ecbackend>