[
https://issues.apache.org/jira/browse/KAFKA-2146?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14539476#comment-14539476
]
chenshangan commented on KAFKA-2146:
------------------------------------
[~guozhang] It's ok.
For #2 I totally agree, it's better to pick the next available broker than pick
a random one.
But for #1, I think we do not need to process as function
#assignReplicasToBrokers will help us to deal with it as following
{code}
val firstReplicaIndex = (currentPartitionId + startIndex) % brokerList.size
{code}
And starting index has its own definition in function #assignReplicasToBrokers,
if you use the LAST partition, you need to change the logic of this function,
and this modification will gain nothing.
If we get agreed, I will update the patch.
I have another task KAFKA-2106, I think it's a big headache for users of kafka.
My current solution is a workaround, but not well distributed , hope for some
comment on that.
> adding partition did not find the correct startIndex
> -----------------------------------------------------
>
> Key: KAFKA-2146
> URL: https://issues.apache.org/jira/browse/KAFKA-2146
> Project: Kafka
> Issue Type: Bug
> Components: admin
> Affects Versions: 0.8.2.0
> Reporter: chenshangan
> Priority: Minor
> Fix For: 0.8.3
>
> Attachments: KAFKA-2146.patch
>
>
> TopicCommand provide a tool to add partitions for existing topics. It try to
> find the startIndex from existing partitions. There's a minor flaw in this
> process, it try to use the first partition fetched from zookeeper as the
> start partition, and use the first replica id in this partition as the
> startIndex.
> One thing, the first partition fetched from zookeeper is not necessary to be
> the start partition. As partition id begin from zero, we should use partition
> with id zero as the start partition.
> The other, broker id does not necessary begin from 0, so the startIndex is
> not necessary to be the first replica id in the start partition.
>
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)