I'm facing some problems related to kafka. I created one topic with 2 partitions and 1 replica to test the kafka behavior.
kafka_2.10-0.9.0.0/bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 2 --topic t1
Retrieving the topics related data I got this:
kafka_2.10-0.9.0.0/bin/kafka-topics.sh --describe --topic t1 --zookeeper localhost:2181
Topic:t1 PartitionCount:2 ReplicationFactor:1 Configs:
Topic: t1 Partition: 0 Leader: 0 Replicas: 0 Isr: 0
Topic: t1 Partition: 1 Leader: 1 Replicas: 1 Isr: 1
If I turn off broker 0 sometimes the topics related data remain the same even if from the log of broker 1 I can see the string "successfully elected as leader", while other times they change as follow:
kafka_2.10-0.9.0.0/bin/kafka-topics.sh --describe --topic t1 --zookeeper
Topic:t1 PartitionCount:2 ReplicationFactor:1 Configs:
Topic: t1 Partition: 0 Leader: -1 Replicas: 0 Isr:
Topic: t1 Partition: 1 Leader: 1 Replicas: 1 Isr: 1
For sure the first behavior is wrong (as the ISR 0 does not exists). What should be the expected behavior? If the second is the right one, is it true to say that from that moment all the sent messages will end on Partition 1?
In both cases analyzing the zookeper fs with
ls /brokers/ids
it shows me only the Broker 1