ijuma commented on code in PR #18497:
URL: https://github.com/apache/kafka/pull/18497#discussion_r1921654536
##########
core/src/test/scala/unit/kafka/server/ReplicaManagerTest.scala:
##########
@@ -2689,157 +2680,6 @@ class ReplicaManagerTest {
}
}
- @Test
- def testFullLeaderAndIsrStrayPartitions(): Unit = {
- val logManager = TestUtils.createLogManager(config.logDirs.map(new
File(_)), defaultConfig = new LogConfig(new Properties()), time = time)
- val quotaManager = QuotaFactory.instantiate(config, metrics, time, "")
- val replicaManager = new ReplicaManager(
- metrics = metrics,
- config = config,
- time = time,
- scheduler = time.scheduler,
- logManager = logManager,
- quotaManagers = quotaManager,
- metadataCache = MetadataCache.kRaftMetadataCache(config.brokerId, () =>
KRaftVersion.KRAFT_VERSION_0),
- logDirFailureChannel = new LogDirFailureChannel(config.logDirs.size),
- alterPartitionManager = alterPartitionManager,
- threadNamePrefix = Option(this.getClass.getName))
-
- try {
-
- logManager.startup(Set.empty[String])
-
- // Create a hosted topic, a hosted topic that will become stray
- createHostedLogs("hosted-topic", numLogs = 2, replicaManager).toSet
- createHostedLogs("hosted-stray", numLogs = 10, replicaManager).toSet
-
- val lisr = new
LeaderAndIsrRequest.Builder(ApiKeys.LEADER_AND_ISR.latestVersion,
- 3000, 0, brokerEpoch,
- Seq(
- new LeaderAndIsrPartitionState()
- .setTopicName("hosted-topic")
- .setPartitionIndex(0)
- .setControllerEpoch(controllerEpoch)
- .setLeader(0)
- .setLeaderEpoch(10)
- .setIsr(Seq[Integer](0, 1).asJava)
- .setPartitionEpoch(0)
- .setReplicas(Seq[Integer](0, 1).asJava)
- .setIsNew(false),
- new LeaderAndIsrPartitionState()
- .setTopicName("hosted-topic")
- .setPartitionIndex(1)
- .setControllerEpoch(controllerEpoch)
- .setLeader(1)
- .setLeaderEpoch(10)
- .setIsr(Seq[Integer](1, 0).asJava)
- .setPartitionEpoch(0)
- .setReplicas(Seq[Integer](1, 0).asJava)
- .setIsNew(false)
- ).asJava,
- topicIds.asJava,
- Set(new Node(0, "host0", 0), new Node(1, "host1", 1)).asJava,
- true,
- AbstractControlRequest.Type.FULL
- ).build()
-
- replicaManager.becomeLeaderOrFollower(0, lisr, (_, _) => ())
-
- val ht0 = replicaManager.getPartition(new TopicPartition("hosted-topic",
0))
- assertTrue(ht0.isInstanceOf[HostedPartition.Online])
-
- val stray0 = replicaManager.getPartition(new
TopicPartition("hosted-stray", 0))
-
- assertTrue(stray0.isInstanceOf[HostedPartition.Online])
- } finally {
- Utils.tryAll(util.Arrays.asList[Callable[Void]] (
- () => {
- replicaManager.shutdown(checkpointHW = false)
- null
- },
- () => {
- logManager.shutdown()
- null
- },
- () => {
- quotaManager.shutdown()
- null
- }
- ))
- }
- }
-
- @Test
- def testUpdateStrayLogs(): Unit = {
Review Comment:
`ReplicaManager.updateStrayLogs` was deleted and hence this method is no
longer needed. @cmccabe @jsancio Can you please confirm that we have tests for
the kraft flow of stray log management?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]