Scenario 20.1.2 · Mirror topics are read-only; promotion makes them writable
Kafka mirror topics (Confluent): read-only until promoted
A cluster-link destination is a READ-ONLY mirror - only the link writes it - until promote_mirror flips it to a normal writable topic and stops mirroring that topic (the link stays up for other mirror topics), after which a local producer can append.
Run this scenario in the playgroundRead-only mirror stands up. t+0.000s
A cluster link from primary→dr creates the destination orders on dr - the same name as the source, since the link sets no cluster.link.prefix - as a READ-ONLY mirror (its dr state is 'mirror', partitions flagged mirrored). Clients cannot produce to it - only the link writes it. The source orders on primary is the writable one.
Open at this step: step 1, Read-only mirror stands upLink mirrors orders read-only. t+0.700s
Three records produced to the SOURCE orders are mirrored byte-for-byte into orders on dr by the link (each mirror step emits cross_region_replicate). Destination HW == source HW = 3. The destination is still a read-only mirror - its only writer is the cluster link.
Open at this step: step 2, Link mirrors orders read-onlypromote_mirror → writable. t+1.300s
promote_mirror flips orders on dr from 'mirror' to 'promoted' and clears the read-only mirrored flags - it is now an ordinary writable topic - and stops mirroring that topic. The simulator removes the link, which carried only this topic; a real cluster link stays up for its other mirror topics. A mirror_promoted event records the transition (drives replay).
Open at this step: step 3, promote_mirror → writableLocal producer appends. t+1.600s
Because promotion made orders on dr writable, the dr-local producer p-dr appends a new record (D1) directly to it - HW advances to 4, past the mirrored tail (orders on primary stays at 3). This local write was impossible while the topic was a read-only mirror; only promotion enabled it.
Open at this step: step 4, Local producer appendsWhat you start with
A Cluster Linking destination starts as a read-only mirror topic: only the link itself may write to it, so local producers are rejected. Calling promote_mirror flips it to a normal writable topic and stops mirroring that topic (the link stays up for other mirror topics), after which a local producer can append.
Step by step
- Read-only mirror stands up t+0.000s A cluster link from primary→dr creates the destination orders on dr - the same name as the source, since the link sets no cluster.link.prefix - as a READ-ONLY mirror (its dr state is 'mirror', partitions flagged mirrored). Clients cannot produce to it - only the link writes it. The source orders on primary is the writable one. Open at this step: step 1, Read-only mirror stands up
- Link mirrors orders read-only t+0.700s Three records produced to the SOURCE orders are mirrored byte-for-byte into orders on dr by the link (each mirror step emits cross_region_replicate). Destination HW == source HW = 3. The destination is still a read-only mirror - its only writer is the cluster link. Open at this step: step 2, Link mirrors orders read-only
- promote_mirror → writable t+1.300s promote_mirror flips orders on dr from 'mirror' to 'promoted' and clears the read-only mirrored flags - it is now an ordinary writable topic - and stops mirroring that topic. The simulator removes the link, which carried only this topic; a real cluster link stays up for its other mirror topics. A mirror_promoted event records the transition (drives replay). Open at this step: step 3, promote_mirror → writable
- Local producer appends t+1.600s Because promotion made orders on dr writable, the dr-local producer p-dr appends a new record (D1) directly to it - HW advances to 4, past the mirrored tail (orders on primary stays at 3). This local write was impossible while the topic was a read-only mirror; only promotion enabled it. Open at this step: step 4, Local producer appends
The takeaway
Promotion is the deliberate one-way cutover step in Cluster Linking - it turns a passive mirror into the new source of truth. Confluent's promote needs the source reachable and zero lag, so it suits a planned cutover; in a disaster with the source gone you run failover instead.
Embed this scenario
Paste this into a blog post, a course page or your team's docs. The scenario plays inside your page, and the link under it points readers to this walkthrough.
<iframe src="https://monedula.dev/kafka-simulator/embed/?scenario=20.1.2" title="Kafka Simulator: Mirror topics are read-only; promotion makes them writable" width="100%" height="520" style="border:1px solid #d0d0d0;border-radius:8px" loading="lazy" referrerpolicy="no-referrer-when-downgrade"></iframe>
<p><a href="https://monedula.dev/kafka-simulator/scenarios/mirror-read-only-promote-writable/">Kafka mirror topics (Confluent): read-only until promoted</a></p> Further reading
Kafka proposals behind this scenario
More in Cluster mirroring
- Confluent Cluster Linking: offset-preserving Kafka mirroring
- Cluster Linking vs MirrorMaker 2 for Kafka replication
- Kafka consumer offset sync: Cluster Linking vs MirrorMaker 2
- Kafka failover and failback with Confluent Cluster Linking
- Apache Kafka Cluster Mirroring (KIP-1279): stop and failback
- kaf-mirror failover: Kafka consumers re-read from earliest
- kaf-mirror failover: latest skips unread Kafka records
- kaf-mirror vs MirrorMaker 2: Kafka failover resume points