OmniaGM commented on code in PR #14881: URL: https://github.com/apache/kafka/pull/14881#discussion_r1420746154
########## core/src/main/scala/kafka/server/ReplicaManager.scala: ########## @@ -2626,8 +2601,16 @@ class ReplicaManager(val config: KafkaConfig, localLeaders.forKeyValue { (tp, info) => getOrCreatePartition(tp, delta, info.topicId).foreach { case (partition, isNew) => try { + val partitionDirectoryId: Option[Uuid] = + Option(newImage.topics().getPartition(info.topicId(), partition.partitionId)).map(_.directory(localBrokerId)) + val state = info.partition.toLeaderAndIsrPartitionState(tp, isNew) - partition.makeLeader(state, offsetCheckpoints, Some(info.topicId)) + partition.makeLeader(state, offsetCheckpoints, Some(info.topicId), partitionDirectoryId) + + if (!delta.localChanges(localBrokerId).directoryIds().isEmpty) { + maybeUpdateTopicAssignment(partition, partitionDirectoryId) + } Review Comment: We need to update the assignment with the actual directory ID of the partition created at the end not with `directoryIds`. This info is available in `Partition` (not `TopicPartition`) which we don't have at this point. -- 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: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org