[fix] [broker] Fix break change: could not subscribe partitioned topic with a suffix-matched regexp due to a mistake of PIP-145#21885
Merged
Technoboy- merged 7 commits intoJan 15, 2024
Conversation
…exp due to PIP-145
codelipenghui
approved these changes
Jan 12, 2024
Contributor
|
/pulsarbot run-failure-checks |
coderzc
approved these changes
Jan 15, 2024
Technoboy-
reviewed
Jan 15, 2024
Technoboy-
reviewed
Jan 15, 2024
Technoboy-
approved these changes
Jan 15, 2024
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #21885 +/- ##
============================================
- Coverage 73.58% 73.52% -0.06%
- Complexity 32325 32345 +20
============================================
Files 1859 1859
Lines 138263 138359 +96
Branches 15153 15159 +6
============================================
- Hits 101736 101732 -4
- Misses 28644 28743 +99
- Partials 7883 7884 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Technoboy-
pushed a commit
that referenced
this pull request
Jan 19, 2024
…ic with a suffix-matched regexp due to a mistake of PIP-145 (#21885)
lhotari
reviewed
Jan 26, 2024
| closeAllConnections.invoke(pool, new Object[]{}); | ||
| } | ||
|
|
||
| public void reconnectAllConnections() throws Exception { |
Member
There was a problem hiding this comment.
This breaks Pulsar SQL / Trino tests in branch-3.1 and before. I created #21976 to address the problem.
4 tasks
mukesh-ctds
pushed a commit
to datastax/pulsar
that referenced
this pull request
Mar 1, 2024
…ic with a suffix-matched regexp due to a mistake of PIP-145 (apache#21885) (cherry picked from commit 4ebbd2f) (cherry picked from commit ce8c291)
mukesh-ctds
pushed a commit
to datastax/pulsar
that referenced
this pull request
Mar 6, 2024
…ic with a suffix-matched regexp due to a mistake of PIP-145 (apache#21885) (cherry picked from commit 4ebbd2f) (cherry picked from commit ce8c291)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
public/default/tphas one partition namedpublic/default/tp-partition-0. Pulsar will usepublic/default/tpto match the Regexp[1].public/default/tphas one partition namedpublic/default/tp-partition-0. Pulsar will usepublic/default/tp-partition-0to match the Regexp[2].It is a break change that is not expected; these changes are due to a mistake, and we should correct it.
Issue
If a consumer tries to subscribe to a partitioned topic with a suffix-matched regexp, it does not work.
persistent://public/default/tppersistent://public/default/tp$You can reproduce the issue by the test
testPreciseRegexpSubscribe.2.10.x>=2.11.0Modifications
Revert the behavior as the original implementation(before PIP-145)
Footnotes
[1]: the implementation of
2.10.xBinaryProtoLookupService.getTopicsUnderNamespacemerge partitions to one partitioned topic. E.g.) Pulsar client mergespublic/default/tp-partition-0andpublic/default/tp-partition-1to ``public/default/tp`PulsarClientImpl.topicsPatternFilterUse the partitioned topic name to match the regexp.BinaryProtoLookupService.getTopicsUnderNamespace: https://github.com/apache/pulsar/blob/branch-2.10/pulsar-client/src/main/java/org/apache/pulsar/client/impl/BinaryProtoLookupService.java#L332-L338PulsarClientImpl.topicsPatternFilter: https://github.com/apache/pulsar/blob/branch-2.10/pulsar-client/src/main/java/org/apache/pulsar/client/impl/PulsarClientImpl.java#L568-L577[2]: the implementation of
>=2.11.0TopicList.filterTopics()uses the partition name to match the regexp directly. See: https://github.com/apache/pulsar/blob/master/pulsar-common/src/main/java/org/apache/pulsar/common/topics/TopicList.java#L53-L57Documentation
docdoc-requireddoc-not-neededdoc-completeMatching PR in forked repository
PR in forked repository: x