Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(metadata): clean up the consumption offset for the deleted partitions #1265

Merged
merged 1 commit into from
May 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions core/src/main/scala/kafka/server/ReplicaManager.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2724,6 +2724,19 @@ class ReplicaManager(val config: KafkaConfig,

doPartitionDeletion()

// Clean up the consumption offset for the deleted partitions that do not belong to the current broker.
delta.deletedTopicIds().forEach { id =>
val topicImage = delta.image().getTopic(id)
topicImage.partitions().entrySet().forEach { entry => {
val partitionId = entry.getKey
val partition = entry.getValue
if (partition.leader != config.nodeId) {
callback(new TopicPartition(topicImage.name(), partitionId))
}
}
}
}

}

// Handle partitions which we are now the leader or follower for.
Expand Down
Loading