hachikuji commented on a change in pull request #11665:
URL: https://github.com/apache/kafka/pull/11665#discussion_r788276315



##########
File path: core/src/test/scala/unit/kafka/server/ReplicaManagerTest.scala
##########
@@ -3541,7 +3541,14 @@ class ReplicaManagerTest {
     val version = if (usesTopicIds) 
LeaderAndIsrRequestData.HIGHEST_SUPPORTED_VERSION else 4.toShort
     val topicId = if (usesTopicIds) this.topicId else Uuid.ZERO_UUID
     val topicIdOpt = if (usesTopicIds) Some(topicId) else None
-    val replicaManager = setupReplicaManagerWithMockedPurgatories(new 
MockTimer(time))
+
+    // We use a low `replica.fetch.max.bytes` in order to have multiple fetch
+    // requests issued by the ReplicaAlterLogDirsThread.
+    val replicaManager = setupReplicaManagerWithMockedPurgatories(
+      new MockTimer(time),
+      propsModifier = props => props.put(KafkaConfig.ReplicaFetchMaxBytesProp, 
"1")

Review comment:
       I am not sure I understand the issue. Was the problem that the copy was 
completing before the failing assertion? Is this intended to slow down the 
fetcher?

##########
File path: core/src/test/scala/unit/kafka/server/ReplicaManagerTest.scala
##########
@@ -3569,12 +3576,13 @@ class ReplicaManagerTest {
       assertEquals(0, 
replicaManager.replicaAlterLogDirsManager.fetcherThreadMap.size)
       replicaManager.alterReplicaLogDirs(Map(topicPartition -> 
newReplicaFolder.getAbsolutePath))
 
-      assertFetcherHasTopicId(replicaManager.replicaAlterLogDirsManager, 
partition.topicPartition, topicIdOpt)
-
       // Make sure the future log is created.
       replicaManager.futureLocalLogOrException(topicPartition)
       assertEquals(1, 
replicaManager.replicaAlterLogDirsManager.fetcherThreadMap.size)
 
+      // Verify that the fetcher has the correct topic id.
+      assertFetcherHasTopicId(replicaManager.replicaAlterLogDirsManager, 
partition.topicPartition, topicIdOpt)

Review comment:
       It's a slightly strange validation at this level. I guess we're 
verifying the propagation of the topicId to the log dir fetcher? It seems like 
the main thing we'd want to verify is that the new log gets created with the 
right topicId. 




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