---
title: "Schema Registry across two DCs: losing the leader DC"
description: "A stretched Kafka cluster loses the DC with every leader-eligible Schema Registry: lookups still work in the other DC, a new schema cannot be registered."
url: https://monedula.dev/kafka-simulator/scenarios/sr-stretched-dc-loss/
---

# Schema Registry across two DCs: losing the leader DC

Scenario 25.1.7 · SR across two DCs: losing the leader's DC. Schema registry · Advanced · about 5 min · Apache Kafka 4.4 · Confluent Platform feature.

SR runs in both DCs but only dc-a may lead. Lose dc-a and dc-b still serves lookups, while a new schema version cannot be registered.

Run it: https://monedula.dev/kafka-simulator/playground/?scenario=25.1.7

## What you start with

A stretched cluster has one _schemas topic, so all SR instances form one group with one leader. Here sr-1 and sr-2 in dc-a are leader-eligible; sr-3 in dc-b runs with leader.eligibility=false, a common setup that keeps the leader near the primary DC.

## Step by step

1. **SR in both DCs · only dc-a may lead** (t+0.000s): One stretched cluster, one _schemas topic. sr-1 and sr-2 in dc-a are leader-eligible; sr-3 in dc-b runs with leader.eligibility=false. The clients run in dc-b. The Setup review flags the eligibility. [Open at this step](https://monedula.dev/kafka-simulator/playground/?scenario=25.1.7&t=0)
2. **O1 written and read** (t+1.000s): Warm clients in dc-b, no SR calls. [Open at this step](https://monedula.dev/kafka-simulator/playground/?scenario=25.1.7&t=1)
3. **dc-a lost** (t+1.300s): dc-a goes down with its brokers and sr-1, sr-2. sr-3 survives but may not lead: the registry has no leader. orders keeps a leader in dc-b. [Open at this step](https://monedula.dev/kafka-simulator/playground/?scenario=25.1.7&t=2)
4. **lookups still work in dc-b** (t+2.400s): c1 restarted with an empty cache. It looks up schema id 1 on sr-3, a follower can answer that, and reads O2. [Open at this step](https://monedula.dev/kafka-simulator/playground/?scenario=25.1.7&t=3)
5. **a new schema cannot register** (t+3.100s): p1 is redeployed with schema v2. Registering it needs a leader, none can be elected in dc-b, and the serializer fails. Old schemas keep flowing; new ones wait for dc-a. [Open at this step](https://monedula.dev/kafka-simulator/playground/?scenario=25.1.7&t=4)
6. **sr-3 leads, _schemas refuses** (t+3.800s): sr-3 is reconfigured with leader.eligibility=true and wins the election in dc-b. The deploy still fails: _schemas kept two of its three replicas in dc-a, so its ISR is one broker, below min.insync.replicas 2, and the leader cannot write the new schema. [Open at this step](https://monedula.dev/kafka-simulator/playground/?scenario=25.1.7&t=5)

## The takeaway

After a DC loss SR lookups survive wherever an instance survives, but registrations need a leader-eligible instance that reaches a writable _schemas. Making sr-3 eligible gives dc-b a leader, yet _schemas kept two of its three replicas in dc-a and now sits below min.insync.replicas. Give every DC that must keep deploying schemas leader-eligible instances, and place _schemas replicas so a DC loss keeps min.insync.replicas.

## Configs in this scenario

- [`min.insync.replicas`](https://kafka.apache.org/44/configuration/topic-configs/#topicconfigs_min.insync.replicas): The fewest in-sync replicas, leader included, that must have a write for an acks=all produce to succeed (default 1); with fewer in the ISR the leader rejects the write with NOT_ENOUGH_REPLICAS. [How min.insync.replicas works](https://monedula.dev/kafka/configs/min-insync-replicas/)

## Further reading

- [Confluent documentation](https://docs.confluent.io/platform/current/schema-registry/multidc.html)

## Troubleshooting

- [Schema Registry no leader: new schemas fail in Kafka](https://monedula.dev/kafka/troubleshooting/schema-registry-no-leader/)
