mimaison commented on code in PR #19762: URL: https://github.com/apache/kafka/pull/19762#discussion_r2240803280
########## metadata/src/main/java/org/apache/kafka/image/TopicsImage.java: ########## @@ -119,4 +127,40 @@ public Map<Uuid, String> topicIdToNameView() { public String toString() { return new TopicsImageByNameNode(this).stringify(); } + + /** + * Returns true if the given topic partition should not be on the current broker according to the metadata image. + * + * @param newTopicsImage The new topics image after broker has been reloaded + * @param brokerId The ID of the current broker. + * @param topicId The topic ID + * @param partitionId The partition ID + * @param log The log + * @return true if the topic partition should not exist on the broker, false otherwise. + */ + public static boolean isStrayReplica(TopicsImage newTopicsImage, int brokerId, Optional<Uuid> topicId, int partitionId, String log) { Review Comment: It was static mostly for historical reasons as I just copied it from `LogManager` but you're right since the first argument is a `TopicsImage` the new method I added is now not static. -- 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