When you delete an ApsaraMQ for Kafka topic and recreate it with fewer partitions, the system may reset the partition count to the original value with a message like: "The topic is created but the partition count cannot be smaller than the previously configured number."
This happens because older instance versions do not fully clear a topic's routing information upon deletion. The stale metadata persists even after you upgrade the instance to the latest version, which prevents you from specifying a smaller partition count for the recreated topic.
Apache Kafka supports increasing partition counts but not decreasing them. To use a different count, you must delete and recreate the topic. The issue described here is specific to older ApsaraMQ for Kafka instance versions, where stale routing metadata blocks this delete-and-recreate workflow.
Solution
To clear the stale routing metadata and regain control over the partition count, complete these two steps in order.
Step 1: Update to the latest minor version
Log on to the ApsaraMQ for Kafka console.
Open the Instance Details page for your instance.
On the Instance Information tab, check the Minor Version field in the Basic Information section.
If You are on the latest minor version. is displayed, skip to Step 2.
If Minor Version Update is displayed, click Minor Version Update to upgrade.
Step 2: Clear stale routing metadata
After the instance runs the latest minor version, clear the leftover routing information by recreating the topic:
Go to the Topics page.
Create a topic with the same configuration (name, partition count, and other settings) as the previously deleted topic.
Delete this newly created topic.
Create the topic again with your desired partition count.
Deleting and recreating a topic removes all stored messages. Make sure consumers have finished processing all messages before you proceed. After recreation, consumers must reconnect and will start from the earliest available offset.
Verify the result
On the Topics page, confirm that the partition count matches the value you specified.
How to avoid this issue
Plan your partition count for expected future throughput. Apache Kafka does not support reducing partitions on an existing topic, so choosing an appropriate count upfront avoids the need for this workaround later.