CONCEPT Cited by 1 source
Replica divergence¶
Definition¶
Replica divergence occurs when replicas of the same partition permanently disagree about what data exists in the log. Unlike temporary replication lag (which is self-healing once a follower catches up), divergence is permanent and unrecoverable without operator intervention — the leader no longer has the information needed to bring the divergent replica into agreement.
Kafka's compaction-induced divergence¶
In Apache Kafka's compacted topics, replica divergence arises from the compaction–replication race: compaction removes a tombstone or transaction control batch on the leader before a lagging replica replicates it. When the replica rejoins, the leader has no record to send — the divergence is baked in.
"The replicas then permanently disagree about what's in the log, and which version a consumer sees depends on which broker is the leader at read time." (Source: sources/2026-06-25-redpanda-kafkas-log-compaction-corrupts-data)
Consumer-visible effects¶
Divergence is invisible to the cluster's metadata layer — ISR membership, partition health checks, and replication lag metrics all look normal. The divergence manifests only at read time: consumers see different data depending on which replica is the current leader. This makes the failure mode particularly insidious — it produces silent data corruption rather than an observable error.
Distinction from split-brain¶
Split-brain (multiple leaders accepting writes) produces divergent writes. Compaction-induced divergence produces divergent reads from a single logical log that has different physical contents on different replicas. The cluster appears healthy; only the data is wrong.
Seen in¶
- sources/2026-06-25-redpanda-kafkas-log-compaction-corrupts-data — four variants of replica divergence demonstrated in Kafka 3.9–4.2, all stemming from premature compaction of metadata records.
Related¶
- concepts/compaction-replication-race — the mechanism that produces divergence
- concepts/log-compaction — the background process that creates the opportunity
- concepts/in-sync-replica-set — replica unavailability is the prerequisite
- concepts/coordinated-compaction — Redpanda's prevention mechanism
- systems/kafka