Replication or erasure coding
In the book: Chapter 13
Lab
Replication or erasure coding
Choose k, m and the plugin and compare usable capacity, overhead, the failures each layout survives and the cost of repairing one chunk.
768 TBraw capacity
8failure domains
EC isa k=4 m=2
- usable
- 512 TB (66.7%)
- up to nearfull (85%)
- 435.2 TB
- raw per usable byte
- 1.5×
- OSD/host losses without losing data
- 2
- size / min_size
- 6 / 5
- losses with I/O still served
- 1
- read to rebuild one chunk
- 4 chunks
replicated, size 3
- usable
- 256 TB (33.3%)
- up to nearfull (85%)
- 217.6 TB
- raw per usable byte
- 3×
- OSD/host losses without losing data
- 2
- size / min_size
- 3 / 2
- losses with I/O still served
- 1
- read to rebuild one chunk
- 1 chunks
usable = raw × k / (k + m) · EC min_size = k + min(1, m − 1) = 5 · replicated min_size = size − ⌊size / 2⌋ = 2 · repair read = k
ceph osd erasure-code-profile set prof-4-2 plugin=isa k=4 m=2 crush-failure-domain=host
ceph osd pool create ecpool erasure prof-4-2
ceph osd pool set ecpool allow_ec_overwrites true # RBD, CephFSThe default profile on main is plugin=isa technique=reed_sol_van k=2 m=2; profiles cannot be changed once a pool uses them.
Follows:
src/mon/OSDMonitor.cc :: prepare_pool_sizesize and min_size of a new poolsrc/common/options/global.yaml.in :: osd_pool_default_erasure_code_profile, mon_osd_nearfull_ratiodefault profile and fullness ratiossrc/erasure-code/lrc/ErasureCodeLrc.cc :: parse_kmlthe k, m, l rules of LRCsrc/erasure-code/clay/ErasureCodeClay.cc :: parsethe d range of CLAYsrc/erasure-code/shec/ErasureCodeShec.cc :: parsethe c rule of SHECsrc/osd/OSDMap.cc :: pool_raw_used_rateraw space per byte (size, or (k+m)/k)