Repair truncates the conflicting suffix and copies the leader suffix.

highlighted = computed this step

Log repair

Repair truncates the follower after the matching prefix and copies the leader suffix. The before row and repair row are both rendered. Note: repaired logs are recomputed, not authored.

log repair\text{log repair}

Truncate suffix

The repair starts after matchIndex 1. Note: the conflicting suffix is replaced rather than merged.

matchIndex=1\text{matchIndex}=1

a simplified leader-based log replication; quorum commit + log repair are exact on these tiny clusters; full Raft safety, leader election (next book), and network partitions/timing are beyond these traces - no product claims.

Log repair - quorum 2; committedIndex 2; divergent: F2nodeidx 1idx 2idx 3Lt1:at2:bt2:cF1t1:at2:bF1 repairt1:at2:bt2:cF2t1:at1:xF2 repairt1:at2:bt2:c

Copy leader suffix

The repaired follower log has 3 entries. Note: the repair row shows the copied leader suffix.

repaired entries=3\text{repaired entries}=3

a simplified leader-based log replication; quorum commit + log repair are exact on these tiny clusters; full Raft safety, leader election (next book), and network partitions/timing are beyond these traces - no product claims.

Log repair - quorum 2; committedIndex 2; divergent: F2nodeidx 1idx 2idx 3Lt1:at2:bt2:cF1t1:at2:bF1 repairt1:at2:bt2:cF2t1:at1:xF2 repairt1:at2:bt2:c

Summary

Repair makes the follower prefix-consistent with the leader by replacing the conflicting suffix. Note: this is simplified leader-based replication; full Raft safety and leader election are the next book, while partitions and timing are beyond these traces.

repair suffix\text{repair suffix}