Repair must restore the intended committed generation
Compare access-triggered and background repair, establish authoritative version evidence, and budget reconstruction traffic without assuming repair is free.
On this page
The question for today
What you’ll understand
- Distinguish read-triggered repair from background redundancy restoration.
- Explain why matching checksums alone cannot choose the committed version.
- Calculate a stated repair-traffic lower bound and its competing-work budget.
A system can return a correct read from surviving data while still having reduced redundancy. Repair tries to restore the intended placement and contents, either when access reveals a defect or through background recovery. Its first question is correctness: which generation should be restored? Its second is capacity: where can the replacement live and how much work will it require? Increasing repair concurrency before answering both questions can amplify load or propagate the wrong bytes faster.
Read success and redundancy restoration differ
Read-triggered repair uses evidence found during access to address a missing or bad copy. Background recovery can restore missing redundancy even when no client requests the affected object. Ceph Squid documents read repairs as well as recovery and backfill states, but those mechanisms should not be projected onto a managed provider whose internals are not specified. The general distinction is useful: a successful response proves an operation succeeded under its contract, not that every desired replica or fragment has already been restored.
Cold data is a particular reason to retain background mechanisms. An access-only strategy might leave a missing fragment unrepaired indefinitely until a later failure removes another. On the other hand, aggressive background work competes with foreground reads and writes. Measure pending repair work, oldest degraded age, reconstruction failures, and restored placement, alongside client latency. A count of started repair tasks is not the same as the number of fragments written, verified, and incorporated into the correct current placement.
Choose authority before copying bytes
A checksum tells whether bytes match their associated reference, not whether they represent the newest committed generation. Two replicas can each have internally consistent but different historical values. The replication protocol's logs, versions, commit evidence, and peering rules determine what is authoritative under its fault model. Choosing the largest wall-clock modification time or taking an unqualified majority of hashes is not a universal replacement for that protocol. Preserve conflicting evidence before an operator action destroys the only newer copy.
Erasure repair also requires correctly indexed valid fragments from one encoded generation. Combining an old fragment with new fragments can produce an invalid or unintended reconstruction even if each fragment passes its own local check. A repair write must respect concurrent updates through the backend's generation and coordination rules. The examples use a hypothetical fixed stripe during repair to make arithmetic clear; they do not claim an S3 ETag is an internal replica version or that managed APIs expose the same evidence as a Ceph administrator.
Repair throughput is a constrained resource allocation
Surviving disks, network links, decode CPU, target writes, and legal placement space can each limit restoration. More workers do not increase throughput once the actual bottleneck saturates, and they can increase foreground latency or failures. An aggregate bandwidth model is useful only if its counted bytes correspond to the stated resource. Distinguish source reads from network transfer and target writes instead of casually counting each as one equivalent byte on every architecture.
The queue lab illustrates a normalized repair-work backlog. Reset, set both λ=3 and μ=2, predict growth from four items, then Play or Step. Reset and set both λ=2,μ=3 for a separate drainage comparison. Parameter edits retain elapsed time and recompute from the initial four, so this is not a live rate switch. There are no version conflicts, disks, coding matrices, or finite buffers in the instrument. Use its fixed-rate imbalance to motivate measuring real completed work, not as a forecast of a cluster's recovery time.
Work it through
Account for shared repair-work bandwidth
A fixed 4+2 stripe has 1 GiB fragments and one known missing fragment. Naive repair reads four fragments and writes one. A hypothetical aggregate work budget counts both reads and writes, with total capacity 384 MiB/s and foreground use 128 MiB/s.
Repair work is 4 × 1 GiB read plus 1 GiB written, or 5 GiB = 5,120 MiB under this explicit aggregate accounting rule.
The residual budget is 384 − 128 = 256 MiB/s. Ignoring decoding, placement, and overhead, the transfer-work lower bound is 5,120 / 256 = 20 seconds.
If foreground use rises to 256 MiB/s, only 128 MiB/s remains and the same ideal work takes forty seconds. Real resources need their own accounting; this synthetic shared budget does not claim every network moves five GiB for that repair.
The modeled repair lower bound doubles from twenty to forty seconds when its residual aggregate budget halves. Correct generation selection is still required before any of this work is useful.
The living notebook
Explore the model
Interactive lab · queue
Started repair is not completed repair
For each fresh fixed-rate case, Reset, set both λ and μ, predict backlog growth or drainage from four items, then Play or Step. No replica versions, decode operations, placement constraints, or real recovery bandwidth are modeled.
- Fluid backlog
- 4
- Net rate · λ − μ
- −1 /s
- M/M/1 mean residence
- 1 s
Fluid backlog starts at 4 and follows max(0, 4 + (λ − μ)t). The separate M/M/1 residence-time formula assumes Poisson arrivals, exponential service and λ < μ. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.
Look forRepair needs authoritative data and enough resources to complete and verify restoration, not just a high task-start rate.
Pause & reason
Check your understanding
Your turn
Try it yourself
A fixed 3+2 MDS stripe has 2 MiB fragments. Naive single-fragment repair reads three surviving fragments and writes one replacement. Under a hypothetical 2 MiB/s aggregate read-plus-write budget, calculate the ideal work time and name one omitted correctness requirement.
Take a moment to make a prediction or work it out on paper. Open a hint when you need one.
Give me a hint
Count all four fragment-sized operations under this explicitly aggregate model. Correctness is not supplied by the throughput calculation.
Compare with the solution
The counted work is 3 × 2 + 1 × 2 = 8 MiB, so the ideal work time is 8/2 = 4 seconds. The surviving fragments must be valid, correctly indexed, and from the intended committed generation; concurrent writes and replacement placement also need the backend's protocol. Decoding CPU, scheduling, and actual resource paths may lengthen or alter the performance model.
Keep the idea
Take it with you
- A successful read can coexist with reduced redundancy and outstanding repair.
- Checksums do not replace authoritative version and commit evidence.
- Repair costs depend on the code, placement, resource path, and competing work.
Read further
Original sources and deeper explanations to follow at your own pace.
Optional progress, saved in this browser when available. Revisit any lesson at any time.
Lesson not marked complete.