Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-4914

Partition re-assignment tool should check types before persisting state in ZooKeeper

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.10.1.1
    • 2.0.0
    • admin
    • None

    Description

      The partition-reassignment too currently allows non-type-safe information to be persisted into ZooKeeper, which can result in a ClassCastException at runtime for brokers.

      Specifically, this occurred when the broker assignment field was a List of Strings, instead of a List of Integers.

      2017-03-15 01:44:04,572 ERROR [ZkClient-EventThread-36-samsa-zkserver.stage.sjc1.square:26101/samsa] controller.ReplicaStateMachine$BrokerChangeListener - [BrokerChangeListener on Controller 10]: Error while handling broker changes
      java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer
              at scala.runtime.BoxesRunTime.unboxToInt(BoxesRunTime.java:101)
              at kafka.controller.KafkaController$$anonfun$8$$anonfun$apply$2.apply(KafkaController.scala:436)
              at scala.collection.LinearSeqOptimized$class.exists(LinearSeqOptimized.scala:93)
              at scala.collection.immutable.List.exists(List.scala:84)
              at kafka.controller.KafkaController$$anonfun$8.apply(KafkaController.scala:436)
              at kafka.controller.KafkaController$$anonfun$8.apply(KafkaController.scala:435)
              at scala.collection.TraversableLike$$anonfun$filterImpl$1.apply(TraversableLike.scala:248)
              at scala.collection.mutable.HashMap$$anonfun$foreach$1.apply(HashMap.scala:99)
              at scala.collection.mutable.HashMap$$anonfun$foreach$1.apply(HashMap.scala:99)
              at scala.collection.mutable.HashTable$class.foreachEntry(HashTable.scala:230)
              at scala.collection.mutable.HashMap.foreachEntry(HashMap.scala:40)
              at scala.collection.mutable.HashMap.foreach(HashMap.scala:99)
              at scala.collection.TraversableLike$class.filterImpl(TraversableLike.scala:247)
              at scala.collection.TraversableLike$class.filter(TraversableLike.scala:259)
              at scala.collection.AbstractTraversable.filter(Traversable.scala:104)
              at kafka.controller.KafkaController.onBrokerStartup(KafkaController.scala:435)
              at kafka.controller.ReplicaStateMachine$BrokerChangeListener$$anonfun$handleChildChange$1$$anonfun$apply$mcV$sp$1.apply$mcV$sp(ReplicaStateMachine.scala:374)
              at kafka.controller.ReplicaStateMachine$BrokerChangeListener$$anonfun$handleChildChange$1$$anonfun$apply$mcV$sp$1.apply(ReplicaStateMachine.scala:358)
              at kafka.controller.ReplicaStateMachine$BrokerChangeListener$$anonfun$handleChildChange$1$$anonfun$apply$mcV$sp$1.apply(ReplicaStateMachine.scala:358)
              at kafka.metrics.KafkaTimer.time(KafkaTimer.scala:33)
              at kafka.controller.ReplicaStateMachine$BrokerChangeListener$$anonfun$handleChildChange$1.apply$mcV$sp(ReplicaStateMachine.scala:357)
              at kafka.controller.ReplicaStateMachine$BrokerChangeListener$$anonfun$handleChildChange$1.apply(ReplicaStateMachine.scala:356)
              at kafka.controller.ReplicaStateMachine$BrokerChangeListener$$anonfun$handleChildChange$1.apply(ReplicaStateMachine.scala:356)
              at kafka.utils.CoreUtils$.inLock(CoreUtils.scala:234)
              at kafka.controller.ReplicaStateMachine$BrokerChangeListener.handleChildChange(ReplicaStateMachine.scala:355)
              at org.I0Itec.zkclient.ZkClient$10.run(ZkClient.java:843)
              at org.I0Itec.zkclient.ZkEventThread.run(ZkEventThread.java:71)
      

      Attachments

        Issue Links

          Activity

            People

              nickt Nick Travers
              nickt Nick Travers
              Ismael Juma Ismael Juma
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: