[ https://issues.apache.org/jira/browse/KAFKA-3219?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15137981#comment-15137981 ]
Vahid Hashemian commented on KAFKA-3219: ---------------------------------------- This seems to be somehow related to folder name length limit which is 255. When creating a topic a folder is created for each of its partitions under the {{kafka-logs}} folder. The name of these folders is the topic name appended by a dash {{-}}, appended by partition id (a number starting from 0). For a given topic name of 254, these folder names will be at least 256 characters long. Even though the topic is created no folder is created for partitions whose folder name length goes above 255. With a topic name of 253 characters long and 11 partitions the same issue occurs because for partition id 10 the folder would not be created. A potential fix would be to check for the combination of topic name and partition count and disallow combinations that lead to one or more partition folder names of 256 or more characters. Suggestions are welcome. > Long topic names mess up broker topic state > ------------------------------------------- > > Key: KAFKA-3219 > URL: https://issues.apache.org/jira/browse/KAFKA-3219 > Project: Kafka > Issue Type: Bug > Affects Versions: 0.9.0.0 > Reporter: Magnus Edenhill > Assignee: Vahid Hashemian > > Seems like the broker doesn't like topic names of 254 chars or more when > creating using kafka-topics.sh --create. > The problem does not seem to arise when topic is created through automatic > topic creation. > How to reproduce: > {code} > TOPIC=$(printf 'd%.0s' {1..254} ) ; bin/kafka-topics.sh --zookeeper 0 > --create --topic $TOPIC --partitions 1 --replication-factor 1 > {code} > {code} > [2016-02-06 22:00:01,943] INFO [ReplicaFetcherManager on broker 3] Removed > fetcher for partitions > [dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd,0] > (kafka.server.ReplicaFetcherManager) > [2016-02-06 22:00:01,944] ERROR [KafkaApi-3] Error when handling request > {controller_id=3,controller_epoch=12,partition_states=[{topic=dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd,partition=0,controller_epoch=12,leader=3,leader_epoch=0,isr=[3],zk_version=0,replicas=[3]}],live_leaders=[{id=3,host=eden,port=9093}]} > (kafka.server.KafkaApis) > java.lang.NullPointerException > at > scala.collection.mutable.ArrayOps$ofRef$.length$extension(ArrayOps.scala:114) > at scala.collection.mutable.ArrayOps$ofRef.length(ArrayOps.scala:114) > at > scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:32) > at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:108) > at > scala.collection.TraversableLike$WithFilter.foreach(TraversableLike.scala:771) > at kafka.log.Log.loadSegments(Log.scala:138) > at kafka.log.Log.<init>(Log.scala:92) > at kafka.log.LogManager.createLog(LogManager.scala:357) > at kafka.cluster.Partition.getOrCreateReplica(Partition.scala:96) > at > kafka.cluster.Partition$$anonfun$4$$anonfun$apply$2.apply(Partition.scala:176) > at > kafka.cluster.Partition$$anonfun$4$$anonfun$apply$2.apply(Partition.scala:176) > at scala.collection.mutable.HashSet.foreach(HashSet.scala:79) > at kafka.cluster.Partition$$anonfun$4.apply(Partition.scala:176) > at kafka.cluster.Partition$$anonfun$4.apply(Partition.scala:170) > at kafka.utils.CoreUtils$.inLock(CoreUtils.scala:259) > at kafka.utils.CoreUtils$.inWriteLock(CoreUtils.scala:267) > at kafka.cluster.Partition.makeLeader(Partition.scala:170) > at > kafka.server.ReplicaManager$$anonfun$makeLeaders$4.apply(ReplicaManager.scala:696) > at > kafka.server.ReplicaManager$$anonfun$makeLeaders$4.apply(ReplicaManager.scala:695) > at > scala.collection.mutable.HashMap$$anonfun$foreach$1.apply(HashMap.scala:98) > at > scala.collection.mutable.HashMap$$anonfun$foreach$1.apply(HashMap.scala:98) > at > scala.collection.mutable.HashTable$class.foreachEntry(HashTable.scala:226) > at scala.collection.mutable.HashMap.foreachEntry(HashMap.scala:39) > at scala.collection.mutable.HashMap.foreach(HashMap.scala:98) > at kafka.server.ReplicaManager.makeLeaders(ReplicaManager.scala:695) > at > kafka.server.ReplicaManager.becomeLeaderOrFollower(ReplicaManager.scala:641) > at > kafka.server.KafkaApis.handleLeaderAndIsrRequest(KafkaApis.scala:142) > at kafka.server.KafkaApis.handle(KafkaApis.scala:79) > at kafka.server.KafkaRequestHandler.run(KafkaRequestHandler.scala:60) > at java.lang.Thread.run(Thread.java:745) > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)