[ 
https://issues.apache.org/jira/browse/KAFKA-7124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16529073#comment-16529073
 ] 

Manikumar commented on KAFKA-7124:
----------------------------------

There is no issue with code. mentioned code generates "any" for each replica
 
The generated json file posted by OP is not generated by 
"ReassignPartitionsCommand --generate " command. 
It was generated by OP's custom code. 


> Number of AnyLogDir should match the length of the replicas list
> ----------------------------------------------------------------
>
>                 Key: KAFKA-7124
>                 URL: https://issues.apache.org/jira/browse/KAFKA-7124
>             Project: Kafka
>          Issue Type: Bug
>            Reporter: Ted Yu
>            Priority: Major
>
> See discussion under 'Partitions reassignment is failing in Kafka 1.1.0' 
> thread reported by Debraj Manna.
> Here is snippet from generated json file:
> {code}
> {"topic": "Topic3", "partition": 7, "log_dirs": ["any"], "replicas": [3, 0, 
> 2]}
> {code}
> Code snippet from ReassignPartitionsCommand.scala :
> {code}
>           "log_dirs" -> replicas.map(r => 
> replicaLogDirAssignment.getOrElse(new TopicPartitionReplica(tp.topic, 
> tp.partition, r), AnyLogDir)).asJava
> {code}
> We know that the appearance of "any" was due to the OrElse clause.
> There is a bug in the above code that the number of AnyLogDir should match 
> the length of the replicas list, or "log_dirs" should be omitted in such case.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to