[ https://issues.apache.org/jira/browse/KAFKA-8237?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16819624#comment-16819624 ]
ASF GitHub Bot commented on KAFKA-8237: --------------------------------------- hachikuji commented on pull request #6588: KAFKA-8237 [WIP]; Untangle TopicDeleteManager and add test cases URL: https://github.com/apache/kafka/pull/6588 The controller maintains a bunch of state across `ControllerContext`, `PartitionStateMachine`, `ReplicaStateMachine`, and `TopicDeletionManager`. None of this state is actually isolated from the rest. For example, topics undergoing deletion are intertwined with the partition and replica states. As a consequence of this, each of these components tends to be dependent on all the rest, which makes testing and reasoning about the system a nightmare. This is a first step toward untangling all the state. I have simply moved it all into `ControllerContext` and removed many of the circular dependencies. So far, this is mostly a direct translation, but in the future we can add additional validation in `ControllerContext` to make sure that state is maintained consistently. Additionally, I have created several mock objects to enable easier testing: `MockReplicaStateMachine` and `MockPartitionStateMachine`. These have simplified logic for updating the current state. This is used to create some new test cases for `TopicDeletionManager`. I found that I had to change the valid previous state of `ReplicaDeletionIneligible` to include `OfflineReplica` to get the new tests to pass, but please make sure there is not a bug in the test case. ### Committer Checklist (excluded from commit message) - [ ] Verify design and implementation - [ ] Verify test coverage and CI build status - [ ] Verify documentation (including upgrade notes) ---------------------------------------------------------------- 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 > Untangle TopicDeletionManager and add test cases > ------------------------------------------------ > > Key: KAFKA-8237 > URL: https://issues.apache.org/jira/browse/KAFKA-8237 > Project: Kafka > Issue Type: Improvement > Reporter: Jason Gustafson > Assignee: Jason Gustafson > Priority: Major > > There are a few circular dependencies involving `TopicDeletionManager`. For > example, both `PartitionStateMachine` and `ReplicaStateMachine` depend on > `TopicDeletionManager` while it also depends on them. This makes testing > difficult and so there are no unit tests. We should fix this. -- This message was sent by Atlassian JIRA (v7.6.3#76005)