dajac commented on code in PR #12138:
URL: https://github.com/apache/kafka/pull/12138#discussion_r874491071
##########
core/src/main/scala/kafka/cluster/Partition.scala:
##########
@@ -578,7 +579,8 @@ class Partition(val topicPartition: TopicPartition,
// Updating the assignment and ISR state is safe if the partition epoch
is
// larger or equal to the current partition epoch.
updateAssignmentAndIsr(
- assignment = partitionState.replicas.asScala.map(_.toInt),
+ assignment = replicas,
+ followers = replicas.filter(_ != localBrokerId),
Review Comment:
Yeah, I debated this. I think that setting `followers` to `replicas` here
and doing the filtering in `updateAssignmentAndIsr` is semantically wrong. A
viable alternative would be to pass the `replicas` and an `isLeader` flag to
`updateAssignmentAndIsr`. That would allow `updateAssignmentAndIsr` to compute
the followers from the replicas when leader. I am not sure if it is really
better than the suggested approach. I don't feel strong either ways so I am
happy to go with your preferred approach.
##########
core/src/main/scala/kafka/cluster/Partition.scala:
##########
@@ -578,7 +579,8 @@ class Partition(val topicPartition: TopicPartition,
// Updating the assignment and ISR state is safe if the partition epoch
is
// larger or equal to the current partition epoch.
updateAssignmentAndIsr(
- assignment = partitionState.replicas.asScala.map(_.toInt),
+ assignment = replicas,
Review Comment:
That makes sense.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]