jolshan commented on a change in pull request #10282: URL: https://github.com/apache/kafka/pull/10282#discussion_r593362414
########## File path: core/src/main/scala/kafka/cluster/Partition.scala ########## @@ -425,36 +425,35 @@ class Partition(val topicPartition: TopicPartition, } /** - * Checks if the topic ID provided in the request is consistent with the topic ID in the log. + * Checks if the topic ID received is consistent with the topic ID in the log. * If a valid topic ID is provided, and the log exists but has no ID set, set the log ID to be the request ID. * - * @param requestTopicId the topic ID from the request - * @return true if the request topic id is consistent, false otherwise + * @param receivedTopicId the topic ID from the LeaderAndIsr request or from the metadata records + * @return true if the received topic id is consistent, false otherwise */ - def checkOrSetTopicId(requestTopicId: Uuid): Boolean = { - // If the request had an invalid topic ID, then we assume that topic IDs are not supported. - // The topic ID was not inconsistent, so return true. - // If the log is empty, then we can not say that topic ID is inconsistent, so return true. - if (requestTopicId == null || requestTopicId == Uuid.ZERO_UUID) - true - else { + def checkOrSetTopicId(receivedTopicId: Uuid, usingRaft: Boolean): Boolean = { Review comment: Hmmm I'm not a huge fan of this either since it also seems to be waiting to set the ID and it adds complexity to recovery. I'll take another look. Maybe I'm missing something. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org