Skip to content

[Bug] Unreasonable partitioned topic creation.  #19085

@mattisonchao

Description

@mattisonchao

Search before asking

  • I searched in the issues and found nothing similar.

Version

All versions.

Minimal reproduce step

final String topicName = "non-persistent://public/default/test";
admin.topics().createPartitionedTopic(topicName, 4);
TopicName partition = TopicName.get(topicName).getPartition(4);
@Cleanup
Producer<byte[]> producer = pulsarClient.newProducer()
          .topic(partition.toString())
          .create();

What did you expect to see?

The non-existent partition shouldn't be created.

"persistent://public/default/test-partition-0"
"persistent://public/default/test-partition-3"
"persistent://public/default/test-partition-2"
"persistent://public/default/test-partition-1"

{
"partitions" : 4
}

What did you see instead?

The non-existent partition creates success.

"persistent://public/default/test-partition-0"
"persistent://public/default/test-partition-4"
"persistent://public/default/test-partition-3"
"persistent://public/default/test-partition-2"
"persistent://public/default/test-partition-1"

{
"partitions" : 4
}

Anything else?

nah.

Are you willing to submit a PR?

  • I'm willing to submit a PR!

Metadata

Metadata

Assignees

Labels

type/bugThe PR fixed a bug or issue reported a bug

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions