ascherbakoff commented on a change in pull request #8822:
URL: https://github.com/apache/ignite/pull/8822#discussion_r598602740



##########
File path: 
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
##########
@@ -939,11 +935,13 @@ public GridNearTxLocal newTx(
                 });
 
         for (IgniteInternalTx tx : activeTransactions()) {
-            if (tx.dht() && !tx.local() && 
tx.originatingNodeId().equals(node.id())) {
+            if (tx.state() == PREPARED /* recovery may be needed */

Review comment:
       This doesn't look correct to me. The transaction can be already in 
COMMITTING state, resulting in the exchange future finished before counters are 
applied due to race, and broken invariant HWM >= LWM as a consequence.

##########
File path: 
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxManager.java
##########
@@ -939,11 +935,13 @@ public GridNearTxLocal newTx(
                 });
 
         for (IgniteInternalTx tx : activeTransactions()) {
-            if (tx.dht() && !tx.local() && 
tx.originatingNodeId().equals(node.id())) {
+            if (tx.state() == PREPARED /* recovery may be needed */
+                // (primary (not on originating) or backup) || (primary on 
originating).
+                && (tx.dht() || (tx.near() && tx.local() && 
((GridNearTxLocal)tx).colocatedLocallyMapped()))

Review comment:
       This condition doesn't make sense to me. Looks like it can be replaced 
with 
   && tx.dht()




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to