SiftScience / kafka-assigner

Automated rack-aware assignment of Kafka partitions to brokers
Apache License 2.0
62 stars 21 forks source link

Partition X could not be fully assigned! #5

Open s905060 opened 7 years ago

s905060 commented 7 years ago

How can we avoid the exception?

./kafka-assignment-generator.sh --zk_string XXXXXXXXXX:2181 --mode PRINT_REASSIGNMENT --disable_rack_awareness --broker_hosts_to_remove XXXXXXXXXX
Exception in thread "main" java.lang.IllegalStateException: Partition 99 could not be fully assigned!
    at com.google.common.base.Preconditions.checkState(Preconditions.java:149)
    at siftscience.kafka.tools.KafkaAssignmentStrategy.assignOrphans(KafkaAssignmentStrategy.java:183)
    at siftscience.kafka.tools.KafkaAssignmentStrategy.getRackAwareAssignment(KafkaAssignmentStrategy.java:56)
    at siftscience.kafka.tools.KafkaTopicAssigner.generateAssignment(KafkaTopicAssigner.java:70)
    at siftscience.kafka.tools.KafkaAssignmentGenerator.printLeastDisruptiveReassignment(KafkaAssignmentGenerator.java:175)
    at siftscience.kafka.tools.KafkaAssignmentGenerator.runTool(KafkaAssignmentGenerator.java:290)
    at siftscience.kafka.tools.KafkaAssignmentGenerator.main(KafkaAssignmentGenerator.java:302)
s905060 commented 7 years ago

as well as this

Exception in thread "main" java.lang.IllegalStateException: Topic XXXXXXXX has partition 18 with unexpected replication factor 4
    at com.google.common.base.Preconditions.checkState(Preconditions.java:149)
    at siftscience.kafka.tools.KafkaTopicAssigner.generateAssignment(KafkaTopicAssigner.java:58)
    at siftscience.kafka.tools.KafkaAssignmentGenerator.printLeastDisruptiveReassignment(KafkaAssignmentGenerator.java:175)
    at siftscience.kafka.tools.KafkaAssignmentGenerator.runTool(KafkaAssignmentGenerator.java:290)
    at siftscience.kafka.tools.KafkaAssignmentGenerator.main(KafkaAssignmentGenerator.java:302)
BrianGallew commented 7 years ago

I'm getting this also. In my case, it's pretty clearly caused by having partitions with 3 replicas, but only 2 racks.