Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-6612

Added logic to prevent increasing partition counts during topic deletion

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • None
    • None
    • None

    Description

      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.

      Attachments

        Activity

          People

            luwang Lucas Wang
            luwang Lucas Wang
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: