This topic describes the causes of and solutions to the issue that the number of partitions cannot be reduced after an ApsaraMQ for Kafka topic is deleted.
Problem description
If you delete a topic with n partitions and recreate the topic with a partition count smaller than n, the system displays a message. The message indicates that the topic is created but the partition count cannot be smaller than the previously configured number, so the partition count is reset to n.
Possible causes
When a topic is deleted from an instance of an earlier version, the routing information of the topic is not fully cleared. As a result, you cannot create a topic with a smaller number of partitions than the deleted topic. After the instance is upgraded to the latest version, the routing information of the topic deleted before the upgrade is retained. To fully clear the routing information, create a topic with the same configurations as the previously deleted topic, delete the new topic, and then recreate the topic. After the whole process is complete, you can specify the partition count for the topic.
Solutions
Make sure that the instance is of the latest minor version.
Log on to the ApsaraMQ for Kafka console and go to the Instance Details page. In the Basic Information section of the Instance Information tab, view the value of the Minor Version parameter to determine whether the instance is of the latest minor version.
If Latest Version is displayed, you do not need to upgrade the version.
If Minor Version Update is displayed, click Minor Version Update to upgrade the minor version of the instance.
Create a topic with the same configurations as the previously deleted topic, delete the new topic, and then recreate the topic.
Go to the Topics page, create a topic with the same configurations as the previously deleted topic, delete the new topic, and then recreate the topic.