-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[improve][broker] checkTopicExists supports checking partitioned topic without index #21701
Conversation
…c without index Signed-off-by: Zixuan Liu <nodeces@gmail.com>
bb1c587
to
4c02fbe
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should keep the original logic(check isPersistent
first ) to avoid the topic is non-partitioned non-persistent
Signed-off-by: Zixuan Liu <nodeces@gmail.com>
4229726
to
5ce1082
Compare
@Technoboy- Done. |
/pulsarbot rerun-failure-checks |
Signed-off-by: Zixuan Liu <nodeces@gmail.com>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #21701 +/- ##
============================================
- Coverage 73.40% 73.38% -0.02%
- Complexity 32662 32757 +95
============================================
Files 1893 1893
Lines 140767 140709 -58
Branches 15506 15500 -6
============================================
- Hits 103328 103262 -66
- Misses 29321 29339 +18
+ Partials 8118 8108 -10
Flags with carried forward coverage won't be shown. Click here to find out more.
|
…c without index (#21701) Signed-off-by: Zixuan Liu <nodeces@gmail.com>
…c without index (apache#21701) Signed-off-by: Zixuan Liu <nodeces@gmail.com> (cherry picked from commit 8b8048c)
…c without index (apache#21701) Signed-off-by: Zixuan Liu <nodeces@gmail.com> (cherry picked from commit 8b8048c)
…c without index (apache#21701) Signed-off-by: Zixuan Liu <nodeces@gmail.com> (cherry picked from commit 8b8048c)
…c without index (apache#21701) Signed-off-by: Zixuan Liu <nodeces@gmail.com> (cherry picked from commit 8b8048c)
Motivation
The
checkTopicExists
method doesn't support checking the partitioned topic without the partition index.Modifications
Refactor the
checkTopicExists
method:-partition-
, find the topic from the/managed-ledger
path.managed-ledger
path, returntrue
, otherwise continue finding.getPartitionedTopicName()
name to query the metadata of the topic from/admin/partitioned-topics
path, and returntrue
ifmetadata.partitions
is greater than 0, indicating that it is a partitioned topic and exists, otherwise go and find if the non-partitioned topic exist, the persistent topic exists in the/managed-ledgers
path, the non-persistent topic only exist in the broker'stopics
map.Verifying this change
Added test.
Documentation
doc
doc-required
doc-not-needed
doc-complete