bpot / poseidon

A client for Kafka 0.8
MIT License
260 stars 101 forks source link

Trouble producing if too many brokers are down #115

Open Ben-M opened 8 years ago

Ben-M commented 8 years ago

I was experimenting with different failure conditions and found that if I shut down two of five Kafka brokers poseidon would often fail to produce, and instead responded with "Failed to send all messages". More details:

producer = Poseidon::Producer.new(["127.0.0.1:9091", "127.0.0.1:9092", "127.0.0.1:9093", "127.0.0.1:9094", "127.0.0.1:9095"], "my_test_producer", {required_acks: 0 })
  messages = [Poseidon::MessageToSend.new('3', "value1")]
  producer.send_messages(messages)

For certain combinations of brokers being down I was able to produce, for other combinations I was not able to produce.

Ben-M commented 8 years ago

I investigated this a little further by comparing the broker metadata when Poseidon can produce and when it can't. It cannot produce when every partition in a topic has at least one replica offline. It can produce (to any partition) as long as one partition has all its replicas online. This also means that if you create a topic with a replication factor of 5 (on a 5 broker cluster) if any broker is down then Poseidon cannot produce.