Quick revision
The short answer
Some re-reading is expected, because MM2 translates offsets only from periodic offset-sync records and deliberately rounds to a point at or before the true position, but a 40-minute gap means checkpoints or syncs stopped flowing: the checkpoint connector, the groups filter or replication lag must be checked. The dry-run group got nothing because MM2 writes synced offsets only to groups with no active members in the target cluster, and auto.offset.reset=earliest hid the missing sync by replaying from the start. Failover gets tighter by monitoring replication latency and checkpoint age, verifying translated offsets before consumers start, and testing regularly.
What to remember
In this answer, we saw that MM2 translates offsets from periodic offset syncs and rounds conservatively, so a few seconds of re-reading is normal, while a 40-minute gap means checkpoints or syncs stopped and the checkpoint task, groups filter and replication lag must be checked. MM2 writes synced offsets only to groups without active members in DR, which is why the dry-run group got none, and auto.offset.reset=earliest hid the missing sync. Monitoring checkpoint age, checking offsets in the runbook, explicit translation and regular tests make failover tight.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
Some re-reading is expected, because MM2 translates offsets only from periodic offset-sync records and deliberately rounds to a point at or before the true position, but a 40-minute gap means checkpoints or syncs stopped flowing: the checkpoint connector, the groups filter or replication lag must be checked. The dry-run group got nothing because MM2 writes synced offsets only to groups with no active members in the target cluster, and auto.offset.reset=earliest hid the missing sync by replaying from the start. Failover gets tighter by monitoring replication latency and checkpoint age, verifying translated offsets before consumers start, and testing regularly.
Why this question is asked
A DR test that replays 40 minutes of events is a useful failure: it shows that the failover depends on mechanisms nobody was watching. Two different things happened here, and both come from how MirrorMaker 2 translates and writes consumer offsets. Interviewers ask this to see whether we understand that machinery well enough to explain the gap and to make the next failover predictable. In this answer, we will recap how translation works, see why some re-reading is normal, explain why 40 minutes is not, explain the dry-run group, look at the role of auto.offset.reset, and tighten the failover process.
1A Quick Recap: How MM2 Translates Offsets
MM2 re-produces records in the DR cluster, so offsets in primary.orders differ from those in orders. To translate, the source connector writes offset syncs: pairs that say source offset X corresponds to target offset Y for a partition. It does not write one for every record; it writes a new one when the offsets have drifted by more than offset.lag.max, 100 by default, or at certain intervals.
The checkpoint connector then reads each group's committed offset in primary, finds the nearest usable offset sync, and computes the matching target offset. It emits the result as a checkpoint every emit.checkpoints.interval.seconds and, with sync.group.offsets.enabled, commits it to the group in DR every sync.group.offsets.interval.seconds; both default to 60 seconds.
5 messages in order. Play them, or step through them one at a time.
The translated offset 4870 is at or before the true position, so a little is read twice.
2Why Some Re-Reading Is Expected
Since the fixes in Kafka 3.5 and later, translation is conservative: when MM2 cannot be sure where a source offset lands in the target, it chooses an offset at or before the true position, never after it, because skipping records would lose data while repeating them only duplicates. With a sync point at 5,000 and a group at 5,180, the group gets the target offset matching 5,000, so up to about 180 records, plus whatever arrived during the last checkpoint interval, are read again.
That is seconds of events, which matches what the team expected. It also means consumers must be idempotent: processing the same event twice must have the same effect as once. Any DR plan built on MM2 accepts that.
3Why 40 Minutes Points to Broken Checkpoints
Forty minutes is far more than intervals of 60 seconds can explain. A translated offset that old means the checkpoints or the syncs to the group stopped advancing about 40 minutes before the switch. Three causes cover most cases. The MirrorCheckpointConnector task may have failed, often on a permissions or connection error, while the source connector kept copying records. The groups filter may not match billing, or billing may be excluded. Or the source connector may be lagging, so the records the group had consumed in primary did not yet exist in DR and no newer sync could be written.
We also check the metrics MM2 publishes: replication-latency-ms and record-age-ms for the source connector show whether DR is behind, and checkpoint-latency-ms for the checkpoint connector shows whether checkpoints are fresh. A failed task needs a restart, and its cause, often an ACL on the source groups, must be fixed.
4Why the Dry-Run Group Got No Sync
MM2 writes synced offsets into a target group only when that group has no active members in the target cluster. The reason is safety: changing the committed offsets of a group that is running would fight with its own commits and confuse its consumers. The dry-run group had been started in DR a day earlier and was still active, so MM2 skipped it at every interval. As soon as its consumers stop, MM2 can write to it again on the next sync.
This is easy to miss in a test, because the group looks healthy and simply consumes from wherever it started. The rule for the runbook is that consumers must not run in DR before failover, or must use a different group id while they do.
5How auto.offset.reset Hid the Problem
auto.offset.reset applies only when a group has no committed offset for a partition. With earliest, a group that MM2 never synced starts from the beginning of the topic's retention, and the consumer reports no error. So a missing or stale sync shows up as a large replay rather than a failure, and the team learns of it only from duplicates downstream. With latest it would silently skip data instead, which is worse.
So the failover runbook must check before starting consumers that each group has a translated offset in DR and that it is recent. If not, the operator decides explicitly what to do, rather than letting a default make the choice.
- Stop the group in primaryor confirm primary is down
- Checkpoint for the group exists in DR?YesCheck its ageNoTranslate explicitly or decide a start point
- Checkpoint younger than 2 minutes?YesStart consumers in DRNoInvestigate MM2 before starting
- Watch duplicates and lagconsumers must be idempotent
4 steps in order. Play them, or step through them one at a time.
6Making Failover Tighter
Monitoring comes first: alerts on the source connector's replication latency and on checkpoint age per important group, so a stalled checkpoint task is noticed in minutes, not during a DR test. Next, failover tests on a schedule with real consumers, measuring how much was re-read. And for groups that need explicit control, a failover tool can read the checkpoints directly and set offsets itself.
RemoteClusterUtils reads the checkpoints topic in the target cluster and returns translated offsets for the group, which the tool then commits before consumers start. That gives the operator a clear, logged step instead of relying on a background sync.
7Follow-up questions
Can we make MM2 write an offset sync for every record?
Lowering offset.lag.max makes syncs more frequent and translation more precise, at the cost of more writes to the offset-syncs topic. It reduces re-reading but never to zero, and it does nothing if the checkpoint task has stopped.
Why not just use auto.offset.reset=latest in DR?
Because a missing sync would then skip every event between the last processed one and the switch, silently losing data. Replaying with idempotent consumers is recoverable; skipping is not.
Does MM2 ever move a group's offset backwards in DR?
It avoids that: it only writes a synced offset when it is ahead of what the group already has committed in the target, so it does not rewind a group that progressed on its own.
8Conclusion
In this answer, we saw that MM2 translates offsets from periodic offset syncs and rounds conservatively, so a few seconds of re-reading is normal, while a 40-minute gap means checkpoints or syncs stopped and the checkpoint task, groups filter and replication lag must be checked. MM2 writes synced offsets only to groups without active members in DR, which is why the dry-run group got none, and auto.offset.reset=earliest hid the missing sync. Monitoring checkpoint age, checking offsets in the runbook, explicit translation and regular tests make failover tight.
Open with
There are two separate effects. First, how MM2 translates. The source connector writes offset syncs only periodically, when offsets drift by more than offset.lag.max, 100 by default, and since the 3.5-era fixes it translates conservatively to a point at or before the true position.
Then, if they want more
Checkpoints and group syncs run every 60 seconds by default. So re-reading a few seconds of events is normal and consumers must be idempotent. Forty minutes is not normal. It means checkpoints or syncs stopped advancing about 40 minutes earlier.
I would check the MirrorCheckpointConnector task state and logs, whether the groups filter matches billing, and the source connector's replication latency, and read primary.checkpoints.internal to see the last checkpoint for billing. Second, the dry-run group. MM2 only writes synced offsets to groups with no active members in the target cluster, so it can't interfere with a running group.
That group was active in DR, so it was skipped every time. And auto.offset.reset=earliest only applies when there is no committed offset, so it hid the missing sync by replaying from the start of retention.
To tighten things, I would alert on replication latency and checkpoint age, make the runbook verify a recent translated offset per group before starting consumers, use RemoteClusterUtils.translateOffsets in a failover tool when we want explicit control, and test failover regularly.
About this answer
- Last updated
- 13 November 2026
- Versions it names
- Kafka 3.5
- Checked
- Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
- Where the question comes from
- Written by Scrivio for practice. It is not taken from an interview.
- Official documentation
- Apache Kafka documentation
Report an issue with this answer
Copy the line below and send it to the author with what you found. It carries the address of this page.
Issue with "The group reprocesses about 40 minutes of events instead of the few seconds the team...": https://scrivio-interview-library.netlify.app/spring-boot/kafka-operations/bacf321089/