ascherbakoff commented on code in PR #2720:
URL: https://github.com/apache/ignite-3/pull/2720#discussion_r1421720818


##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/storage/InternalTableImpl.java:
##########
@@ -465,25 +472,31 @@ private <R> CompletableFuture<R> enlistWithRetry(
             Function<Long, ReplicaRequest> mapFunc,
             int attempts,
             boolean full,
-            @Nullable BiPredicate<R, ReplicaRequest> noWriteChecker
+            @Nullable BiPredicate<R, ReplicaRequest> noWriteChecker,
+            boolean retryOnLockConflict
     ) {
-        return enlist(partId, tx)
-                .thenCompose(primaryReplicaAndTerm -> trackingInvoke(tx, 
partId, mapFunc, full, primaryReplicaAndTerm, noWriteChecker))
-                .handle((response, e) -> {
-                    if (e == null) {
-                        return completedFuture(response);
-                    }
+        return (CompletableFuture<R>) enlist(partId, tx)
+                .thenCompose(primaryReplicaAndTerm -> trackingInvoke(tx, 
partId, mapFunc, full, primaryReplicaAndTerm, noWriteChecker,
+                        retryOnLockConflict))
+                .handle((res0, e) -> {
+                    if (e != null) {
+                        // We can safely retry indefinitely on deadlock 
prevention.
+                        if (retryOnLockConflict && e.getCause() instanceof 
LockException) {

Review Comment:
   Currently this is implemented as 2. 
   1 is no way, 3 is a bit more complex than 2 but also suitable. 
   I would stick with 2.



-- 
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]

Reply via email to