Support Questions

Find answers, ask questions, and share your expertise

Kafka - simulating Brokers not being in sync (i.e. not in ISR)

Expert Contributor

Hello All, I've HDP 2.5 & Kafka 0.9

I've a sample Kafka consumer program pushing data into Kafka topic, and a producer reading data from Kafka topic.

I'm trying to simulate having one or more Kafka Brokers out of sync (i.e. not in ISR).

The idea is to kill the Leader of a partition, and to see if there is data loss because of the Brokers not being in-sync. Any tips on how to do that or if anyone has done this kind of testing ?

2 REPLIES 2

Mentor

@Karan Alang

I think there is no better answer than this page I was jsut rading it some hours ago in the train it will just do exactly that ! kafka not in ISR

Rising Star
@Karan Alang

You may also need to check what 'unclean.leader.election.enable' is set to. For example if you have 3 replicas in ISR and you kill the leader, new leader will be elected from only those replicas which are in sync if unclean.leader.election.enable is set to false.

If unclean.leader.election.enable is set to true, then replicas not in ISR can also be elected as leader as a last resort for high availability which may result into data loss.

By default this property is set to true. So if you do not want data loss, it is recommended to set unclean.leader.election.enable=false.

For more details: http://kafka.apache.org/documentation.html#design_uncleanleader

Thank you!