denis-chudov commented on code in PR #3348:
URL: https://github.com/apache/ignite-3/pull/3348#discussion_r1519706772
##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/storage/InternalTableImpl.java:
##########
@@ -298,21 +320,55 @@ private <R> CompletableFuture<R> enlistInTx(
enlistmentConsistencyToken -> fac.apply(actualTx,
partGroupId, enlistmentConsistencyToken),
false,
primaryReplicaAndConsistencyToken,
- noWriteChecker,
- retryOnLockConflict
+ noWriteChecker
);
} else {
fut = enlistWithRetry(
actualTx,
partId,
enlistmentConsistencyToken -> fac.apply(actualTx,
partGroupId, enlistmentConsistencyToken),
implicit,
- noWriteChecker,
- retryOnLockConflict
+ noWriteChecker
);
}
- return postEnlist(fut, false, actualTx, implicit);
+ return postEnlist(fut, false, actualTx, implicit).handle((r, e) -> {
+ if (e != null) {
+ if (implicit) {
+ long ts = (txStartTs == null) ?
actualTx.startTimestamp().getPhysical() : txStartTs;
+
+ if (isRestartTransactionPossible(e) &&
coarseCurrentTimeMillis() - ts < implicitTransactionTimeout) {
+ return enlistInTx(row, null, fac, noWriteChecker, ts);
+ }
+ }
+
+ throw wrapReplicationException(e);
+ }
+
+ return completedFuture(r);
+ }).thenCompose(x -> x);
Review Comment:
looks like code duplication, seems it deserves a dedicated method
##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/storage/InternalTableImpl.java:
##########
@@ -121,6 +123,8 @@ public class InternalTableImpl implements InternalTable {
/** Primary replica await timeout. */
public static final int AWAIT_PRIMARY_REPLICA_TIMEOUT = 30;
+ private Long implicitTransactionTimeout =
IgniteSystemProperties.getLong("IGNITE_IMPLICIT_TRANSACTION_TIMEOUT", 3_000L);
Review Comment:
please add description what is this
--
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]