All Products
Search
Document Center

When recreating a deleted Topic in a Message Queue for Apache Kafka instance, the system prompts that the number of partitions must be no less than the number of previously configured partitions

Last Updated: Sep 25, 2020

Problem description

In a Message Queue for Apache Kafka instance, you can recreate the Topic that you deleted, and the number of partitions is smaller than the number of partitions configured in the previous creation. The following message is displayed.

The topic is created. The number of partitions cannot be less than the number of the previously configured partitions. The topic is reset to XX.

Causes

When you delete a Topic, the routing information of the Topic is not completely cleared. As a result, the number of partitions cannot be reduced when the Topic is re-created.

Solution

Alibaba Cloud reminds you that:

  • When you perform operations that have risks, such as modifying instance configurations or data, check the disaster recovery and fault tolerance capabilities of the instances to ensure data security.
  • Before you modify the configurations and data of instances including but not limited to ECS and RDS instances, we recommend that you create snapshots or enable RDS log backup.
  • If you have authorized or submitted sensitive information such as the logon account and password in the Alibaba Cloud Management Console, we recommend that you modify such information in a timely manner.

Upgrade the Message Queue for Apache Kafka instance to the latest version,  then recreate the Topic or delete the Topic to clear its route information. After the process is completed, create the Topic again, and you can freely specify the number of partitions. Follow these steps:

  1. Login Message Queue for Apache Kafka console.
  2. In the left-side navigation pane, choose overview.
  3. Click an instance ID, details button.
  4. In instance details page, view the minor version information.
    • Non-Latest version
      Upgrade the Kafka instance to the latest version. For more information, see upgrade the instance service version.
    • Latest Version
      Please proceed to the next step.
  5. In the left-side navigation pane, click Topics.
  6. Re-create the previously deleted Topic, and then delete the Topic again.
  7. After the preceding operations, you can create the Topic and specify the number of partitions.

Application scope

  • Message Queue for Apache Kafka