[fix][txn] fix pattern sub filter transaction system topic - #16533
Merged
congbobo184 merged 2 commits intoJul 12, 2022
Merged
Conversation
added 2 commits
July 11, 2022 17:54
liangyepianzhou
approved these changes
Jul 12, 2022
Demogorgon314
approved these changes
Jul 12, 2022
congbobo184
added a commit
that referenced
this pull request
Jul 13, 2022
congbobo184
added a commit
that referenced
this pull request
Jul 13, 2022
nicoloboschi
pushed a commit
to datastax/pulsar
that referenced
this pull request
Jul 13, 2022
apache#16533) (cherry picked from commit e6eec02)
wuxuanqicn
pushed a commit
to wuxuanqicn/pulsar
that referenced
this pull request
Jul 14, 2022
) ### Motivation now if sub with txn will create pendingAck `managedLedger`, if one consumer use pattern sub by this namespace, will get the pendingAck `managedLedger` and try to sub the pendingAck `managedLedger`. then broker will try to create the pending ack topic, but now the pendingAck topic is forbidden to be created. So the consumer will not sub success. don't allow the user to get the pendingAck `managedLedger`, and sub the pendingAck `managedLedger`. ### Modifications filter the topic when users use patterns to get the topic's list. ### Verifying this change add the test
shibd
reviewed
Feb 28, 2023
|
|
||
| public static List<String> filterTransactionInternalName(List<String> original) { | ||
| return original.stream() | ||
| .filter(topic -> !SystemTopicNames.isTransactionInternalName(TopicName.get(topic))) |
Member
There was a problem hiding this comment.
Why just filter transaction internal name? Something like(__transaction_buffer_snapshot, __transaction_buffer_snapshot_segments, __transaction_buffer_snapshot_indexes) these doesn't seem to be filtered out
14 tasks
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
now if sub with txn will create pendingAck
managedLedger, if one consumer use pattern sub by this namespace, will get the pendingAckmanagedLedgerand try to sub the pendingAckmanagedLedger. then broker will try to create the pending ack topic, but now the pendingAck topic is forbidden to be created. So the consumer will not sub success.don't allow the user to get the pendingAck
managedLedger, and sub the pendingAckmanagedLedger.Modifications
filter the topic when users use patterns to get the topic's list.
Verifying this change
add the test
Does this pull request potentially affect one of the following parts:
If
yeswas chosen, please highlight the changesDocumentation
Does this pull request introduces a new feature? (yes)
If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)
If a feature is not applicable for documentation, explain why?
If a feature is not documented yet in this PR, please create a follow-up issue for adding the documentation
doc-not-needed