KAFKA-15514: Metadata records Replicas->Assignment#14516
KAFKA-15514: Metadata records Replicas->Assignment#14516soarez wants to merge 2 commits intoapache:trunkfrom
Conversation
The new "Assignments" field replaces the "Replicas" field in PartitionRecord and PartitionChangeRecord.
| brokers: Array[Int], | ||
| listenerName: ListenerName, | ||
| filterUnavailableEndpoints: Boolean): java.util.List[Integer] = { | ||
| // TODO KAFKA-15362 |
There was a problem hiding this comment.
Do we know what the perf impact on metadata requests is by adding the logic of KAFKA-15362 here? Especially with the warning comment in L60 regard adding extra logic to KRaftMetadataCache.maybeFilterAliveReplicas.
| val assignments = partitions.asScala.map { case (partitionId, partition) => | ||
| new TopicPartition(topicName, partitionId) -> | ||
| ReplicaAssignment(partition.replicas, partition.addingReplicas, partition.removingReplicas) | ||
| ReplicaAssignment(partition.replicaBrokerIds(), partition.addingReplicas, partition.removingReplicas) |
There was a problem hiding this comment.
scala nit: It is usually recommended to not use empty parentheses in scala when a parameterless function has no side effect in both the definition of the function and when they call it (which is the case for partition.replicaBrokerIds).
| val underlying = clusterInstance.asInstanceOf[ZkClusterInstance].getUnderlying() | ||
| val zkClient = underlying.zkClient | ||
| val migrationClient = ZkMigrationClient(zkClient, PasswordEncoder.noop()) | ||
| val migrationClient = ZkMigrationClient(zkClient, PasswordEncoder.noop(), MetadataVersion.latest()) |
There was a problem hiding this comment.
nit: Same as replicaBrokerIds, MetadataVersion.latest has no side-effect so it should be called without empty parentheses.
|
I believe this test is failing due to some changes here https://ci-builds.apache.org/job/Kafka/job/kafka-pr/job/PR-14516/3/testReport/junit/kafka.zk.migration/ZkMigrationClientTest/Build___JDK_21_and_Scala_2_13___testUpdateExistingTopicWithNewAndChangedPartitions__/ . |
|
Closing this due to the change of plan in #14290 |
The new "Assignments" field replaces the "Replicas" field in PartitionRecord and PartitionChangeRecord.
Depends on #14290 - KAFKA-15355
Committer Checklist (excluded from commit message)