All Products
Search
Document Center

:When you recreate a deleted topic in a Message Queue for Apache Kafka instance, the system prompts "The number of partitions cannot be less than the number of partitions that have been configured."

Last Updated:Jul 13, 2022

Problem description

In the Message Queue for Apache Kafka instance, the deleted topics are recreated and the number of partitions is less than the number of partitions that you specified when you created them last time. The following message is displayed.

The topic is created. The number of partitions cannot be less than the number of partitions that have been configured before. The value has been reset to XX. 

Causes

When you delete a topic of a previous version of a Message Queue for Apache Kafka instance, the route information of the topic is not completely cleared. As a result, the number of partitions cannot be reduced when you recreate the topic.

Solutions

Take note of the following items:

  • Before you perform high-risk operations such as modifying the configurations or data of Alibaba Cloud instances, we recommend that you check the disaster recovery and fault tolerance capabilities of the instance to ensure data security.
  • Before you modify the specifications or data of an Alibaba Cloud instance, such as an Elastic Compute Service (ECS) instance or an ApsaraDB RDS instance, we recommend that you create snapshots or enable backups for the instance. For example, you can enable log backups for an ApsaraDB RDS instance.
  • If you have granted specific users the permissions on sensitive information, such as usernames and passwords, or submitted sensitive information in the Alibaba Cloud Management Console, we recommend that you modify the sensitive information at the earliest opportunity.

Upgrade the Message Queue for Apache Kafka instance to the latest version, and then perform the process of recreating a topic and deleting a topic again to completely clear the route information of the topic. After you complete the process, create the topic again to specify the number of partitions. Perform the following steps:

  1. Log on to the Message Queue for Apache Kafka console.
  2. In the left-side navigation pane, click Overview.
  3. Click Details of the target instance.
  4. On the Instance Details page, view the Minor Version of the instance.
    • If it is not the latest version, upgrade the Message Queue for Apache Kafka instance to the latest version. For more information, see Upgrade the instance service version.
    • Continue to the next step for the latest version.
  5. In the left-side navigation pane, click Topics.
  6. Recreate the previously deleted topic, and then delete the topic again. After the topic is deleted, wait for more than 1 minute (to prevent cache).
  7. After you complete the preceding operations, you can create the topic and re-specify the number of partitions.

Ideal For

  • Message Queue for Apache Kafka