[fix][broker] Reject create non-existent persistent partitions#19086
Conversation
liangyepianzhou
left a comment
There was a problem hiding this comment.
Maybe we should change this to
return metadata.orElseGet(() -> new PartitionedTopicMetadata(-1));
There was a problem hiding this comment.
without this change, the test also can pass @mattisonchao
this line has already guaranteed can't create partition-4 topic.
Codecov Report
@@ Coverage Diff @@
## master #19086 +/- ##
============================================
- Coverage 47.46% 46.27% -1.19%
+ Complexity 10727 9318 -1409
============================================
Files 711 633 -78
Lines 69456 59871 -9585
Branches 7452 6238 -1214
============================================
- Hits 32964 27706 -5258
+ Misses 32810 29111 -3699
+ Partials 3682 3054 -628
Flags with carried forward coverage won't be shown. Click here to find out more.
|
@congbobo184 Aha, sorry. I need to change the topic name to |
|
I use the workaround method to fix the restful endpoint @eolivelli @codelipenghui @liangyepianzhou Could you review it again? |
| if (topicName.isPartitioned()) { | ||
| return fetchPartitionedTopicMetadataAsync(TopicName.get(topicName.getPartitionedTopicName())) | ||
| .thenCompose((metadata) -> { | ||
| // Allow crate non-partitioned persistent topic that name includes `partition` |
There was a problem hiding this comment.
@mattisonchao There's a spelling problem here. crate -> create
Fixes #19085
Master Issue: #19085
Motivation
See #19085
ML: https://lists.apache.org/thread/3s7b7dh0h9qcnn8x3lclxmw75okkqf37
Modifications
Verifying this change
Documentation
docdoc-requireddoc-not-neededdoc-complete