Skip to content
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

[Transaction] Fix delete sub then delete pending ack. #11023

Conversation

congbobo184
Copy link
Contributor

Motivation

now delete topic sub don't delete pending ack topic. delete pending ack topic.

implement

delete pending ack topic.

Verifying this change

Add the tests for it

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)

@Anonymitaet
Copy link
Member

@congbobo184 does this affect docs?

Copy link
Contributor

@eolivelli eolivelli left a comment

Choose a reason for hiding this comment

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

Thanks for working on this.

That triggers the creation of these additional topics? We should try the deletion of them only in such cases, otherwise we will impact every unsubscribe operations.

If there is no other way then I am fine with this approach

@@ -955,7 +956,31 @@ private void resetSubscriptionCursor(Subscription subscription, CompletableFutur
@Override
public CompletableFuture<Void> unsubscribe(String subscriptionName) {
CompletableFuture<Void> unsubscribeFuture = new CompletableFuture<>();
getBrokerService().getManagedLedgerFactory().asyncDelete(TopicName.get(MLPendingAckStore
Copy link
Contributor

Choose a reason for hiding this comment

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

We should try this only in case we have transactions enabled?
Otherwise we are going to slow down every 'unsubscribe' operation with additional operations (look-up, metadata...)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

if we enabled after disable, we will not have method to delete this, so we should every time delete pendingAck. I think we don't need to think about delete cursor speed.

Copy link
Contributor

Choose a reason for hiding this comment

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

my main concern is about Readers
the reader will unsubscribe the temporary subscription.

but probably the Reader problem is different...should we create pending acks topics for Readers ? and for Non Durable subscriptions ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

now, may don't think about the NonPersistentSubscription, this can be considered later.

@congbobo184
Copy link
Contributor Author

@congbobo184 does this affect docs?

don't need.

congbo added 6 commits June 25, 2021 17:20
…_pending_ack_store_log

# Conflicts:
#	pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java
Copy link
Contributor

@codelipenghui codelipenghui left a comment

Choose a reason for hiding this comment

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

@congbobo184 Do we need to handle the pending ack state when deleting the subscription

@codelipenghui
Copy link
Contributor

@congbobo184 Can you rebase to the master branch?

@liangyepianzhou
Copy link
Contributor

/pulsarbot run-failure-checks

@hangc0276
Copy link
Contributor

@congbobo184 I am cutting the 2.8.1 release, could you rebase the master branch and resolve the conflicts?

congbo added 3 commits August 6, 2021 14:12
…ete_subscription_delete_pending_ack_store_log

# Conflicts:
#	pulsar-broker/src/test/java/org/apache/pulsar/broker/transaction/pendingack/PendingAckPersistentTest.java
Copy link
Contributor

@eolivelli eolivelli 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 a50fe87 into apache:master Aug 9, 2021
LeBW pushed a commit to LeBW/pulsar that referenced this pull request Aug 9, 2021
Fix delete sub then delete pending ack managedledger.
hangc0276 pushed a commit that referenced this pull request Aug 12, 2021
Fix delete sub then delete pending ack managedledger.

(cherry picked from commit a50fe87)
@hangc0276 hangc0276 added the cherry-picked/branch-2.8 Archived: 2.8 is end of life label Aug 12, 2021
bharanic-dev pushed a commit to bharanic-dev/pulsar that referenced this pull request Mar 18, 2022
Fix delete sub then delete pending ack managedledger.
@congbobo184 congbobo184 deleted the congbobo184_fix_delete_subscription_delete_pending_ack_store_log branch March 24, 2022 04:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants