-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[fix][txn] fix pattern sub filter transaction system topic #16533
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
[fix][txn] fix pattern sub filter transaction system topic #16533
Conversation
gaoran10
left a comment
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.
LGTM
apache#16533) (cherry picked from commit e6eec02)
) ### 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
|
|
||
| public static List<String> filterTransactionInternalName(List<String> original) { | ||
| return original.stream() | ||
| .filter(topic -> !SystemTopicNames.isTransactionInternalName(TopicName.get(topic))) |
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.
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
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