[
https://issues.apache.org/jira/browse/KAFKA-510?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13470437#comment-13470437
]
Jun Rao commented on KAFKA-510:
-------------------------------
Thanks for the patch. A few more comments:
30. KafkaApis: The following code can be made clearer if we use
leaderAndISRRequest.leaderAndISRInfos.foreach{ case
leaderAndISRRequest.leaderAndISRInfos.foreach(
{
m =>
replicaManager.replicationFactorForPartitions.put(TopicAndPartition(m._1._1,
m._1._2), m._2.replicationFactor)
})
31. ReplicaManager: Instead of putting the replication factor in
ReplicaManager, it's more natural to put it in Partition directly. We need to
make sure that we can provide the replication factor when a Partition is
created. A partition should really only be created when processing a makeLeader
or makeFollower request (in both cases we the the replication factor). There
are 2 other places that we call getOrCreatePartition. However, both can be
changed to a getPartition method instead. The first place is in
ReplicaManager.recordFollowerPosition. We can change it so that if a partition
is none, we skip the call to updateLeaderHWAndMaybeExpandISR and log a warning.
The second place is in DelayedProduce.isSatisfied(). We can also change it so
that if a partition is none, we simply set the errorCode to
UnknownTopicOrPartition. Finally, we can add a utility method in ReplicaManager
to be used in KafkaApi to check the replication factor of one or more
partitions.
32. LeaderAndIsr: The value of the leaderAndIsr path in ZK doesn't need to
include replication factor. We could add a method toZKString in LeaderAndIsr to
get the value that we want to write to ZK.
> broker needs to know the replication factor per partition
> ---------------------------------------------------------
>
> Key: KAFKA-510
> URL: https://issues.apache.org/jira/browse/KAFKA-510
> Project: Kafka
> Issue Type: Bug
> Components: core
> Reporter: Jun Rao
> Assignee: Yang Ye
> Priority: Blocker
> Labels: bugs
> Fix For: 0.8
>
> Attachments: kafka_510_v1.diff, kafka_510_v2.diff, kafka_510_v3.diff
>
> Original Estimate: 24h
> Remaining Estimate: 24h
>
> A broker needs to know the replication factor to report under replicated
> partitions.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira