lbradstreet commented on a change in pull request #11376:
URL: https://github.com/apache/kafka/pull/11376#discussion_r800202601
##########
File path:
core/src/test/scala/unit/kafka/controller/ReplicaStateMachineTest.scala
##########
@@ -394,6 +394,23 @@ class ReplicaStateMachineTest {
}
@Test
+ def testInvalidOnlineReplicaTransitionWithQueuedDeletion(): Unit = {
+ controllerContext.putReplicaState(replica, ReplicaDeletionIneligible)
+ controllerContext.updatePartitionFullReplicaAssignment(partition,
ReplicaAssignment(Seq(brokerId)))
+ val leaderIsrAndControllerEpoch =
LeaderIsrAndControllerEpoch(LeaderAndIsr(brokerId, List(brokerId)),
controllerEpoch)
+ controllerContext.putPartitionLeadershipInfo(partition,
leaderIsrAndControllerEpoch)
+ EasyMock.expect(mockControllerBrokerRequestBatch.newBatch())
+
EasyMock.expect(mockControllerBrokerRequestBatch.sendRequestsToBrokers(controllerEpoch))
+ EasyMock.replay(mockZkClient, mockControllerBrokerRequestBatch)
+ controllerContext.queueTopicDeletion(Set(replica.topic))
+ controllerContext.putReplicaState(replica, OnlineReplica)
+ // we don't expect addLeaderAndIsrRequestForBrokers to be called for this
partition
+ replicaStateMachine.handleStateChanges(replicas, OnlineReplica)
+ EasyMock.verify(mockZkClient, mockControllerBrokerRequestBatch)
+ assertEquals(OnlineReplica, replicaState(replica))
Review comment:
Makes sense, well noticed.
--
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]