[fix][broker] Don't allow creating a non-persistent partitioned topic with '-partition-' in name
Motivation
Currently, we can create a non-persistent partition topic contain -partition-. However, we cannot use it as a normal non-persistent partition topic. For example, when we use the partitioned-stats command, we will encounter errors.
Partitioned Topic Name should not contain '-partition-' Reason: Partitioned Topic Name should not contain '-partition-'
Modifications
We should disable the creation of non-persistent partition topics contain -partition-.
Documentation
Verifying this change
All unit tests passed, not have any behavior change.
- [ ]
doc - [ ]
doc-required - [x]
doc-not-needed - [ ]
doc-complete
Thanks for the contribution, @hanmz. Would you be able to add a test case to cover this change?
Thanks for the contribution, @hanmz. Would you be able to add a test case to cover this change?
OK, I've added a test case.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 40.75%. Comparing base (
bbc6224) to head (fbe1f32). Report is 793 commits behind head on master.
:exclamation: There is a different number of reports uploaded between BASE (bbc6224) and HEAD (fbe1f32). Click for more details.
HEAD has 1 upload less than BASE
Flag BASE (bbc6224) HEAD (fbe1f32) unittests 2 1
Additional details and impacted files
@@ Coverage Diff @@
## master #23488 +/- ##
=============================================
- Coverage 73.57% 40.75% -32.83%
+ Complexity 32624 1417 -31207
=============================================
Files 1877 1805 -72
Lines 139502 148024 +8522
Branches 15299 17116 +1817
=============================================
- Hits 102638 60322 -42316
- Misses 28908 80090 +51182
+ Partials 7956 7612 -344
| Flag | Coverage Δ | |
|---|---|---|
| inttests | 27.24% <100.00%> (+2.66%) |
:arrow_up: |
| systests | 24.34% <0.00%> (+0.01%) |
:arrow_up: |
| unittests | 36.03% <100.00%> (-36.81%) |
:arrow_down: |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Files with missing lines | Coverage Δ | |
|---|---|---|
| ...he/pulsar/broker/admin/v2/NonPersistentTopics.java | 29.20% <100.00%> (-32.27%) |
:arrow_down: |
Closing and reopening to trigger a new CI run
/pulsarbot rerun-failure-checks
reopen to trigger ci