[ 
https://issues.apache.org/jira/browse/KAFKA-6612?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16391913#comment-16391913
 ] 

ASF GitHub Bot commented on KAFKA-6612:
---------------------------------------

gitlw opened a new pull request #4666: KAFKA-6612: Added logic to prevent 
increasing partition counts during topic deletion
URL: https://github.com/apache/kafka/pull/4666
 
 
   This patch adds logic in handling the PartitionModifications event, so that 
if the partition count is increased when a topic deletion is still in progress, 
the controller will restore the data of the path /brokers/topics/"topic" to 
remove the added partitions.
   
   Testing done:
   Added a new test method to cover the bug
   
   ### 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 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


> Added logic to prevent increasing partition counts during topic deletion
> ------------------------------------------------------------------------
>
>                 Key: KAFKA-6612
>                 URL: https://issues.apache.org/jira/browse/KAFKA-6612
>             Project: Kafka
>          Issue Type: Improvement
>            Reporter: Lucas Wang
>            Assignee: Lucas Wang
>            Priority: Major
>
> Problem: trying to increase the partition count of a topic while the topic 
> deletion is in progress can cause the topic to be never deleted.
> In the current code base, if a topic deletion is still in progress and the 
> partition count is increased,
> the new partition and its replica assignment be created on zookeeper as data 
> of the path /brokers/topics/<topic>.
> Upon detecting the change, the controller sees the topic is being deleted, 
> and therefore ignores the partition change. Therefore the zk path 
> /brokers/topics/<topic>/partitions/<partition id> will NOT be created.
> If a controller switch happens next, the added partition will be detected by 
> the new controller and stored in the 
> controllerContext.partitionReplicaAssignment. The new controller then tries 
> to delete the topic by first transitioning its replicas to OfflineReplica. 
> However the transition to OfflineReplica state will NOT succeed since there 
> is no leader for the partition. Since the only state change path for a 
> replica to be successfully deleted is OfflineReplica -> 
> ReplicaDeletionStarted -> ReplicaDeletionSuccessful, not being able to enter 
> the OfflineReplica state means the replica can never be successfully deleted.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to