-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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] TC end transaction retry. #9236
[Transaction] TC end transaction retry. #9236
Conversation
# Conflicts: # pulsar-broker/src/main/java/org/apache/pulsar/broker/TransactionMetadataStoreService.java # pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java # pulsar-common/src/main/proto/PulsarMarkers.proto # pulsar-transaction/coordinator/src/main/java/org/apache/pulsar/transaction/coordinator/impl/MLTransactionMetadataStore.java
…ransaction_op_retry
category = CATEGORY_TRANSACTION, | ||
doc = "End transaction operation retry interval time. (unit:second)" | ||
) | ||
private long endTxnOpRetryIntervalTime = 5; |
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.
If this is an internal retry logic in the TransactionMetadataService, we don't need to expose the configuration here.
} else if (TxnAction.ABORT.getValue() == txnAction) { | ||
return updateTxnStatus(txnID, TxnStatus.ABORTED, TxnStatus.ABORTING); | ||
} else { | ||
return FutureUtil.failedFuture(new Throwable("Unsupported txnAction " + txnAction)); |
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 complete with Throwable? It should be a transaction exception.
if (e.getCause() instanceof TransactionNotFoundException | ||
|| e.getCause() instanceof InvalidTxnStatusException) { |
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.
It's better to create a method isRetryableException()
to clearly list those exceptions that need to be retried. This will avoid stuck in an infinite retry situation.
/pulsarbot run-failure-checks |
Motivation
In order to retry end transaction.
implement
1.use timerTask to do this.
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)