Rancho-7 commented on code in PR #19966:
URL: https://github.com/apache/kafka/pull/19966#discussion_r2148955476


##########
core/src/test/scala/unit/kafka/server/ReplicaManagerTest.scala:
##########
@@ -1181,68 +1149,6 @@ class ReplicaManagerTest {
       val fetch1 = successfulFetch.headOption.filter(_._1 == 
inconsistentTidp).map(_._2)
       assertTrue(fetch1.isDefined)
       assertEquals(Errors.INCONSISTENT_TOPIC_ID, fetch1.get.error)
-
-      // Simulate where the fetch request did not use topic IDs
-      // Fetch messages simulating an ID in the log.
-      // We should not see topic ID errors.
-      val zeroTidp = new TopicIdPartition(Uuid.ZERO_UUID, tidp.topicPartition)
-      fetchPartitions(
-        replicaManager,
-        replicaId = 1,
-        fetchInfos = Seq(zeroTidp -> validFetchPartitionData),
-        responseCallback = callback
-      )
-      val fetch2 = successfulFetch.headOption.filter(_._1 == 
zeroTidp).map(_._2)
-      assertTrue(fetch2.isDefined)
-      assertEquals(Errors.NONE, fetch2.get.error)
-
-      // Next create a topic without a topic ID written in the log.
-      val tp2 = new TopicPartition("noIdTopic", 0)
-      val tidp2 = new TopicIdPartition(Uuid.randomUuid(), tp2)
-
-      // Broker 0 becomes leader of the partition
-      val leaderAndIsrPartitionState2 = new 
LeaderAndIsrRequest.PartitionState()
-        .setTopicName("noIdTopic")
-        .setPartitionIndex(0)
-        .setControllerEpoch(0)
-        .setLeader(0)
-        .setLeaderEpoch(leaderEpoch)
-        .setIsr(replicas)
-        .setPartitionEpoch(0)
-        .setReplicas(replicas)
-        .setIsNew(true)
-      val leaderAndIsrRequest2 = new LeaderAndIsrRequest.Builder(0, 0, 
brokerEpoch,
-        Seq(leaderAndIsrPartitionState2).asJava,
-        Collections.emptyMap(),
-        Set(new Node(0, "host1", 0), new Node(1, "host2", 1)).asJava).build()
-      val leaderAndIsrResponse2 = replicaManager.becomeLeaderOrFollower(0, 
leaderAndIsrRequest2, (_, _) => ())
-      assertEquals(Errors.NONE, leaderAndIsrResponse2.error)
-
-      assertEquals(None, replicaManager.getPartitionOrException(tp2).topicId)
-
-      // Fetch messages simulating the request containing a topic ID. We 
should not have an error.

Review Comment:
   Thanks for the suggestion. I will keep this.



-- 
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

Reply via email to