Abandon remap after single map if future is done (fixes NPE)
@@ -368,13 +368,6 @@ public class GridNearOptimisticTxPrepareFuture extends GridNearOptimisticTxPrepa
GridDistributedTxMapping mapping = map(write, topVer, null, topLocked, remap);
- if (mapping.primary().isLocal()) {
- if (write.context().isNear())
- tx.nearLocallyMapped(true);
- else if (write.context().isColocated())
- tx.colocatedLocallyMapped(true);
- }
-
if (isDone()) {
if (log.isDebugEnabled())
log.debug("Abandoning (re)map because future is done: " + this);
@@ -382,6 +375,13 @@ public class GridNearOptimisticTxPrepareFuture extends GridNearOptimisticTxPrepa
return;
}
+ if (mapping.primary().isLocal()) {
+ if (write.context().isNear())
+ tx.nearLocallyMapped(true);
+ else if (write.context().isColocated())
+ tx.colocatedLocallyMapped(true);
+ }
+
if (keyLockFut != null)
keyLockFut.onAllKeysAdded();
