Lalant commented on code in PR #7482:
URL: https://github.com/apache/ignite-3/pull/7482#discussion_r2884146780
##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/replicator/PartitionReplicaListener.java:
##########
@@ -3822,6 +3842,49 @@ private CompletableFuture<?>
processOperationRequestWithTxOperationManagementLog
}
}
+ private void storeFailureInTxMeta(ReplicaRequest request, Throwable
throwable) {
+ if (!(request instanceof ReadWriteReplicaRequest)) {
+ return;
+ }
+
+ UUID txId = ((ReadWriteReplicaRequest) request).transactionId();
+ Throwable toStore = unwrapRootCause(throwable);
+
+ txManager.enrichTxMeta(txId, old -> {
+ if (old == null || old.lastException() != null) {
+ return old;
+ }
+
+ return old.mutate()
+ .lastException(toStore)
+ .build();
+ });
+ }
+
+ private @Nullable TransactionException
transactionAlreadyFinishedException(ReplicaRequest request) {
+ if (!(request instanceof ReadWriteReplicaRequest)) {
+ return null;
+ }
+
+ UUID txId = ((ReadWriteReplicaRequest) request).transactionId();
+ TxStateMeta txStateMeta = txManager.stateMeta(txId);
+
+ if (txStateMeta == null || !(isFinalState(txStateMeta.txState()) ||
txStateMeta.txState() == FINISHING)) {
+ return null;
+ }
+
+ TxState txState = txStateMeta.txState();
+ boolean isFinishedDueToTimeout = txStateMeta.isFinishedDueToTimeout()
!= null && txStateMeta.isFinishedDueToTimeout();
+ Throwable cause = txStateMeta.lastException();
+
+ return new TransactionException(
+ isFinishedDueToTimeout ? TX_ALREADY_FINISHED_WITH_TIMEOUT_ERR
: TX_ALREADY_FINISHED_ERR,
+ format((isFinishedDueToTimeout ?
TX_ALREADY_FINISHED_DUE_TO_TIMEOUT : TX_ALREADY_FINISHED)
Review Comment:
To skip repeated exceptions. For example if we do retries in durableFinish.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]