Skip to content

Conversation

@congbobo184
Copy link
Contributor

@congbobo184 congbobo184 commented Jul 12, 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

Does this pull request potentially affect one of the following parts:

If yes was chosen, please highlight the changes

  • Dependencies (does it add or upgrade a dependency): (no)
  • The public API: (no)
  • The schema: (no)
  • The default values of configurations: (no)
  • The wire protocol: (no)
  • The rest endpoints: (no)
  • The admin cli options: (no)
  • Anything that affects deployment: (no)

Documentation

  • 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

@congbobo184 congbobo184 added type/bug The PR fixed a bug or issue reported a bug area/transaction doc-not-needed Your PR changes do not impact docs release/2.10.2 release/2.9.4 labels Jul 12, 2022
@congbobo184 congbobo184 added this to the 2.11.0 milestone Jul 12, 2022
@congbobo184 congbobo184 self-assigned this Jul 12, 2022
Copy link
Contributor

@gaoran10 gaoran10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@congbobo184 congbobo184 merged commit 3fb5e56 into apache:master Jul 12, 2022
nicoloboschi pushed a commit to datastax/pulsar that referenced this pull request Jul 13, 2022
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
@mattisonchao mattisonchao added the cherry-picked/branch-2.9 Archived: 2.9 is end of life label Jul 15, 2022

public static List<String> filterTransactionInternalName(List<String> original) {
return original.stream()
.filter(topic -> !SystemTopicNames.isTransactionInternalName(TopicName.get(topic)))
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/transaction cherry-picked/branch-2.9 Archived: 2.9 is end of life cherry-picked/branch-2.10 doc-not-needed Your PR changes do not impact docs release/2.9.4 release/2.10.2 type/bug The PR fixed a bug or issue reported a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants