BewareMyPower edited a comment on pull request #9342:
URL: https://github.com/apache/pulsar/pull/9342#issuecomment-768697191
@zymap You're right for the 1st issue. It only affects my tests code:
```java
final String partitionName =
TopicName.get(topicName).getPartition(0).toString();
try {
persistentTopics.createNonPartitionedTopic(testTenant,
testNamespace, partitionName, false);
```
I should use the local name in tests instead of in the `validateTopicName`.
For the 2nd issue, the intention for creating non-partitioned topic with
`-partition-` suffix is to create missed partitions. So you should first create
a partitioned topic.
Here's an example:
```bash
# 1. A partition was somehow deleted or not created successfully
$ ./bin/pulsar-admin topics create-partitioned-topic xyz -p 3
$ ./bin/pulsar-admin topics delete xyz-partition-0
$ ./bin/pulsar-admin topics list public/default
"persistent://public/default/xyz-partition-2"
"persistent://public/default/xyz-partition-1"
# 2. Then we can create a non-partitioned topic to create missed partitions
$ ./bin/pulsar-admin topics create xyz-partition-0
$ ./bin/pulsar-admin topics list public/default
"persistent://public/default/xyz-partition-2"
"persistent://public/default/xyz-partition-0"
"persistent://public/default/xyz-partition-1"
# 3. However, if you create a existed partition, there's no error, this is
what I want to fix
$ ./bin/pulsar-admin topics create xyz-partition-2
```
The rule is from https://github.com/apache/pulsar/pull/5148.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]