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

[fix][txn]: fix pending ack is recovering throw CursorAlreadyClosedxception #14781

Conversation

congbobo184
Copy link
Contributor

Motivation

When Transaction PendingAck recover fail throw CursorAlreadyClosedException, we should stop the recover op. the cursor was been closed, the pendingAck was been closed, so we should stop the recover op, in order to release thread resources

02:03:00.072 [pulsar-transaction-executor-4-1] ERROR org.apache.pulsar.broker.transaction.pendingack.impl.MLPendingAckStore - MLPendingAckStore of topic [public/default/persistent/source-topic-partition-13-test__transaction_pending_ack] stat reply fail!
org.apache.bookkeeper.mledger.ManagedLedgerException$CursorAlreadyClosedException: Cursor was already closed

Modifications

When recover fail by CursorAlreadyClosedException, comeplete recover

Verifying this change

add test 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)

Documentation

  • Does this pull request introduce 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 followup issue for adding the documentation

@@ -398,7 +398,7 @@ public Entry get() {
public void readEntriesFailed(ManagedLedgerException exception, Object ctx) {
if (managedLedger.getConfig().isAutoSkipNonRecoverableData()
&& exception instanceof ManagedLedgerException.NonRecoverableLedgerException
|| exception instanceof ManagedLedgerException.ManagedLedgerFencedException) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why remove the ManagedLedgerFencedException check?

Copy link
Contributor

Choose a reason for hiding this comment

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

And from the current implementation, if return isReadable here which means the pending ack reply will be complete, is it expected behavior? https://github.com/apache/pulsar/pull/14781/files#diff-07a1d142ec4105cb65fac733494182b461214a68d735ae1c3f5104c3eb4f92dbL363

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why remove the ManagedLedgerFencedException check?

we can't delete ManagedLedgerFencedException, that's my mistake

Copy link
Contributor Author

Choose a reason for hiding this comment

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

And from the current implementation, if return isReadable here which means the pending ack reply will be complete, is it expected behavior? https://github.com/apache/pulsar/pull/14781/files#diff-07a1d142ec4105cb65fac733494182b461214a68d735ae1c3f5104c3eb4f92dbL363

if ManagedLedgerFencedException or CursorAlreadyClosedxception, the pending ack has been closed so we can stop the recover.

@codelipenghui codelipenghui added this to the 2.11.0 milestone Mar 22, 2022
@codelipenghui codelipenghui added the type/bug The PR fixed a bug or issue reported a bug label Mar 22, 2022
@congbobo184 congbobo184 merged commit 9f30ee9 into apache:master Mar 23, 2022
codelipenghui pushed a commit that referenced this pull request Mar 24, 2022
…14810)

### Motivation
When Transactionlog recover fail throw CursorAlreadyClosedException, we should stop the recover op. the cursor was been closed, the transaction log was been closed, so we should stop the recover op, in order to release thread resources
like #14781

### Modifications
When recover fail by CursorAlreadyClosedException, comeplete recover
congbobo184 added a commit that referenced this pull request Mar 24, 2022
…14810)

### Motivation
When Transactionlog recover fail throw CursorAlreadyClosedException, we should stop the recover op. the cursor was been closed, the transaction log was been closed, so we should stop the recover op, in order to release thread resources
like #14781

### Modifications
When recover fail by CursorAlreadyClosedException, comeplete recover

(cherry picked from commit a14a97e)
congbobo184 added a commit that referenced this pull request Mar 25, 2022
…eption (#14781)

### Motivation
When Transaction PendingAck recover fail throw CursorAlreadyClosedException, we should stop the recover op. the cursor was been closed, the pendingAck was been closed, so we should stop the recover op, in order to release thread resources

```
02:03:00.072 [pulsar-transaction-executor-4-1] ERROR org.apache.pulsar.broker.transaction.pendingack.impl.MLPendingAckStore - MLPendingAckStore of topic [public/default/persistent/source-topic-partition-13-test__transaction_pending_ack] stat reply fail!
org.apache.bookkeeper.mledger.ManagedLedgerException$CursorAlreadyClosedException: Cursor was already closed
```

### Modifications
When recover fail by CursorAlreadyClosedException, comeplete recover
### Verifying this change
add test for it

(cherry picked from commit 9f30ee9)
@codelipenghui codelipenghui added the cherry-picked/branch-2.9 Archived: 2.9 is end of life label Mar 25, 2022
codelipenghui pushed a commit that referenced this pull request Mar 25, 2022
…#14807)

### Motivation
When Transaction buffer recover fail throw CursorAlreadyClosedException, we should stop the recover op. the cursor was been closed, the transaction buffer was been closed, so we should stop the recover op, in order to release thread resources
like #14781
codelipenghui pushed a commit that referenced this pull request Mar 25, 2022
…#14807)

### Motivation
When Transaction buffer recover fail throw CursorAlreadyClosedException, we should stop the recover op. the cursor was been closed, the transaction buffer was been closed, so we should stop the recover op, in order to release thread resources
like #14781

(cherry picked from commit aef5f6d)
codelipenghui pushed a commit that referenced this pull request Apr 19, 2022
…eption (#14781)

### Motivation
When Transaction PendingAck recover fail throw CursorAlreadyClosedException, we should stop the recover op. the cursor was been closed, the pendingAck was been closed, so we should stop the recover op, in order to release thread resources

```
02:03:00.072 [pulsar-transaction-executor-4-1] ERROR org.apache.pulsar.broker.transaction.pendingack.impl.MLPendingAckStore - MLPendingAckStore of topic [public/default/persistent/source-topic-partition-13-test__transaction_pending_ack] stat reply fail!
org.apache.bookkeeper.mledger.ManagedLedgerException$CursorAlreadyClosedException: Cursor was already closed
```

### Modifications
When recover fail by CursorAlreadyClosedException, comeplete recover
### Verifying this change
add test for it

(cherry picked from commit 9f30ee9)
codelipenghui pushed a commit that referenced this pull request Apr 19, 2022
…14810)

### Motivation
When Transactionlog recover fail throw CursorAlreadyClosedException, we should stop the recover op. the cursor was been closed, the transaction log was been closed, so we should stop the recover op, in order to release thread resources
like #14781

### Modifications
When recover fail by CursorAlreadyClosedException, comeplete recover

(cherry picked from commit a14a97e)
codelipenghui pushed a commit that referenced this pull request Apr 19, 2022
…#14807)

### Motivation
When Transaction buffer recover fail throw CursorAlreadyClosedException, we should stop the recover op. the cursor was been closed, the transaction buffer was been closed, so we should stop the recover op, in order to release thread resources
like #14781

(cherry picked from commit aef5f6d)
Nicklee007 pushed a commit to Nicklee007/pulsar that referenced this pull request Apr 20, 2022
…eption (apache#14781)

### Motivation
When Transaction PendingAck recover fail throw CursorAlreadyClosedException, we should stop the recover op. the cursor was been closed, the pendingAck was been closed, so we should stop the recover op, in order to release thread resources

```
02:03:00.072 [pulsar-transaction-executor-4-1] ERROR org.apache.pulsar.broker.transaction.pendingack.impl.MLPendingAckStore - MLPendingAckStore of topic [public/default/persistent/source-topic-partition-13-test__transaction_pending_ack] stat reply fail!
org.apache.bookkeeper.mledger.ManagedLedgerException$CursorAlreadyClosedException: Cursor was already closed
```

### Modifications
When recover fail by CursorAlreadyClosedException, comeplete recover
### Verifying this change
add test for it
Nicklee007 pushed a commit to Nicklee007/pulsar that referenced this pull request Apr 20, 2022
…pache#14810)

### Motivation
When Transactionlog recover fail throw CursorAlreadyClosedException, we should stop the recover op. the cursor was been closed, the transaction log was been closed, so we should stop the recover op, in order to release thread resources
like apache#14781

### Modifications
When recover fail by CursorAlreadyClosedException, comeplete recover
Nicklee007 pushed a commit to Nicklee007/pulsar that referenced this pull request Apr 20, 2022
…apache#14807)

### Motivation
When Transaction buffer recover fail throw CursorAlreadyClosedException, we should stop the recover op. the cursor was been closed, the transaction buffer was been closed, so we should stop the recover op, in order to release thread resources
like apache#14781
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.3 release/2.10.1 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.

3 participants