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] TC end transaction retry. #9236

Merged

Conversation

congbobo184
Copy link
Contributor

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)

congbo added 10 commits January 12, 2021 23:40
# 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
category = CATEGORY_TRANSACTION,
doc = "End transaction operation retry interval time. (unit:second)"
)
private long endTxnOpRetryIntervalTime = 5;
Copy link
Contributor

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));
Copy link
Contributor

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.

Comment on lines 236 to 237
if (e.getCause() instanceof TransactionNotFoundException
|| e.getCause() instanceof InvalidTxnStatusException) {
Copy link
Contributor

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.

@congbobo184
Copy link
Contributor Author

/pulsarbot run-failure-checks

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

4 participants