An m-tolerant code dies if m+1 fragments share a rack
An erasure code only delivers its m-fault tolerance if placement keeps faults independent — spread the k+m fragments so no rack, power domain, or hardware batch holds more than m of them, or one correlated failure exceeds the code.
The k+m code tolerates m losses only when those losses are independent — so we have to confront where the fragments actually sit, because real disks fail together.
Scene 05a
An m-tolerant code dies if m+1 fragments share a rack
- Watch
- Try it
- Predict
- Capture
Here is the exact 17+3 stripe from before, but now we ask the question the durability math quietly skipped: where do the 20 fragments actually sit? Under SPREAD placement no single rack holds more than m=3 of them. Watch one whole rack lose power — every disk in it dies at once — and the object still rebuilds.
Highlighted lines are the ones running in the diagram right now.
def assign(fragments, domains, m):per_domain = {d: 0 for d in domains}for frag in fragments: # k + m of themd = pick_domain(domains, per_domain)if per_domain[d] >= m:continue # full — keep faults independentper_domain[d] += 1frag.domain = dreturn fragments
def failDomain(dead):lost = [f for f in fragments if f.domain == dead]for f in lost:f.alive = False # one event, correlated lossreturn len(lost) # all gone simultaneously
def reconstruct(k):survivors = [f for f in fragments if f.alive]if len(survivors) >= k:return decode(survivors[:k]) # inverse-solveraise Unrecoverable(survivors=len(survivors),needed=k)
Where this sits in Build an S3-style distributed object store
Scene 05a of 12, in the Keep it alive act — Erasure coding, placement, the two planes, and repair.. The code's m-fault tolerance is real only if placement spreads fragments across independent failure domains.
Up next. We now have fragments scattered across domains for safety — but to read an object back we need something that remembers which storage node holds which fragment, which pulls the two planes together.
All 12 scenes in Build an S3-style distributed object store · Every curriculum